Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in libjxl detection #24

Closed
wants to merge 1 commit into from
Closed

Fix typo in libjxl detection #24

wants to merge 1 commit into from

Conversation

jbeich
Copy link
Contributor

@jbeich jbeich commented Feb 14, 2022

libjxl (unlike brunsli) always supported pkg-config: either libjpegxl.pc (before v0.1) or libjxl.pc (since v0.1). Otherwise, find_library('foo') tests via -lfoo which expands to libfoo.so (or libfoo.a) but -l:foo expands to foo.

$ pkg info -x libjxl
libjxl-0.6.1_2

$ meson setup -Djxl=enabled _build
[...]
meson.build:35:0: ERROR: C shared or static library 'libjxl' not found

ld: error: unable to find library -llibjxl
@artemsen
Copy link
Owner

Looks like there is a problem with dependency declaration in libjxl.pc, it has libhwy as "requires", but hwy is needed only to build libjxl itself.
My system (Arch with libjxl 0.6.1-3) doesn't have libhwy.pc and pkconfig fails with:

$ pkg-config --cflags libjxl
Package libhwy was not found in the pkg-config search path.

As a result, meson cannot find libjxl:

The Meson build system
Version: 0.61.1
...
Run-time dependency libjxl found: NO (tried pkgconfig and cmake)
...

let's postpone this patch until Arch has a correct libjxl.pc.

@eli-schwartz
Copy link

Looks like there is a problem with dependency declaration in libjxl.pc, it has libhwy as "requires", but hwy is needed only to build libjxl itself.

I think this betrays a misunderstanding of how pkg-config works. Private dependencies must be installed, as a rule in order for the library to work. Whether the private dependencies get printed out as additional -lfoo flags is beside the point.

pkg-config requires private dependencies to exist, even without pkg-config --static, as a sanity check. So the real question would probably be "why, on some systems, is libjxl's dependency, libhwy, not installed as a dependency?"

@artemsen
Copy link
Owner

So the real question would probably be "why, on some systems, is libjxl's dependency, libhwy, not installed as a dependency?"

Ok, you are right.
But I don't want to declare libhwy as a dependency of Swayimg, so...
Let's postpone this patch until Arch has a correct libjxl.pc libhwy installed as dependency of libjxl =)

@artemsen
Copy link
Owner

Bug report in Arch: https://bugs.archlinux.org/task/73931

artemsen added a commit that referenced this pull request Mar 8, 2022
Bug report in Arch: https://bugs.archlinux.org/task/73931

Resolves #24.

Signed-off-by: Artem Senichev <artemsen@gmail.com>
artemsen added a commit that referenced this pull request Mar 8, 2022
Bug report in Arch: https://bugs.archlinux.org/task/73931

Resolves #24.

Signed-off-by: Artem Senichev <artemsen@gmail.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants