From 04a0b1e938f0479ece2acff5144db7854e5f7bb81c219eaaa617ae3d46f5f873 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Mon, 10 Aug 2020 05:07:59 +0000 Subject: [PATCH] - Add /usr/local paths to pkg-config(1) search path for non RPM builds (boo#1175039) OBS-URL: https://build.opensuse.org/package/show/devel:tools/pkgconf?expand=0&rev=20 --- pkgconf.changes | 5 +++++ pkgconf.spec | 7 +++++-- platform-pkg-config.in | 12 +++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pkgconf.changes b/pkgconf.changes index 93d3cae..bd9b693 100644 --- a/pkgconf.changes +++ b/pkgconf.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 10 05:03:07 UTC 2020 - Neal Gompa + +- Add /usr/local paths to pkg-config(1) search path for non RPM builds (boo#1175039) + ------------------------------------------------------------------- Mon Jun 15 08:30:00 UTC 2020 - Callum Farmer diff --git a/pkgconf.spec b/pkgconf.spec index cb95a83..d79ca6d 100644 --- a/pkgconf.spec +++ b/pkgconf.spec @@ -2,7 +2,7 @@ # spec file for package pkgconf # # Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. -# Copyright (c) 2019 Neal Gompa . +# Copyright (c) 2020 Neal Gompa . # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -168,12 +168,15 @@ rm -rf %{buildroot}%{_datadir}/doc/%{name} install -pm 0755 %{SOURCE1} %{buildroot}%{_bindir}/%{pkgconf_target_platform}-pkg-config sed -e "s|@TARGET_PLATFORM@|%{pkgconf_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}/%{pkgconf_target_platform}-pkg-config -ln -sf pkgconf %{buildroot}%{_bindir}/pkg-config +ln -sr %{buildroot}%{_bindir}/%{pkgconf_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 diff --git a/platform-pkg-config.in b/platform-pkg-config.in index 569c4b1..5e9ff62 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 "$@"