Created attachment 8975 [details]
pkg-config patch to add directories to --with-pc-path
Description of problem:
When running a configure script to try and install a package not included in Mageia's repositories, pkg-config does not look in /usr/local to see if a dependency has been installed.
Other operating systems such as Debian and OpenSuSE include the /usr/local directories in their built versions of pkg-config by default. However on the other end SLAX does not.
Version-Release number of selected component (if applicable):
(used 0.29-1 source package)
Every time I run pkg-config to query the status of a package installed in /usr/local no results are returned and does not appear in the list when doing pkg-config --list-all unless I override it with the PKG_CONFIG_PATH variable.
Steps to Reproduce:
0. To get the paths pkg-config uses enter pkg-config --variable pc_path pkg-config
1. Manually compile a recently released package and install into /usr/local (SFML for example)
2. Enter pkg-config --list-all or pkg-config --modversion sfml-all
The attached patch changes the RPM specification file by adding directories to the configure --with-pc-path parameter and creation of the directories and symbolic links as needed in /usr/local. It adds /usr/local/(arch)/pkgconfig, /usr/local/(arch)/pkgconfig/32 and /usr/local/share/pkgconfig.
I accept that I could use PKG_CONFIG_PATH everytime I run configure but as Debian and OpenSuSE include the /usr/local paths for pkg-config I'm not sure if not including /usr/local is "a feature and not a bug" with Mageia. As this would only apply to developers and those installing their own software in /usr/local, this would be a minor bug.
Assigning to all packagers collectively, since there is no registered maintainer for this package.
If it is decided to apply this patch, it should probably be done for Cauldron, too.
Pushed new pkgconfig  to core/updates_testing for mga5 which should fix the issue. Updated Cauldron pkg also.
Pkgconfig pkg doesn't ship directories under /usr/local/, but pkg-config should find files under it. Please test.
Pushed new version  which adds one more search directory, /usr/local/lib/pkgconfig, for 64bit systems.
Advisory made from comments 0, 2, 3.
Tested new pkgconfig with the new search directories.
All good on my end! It is now picking up the packages from the directories in /usr/local.
(In reply to Stephen Brokenshire from comment #5)
> Tested new pkgconfig with the new search directories.
> All good on my end! It is now picking up the packages from the directories
> in /usr/local.
Thanks for the feedback. Which version did you test?
I've tested pkgconfig-0.28-4.2.mga5.x86_64.
On i586, using 'strace pkg-config --cflags --libs /usr/lib/pkgconfig/xorg-mouse.pc 2>&1|grep /usr/local' confirms it's now checking /usr/local.
Validating the update
An update for this issue has been pushed to the Mageia Updates repository.