From 05c8560a2eadac70cdc0e66554b5a4a6ac298f01 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Mon, 10 Aug 2020 00:56:48 -0400 Subject: [PATCH] Add /usr/local paths to pkg-config(1) search path for non RPM builds --- pkgconf.spec | 10 ++++++++-- platform-pkg-config.in | 12 +++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pkgconf.spec b/pkgconf.spec index d556a68..5ce3e02 100644 --- a/pkgconf.spec +++ b/pkgconf.spec @@ -17,7 +17,7 @@ Name: pkgconf Version: 1.7.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Package compiler and linker metadata toolkit License: ISC @@ -138,12 +138,15 @@ EOM install -pm 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{_target_platform}-pkg-config sed -e "s|@TARGET_PLATFORM@|%{_target_platform}|" \ + -e "s|@PKGCONF_LIBDIRS_LOCAL@|/usr/local/%{_lib}/pkgconfig:/usr/local/share/pkgconfig:%{pkgconf_libdirs}|" \ + -e "s|@PKGCONF_SYSLIBDIR_LOCAL@|/usr/local/%{_lib}:%{_libdir}|" \ + -e "s|@PKGCONF_SYSINCDIR_LOCAL@|/usr/local/include:%{_includedir}|" \ -e "s|@PKGCONF_LIBDIRS@|%{pkgconf_libdirs}|" \ -e "s|@PKGCONF_SYSLIBDIR@|%{_libdir}|" \ -e "s|@PKGCONF_SYSINCDIR@|%{_includedir}|" \ -i %{buildroot}%{_bindir}/%{_target_platform}-pkg-config -ln -sf pkgconf %{buildroot}%{_bindir}/pkg-config +ln -sr %{buildroot}%{_bindir}/%{_target_platform}-pkg-config %{buildroot}%{_bindir}/pkg-config # Link pkg-config(1) to pkgconf(1) echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/pkg-config.1 @@ -195,6 +198,9 @@ rm -rf %{buildroot}%{_datadir}/aclocal %endif %changelog +* Mon Aug 10 2020 Neal Gompa - 1.7.3-2 +- Add /usr/local paths to pkg-config(1) search path for non RPM builds + * Mon Aug 03 2020 Neal Gompa - 1.7.3-1 - Update to 1.7.3 diff --git a/platform-pkg-config.in b/platform-pkg-config.in index d95f153..51c37d3 100644 --- a/platform-pkg-config.in +++ b/platform-pkg-config.in @@ -3,8 +3,14 @@ # Simple wrapper to tell pkgconf to behave as a platform-specific version of pkg-config # Platform: @TARGET_PLATFORM@ -export PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR:-@PKGCONF_LIBDIRS@}" -export PKG_CONFIG_SYSTEM_LIBRARY_PATH="${PKG_CONFIG_SYSTEM_LIBRARY_PATH:-@PKGCONF_SYSLIBDIR@}" -export PKG_CONFIG_SYSTEM_INCLUDE_PATH="${PKG_CONFIG_SYSTEM_INCLUDE_PATH:-@PKGCONF_SYSINCDIR@}" +if [ -z "${RPM_BUILD_ROOT}" ]; then + export PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR:-@PKGCONF_LIBDIRS_LOCAL@}" + export PKG_CONFIG_SYSTEM_LIBRARY_PATH="${PKG_CONFIG_SYSTEM_LIBRARY_PATH:-@PKGCONF_SYSLIBDIR_LOCAL@}" + export PKG_CONFIG_SYSTEM_INCLUDE_PATH="${PKG_CONFIG_SYSTEM_INCLUDE_PATH:-@PKGCONF_SYSINCDIR_LOCAL@}" +else + export PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR:-@PKGCONF_LIBDIRS@}" + export PKG_CONFIG_SYSTEM_LIBRARY_PATH="${PKG_CONFIG_SYSTEM_LIBRARY_PATH:-@PKGCONF_SYSLIBDIR@}" + export PKG_CONFIG_SYSTEM_INCLUDE_PATH="${PKG_CONFIG_SYSTEM_INCLUDE_PATH:-@PKGCONF_SYSINCDIR@}" +fi exec pkgconf "$@"