If a .pc file is missing, it prints an error saying "Perhaps you should add the directory containing 'foo.pc' to PKG_CONFIG_PATH environment variable". In 100% of the cases I have encountered this is not what is wrong. In every one of them the solution is to add 'foo.pc' to a directory already existing in PKG_CONFIG_PATH or the built-in path (by installing the missing package). A better message is: 'foo.pc' not found in $PKG_CONFIG_PATH or /usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig This should indicate that in the rare case of the file already existing that fixing the environment variable PKG_CONFIG_PATH will work. It also shows the search path, which is hard to find out otherwise.
Created attachment 99544 [details] [review] 0001-If-a-package-can-t-be-found-print-the-search-path-to.patch
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/12.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.