I'm building a small app using gtk+-3.0 in Gnome Builder, but I want to use libzip for some functions. But apparently meson is not accepting to add libzip. See my snippet:
foo_deps = [
dependency('libzip', version: '>= 1.5.0'),
dependency('gio-2.0', version: '>= 2.50'),
dependency('gtk+-3.0', version: '>= 3.22')
]
This is my error message:
../../../../../../Projetos/foo/src/meson.build:8:0: ERROR: Dependency "libzip" not found, tried pkgconfig and cmake
But libzip IS listed as a pkgconfig package:
[vinicius@maclinux ~]$ pkg-config --list-all | grep libzip
libzip libzip - library for handling zip archives
And:
[vinicius@maclinux ~]$ pkg-config --libs libzip
-lzip
Finally:
[vinicius@maclinux ~]$ ls -l /usr/include | grep zip.h
-rw-r--r-- 1 root root 26491 mar 2 2021 zip.h
I'm stucked. I couldn't find any help in internet regarding libzip using together meson. I tried to just ommit libzip and a dependency but meson complains that it can't find zip.h.
I am running this in ArchLinux.
[UPDATE] If I compile manually using meson, it works. The problem occurs only inside GNOME Builder.
If you can build directly with meson and cannot with GNOME builder - this points to missing PKG_CONFIG_PATH configuration in the latter case, i.e. environment variable with the list of paths where *.pc (pkg config files) are searched.
Check where libzip.pc is located:
I've never used GNOME builder but I found the following documentation page: Use Custom Sysroot.
So, if libzip.pc in none of above, you should
and it will land to ~/.config/gnome-builder/sysroot/general.conf
PS It could be also useful to check where all *.pc files located:
and add these paths according to above.