GNOME Bugzilla – Bug 679852
build failure: Package gio-2.0 was not found in the pkg-config search path
Last modified: 2012-07-13 14:00:18 UTC
I am building libsecret git master via JHBuild on Fedora 17. The build fails with log below. I do have Package gio-2.0 installed. I noticed in the log below libsecret is overriding PKG_CONFIG_PATH to '.', hence why libsecret can't find my gio-2.0. Making all in . make[4]: Entering directory `/home/oxyde/gnome/build/libsecret/libsecret' PKG_CONFIG_PATH=. /opt/gnome/bin/g-ir-scanner --warn-all --add-include-path=. --add-include-path=. --namespace=Secret --nsversion=1 --libtool="/bin/sh ../libtool" --pkg=gobject-2.0 --pkg=gio-2.0 --include=GObject-2.0 --include=Gio-2.0 --pkg-export=libsecret-1 --library=libsecret-1.la --c-include "libsecret/secret.h" -I.. -I.. -DSECRET_COMPILATION secret-attributes.h secret-attributes.c secret-password.h secret-password.c secret-schema.h secret-schema.c secret-types.h libsecret-1.la --output Secret-1.gir Package gio-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gio-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gio-2.0' found Package gio-unix-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gio-unix-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gio-unix-2.0' found Package gobject-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `gobject-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'gobject-2.0' found Package glib-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `glib-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'glib-2.0' found In file included from <stdin>:4:0: /home/oxyde/gnome/build/libsecret/libsecret/secret-attributes.h:22:18: fatal error: glib.h: No such file or directory compilation terminated. Error while processing the source. make[4]: *** [Secret-1.gir] Error 1 make[4]: Leaving directory `/home/oxyde/gnome/build/libsecret/libsecret' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/oxyde/gnome/build/libsecret/libsecret' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/oxyde/gnome/build/libsecret/libsecret' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/oxyde/gnome/build/libsecret' make: *** [all] Error 2
Hmmm, $PKG_CONFIG_PATH doesn't override the default search directory of pkg-config. At least that's what the man page says. Does g-ir-scanner have the same behavior Colin?
(In reply to comment #1) > Hmmm, $PKG_CONFIG_PATH doesn't override the default search directory of > pkg-config. At least that's what the man page says. That's true, but jhbuild sets PKG_CONFIG_PATH, and this bit will break it. It's true it won't break dpkg/rpm/ostree style builds which are in chroots, and don't rely on PKG_CONFIG_PATH being set. I'm not sure why commit 1b84a1ad42fdb9bf40cf8d3c9cd8b76ae798bd98 added this line, but it is broken.
Ah, you want to use --include-uninstalled=B when you have two shared libraries inside a module, where A depends on B. Patch coming.
Created attachment 218723 [details] [review] build: Various introspection-related build fixes Don't set PKG_CONFIG_PATH, this breaks jhbuild; instead, use --include-uninstalled to tell the scanner where to find internal libraries. Don't set _PACKAGES = gio-2.0; we already pick that up from the Gio-2.0.gir.
(Tested via jhbuild uninstall libsecret; git clean -dfx; jhbuild make -a)
Thanks! Merged into master.