Compare commits

..

No commits in common. 'c9' and 'i8c' have entirely different histories.
c9 ... i8c

2
.gitignore vendored

@ -1 +1 @@
SOURCES/pkgconf-1.7.3.tar.xz
SOURCES/pkgconf-1.4.2.tar.xz

@ -1 +1 @@
e90c3d993b7d2246d3b72ab558591a07c3b22ee2 SOURCES/pkgconf-1.7.3.tar.xz
28caf985acabb06fe48eb89c4b2a8c5342ca4859 SOURCES/pkgconf-1.4.2.tar.xz

@ -1,124 +0,0 @@
From 305b359d7d07840df3e420e6b08f91c01abe6012 Mon Sep 17 00:00:00 2001
From: Sandro Mani <manisandro@gmail.com>
Date: Wed, 23 Jun 2021 14:09:05 +0200
Subject: [PATCH] Don't prepend sysroot_dir if pkg-config file lies outside of
sysroot_dir
(cherry picked from commit ed86f2dda3bc99e34775f0fae54e314718037516)
---
libpkgconf/pkg.c | 10 ++++++++++
tests/regress.sh | 28 ++++++++++++----------------
tests/test_env.sh.in | 2 +-
3 files changed, 23 insertions(+), 17 deletions(-)
diff --git a/libpkgconf/pkg.c b/libpkgconf/pkg.c
index 214f544..fff6eda 100644
--- a/libpkgconf/pkg.c
+++ b/libpkgconf/pkg.c
@@ -378,6 +378,16 @@ pkgconf_pkg_new_from_file(pkgconf_client_t *client, const char *filename, FILE *
pkg->pc_filedir = pkg_get_parent_dir(pkg);
pkgconf_tuple_add(client, &pkg->vars, "pcfiledir", pkg->pc_filedir, true);
+ /* If pc_filedir is outside of sysroot_dir, clear pc_filedir
+ /* See https://github.com/pkgconf/pkgconf/issues/213
+ */
+ if (client->sysroot_dir && strncmp(pkg->pc_filedir, client->sysroot_dir, strlen(client->sysroot_dir)))
+ {
+ free(client->sysroot_dir);
+ client->sysroot_dir = NULL;
+ pkgconf_client_set_sysroot_dir(client, NULL);
+ }
+
/* make module id */
if ((idptr = strrchr(pkg->filename, PKG_DIR_SEP_S)) != NULL)
idptr++;
diff --git a/tests/regress.sh b/tests/regress.sh
index 47877d4..04d4042 100755
--- a/tests/regress.sh
+++ b/tests/regress.sh
@@ -112,7 +112,7 @@ libs_never_mergeback_body()
export PKG_CONFIG_PATH="${selfdir}/lib1"
atf_check \
-o inline:"-L/test/bar/lib -lfoo1 \n" \
- pkgconf --libs prefix-foo1
+ pkgconf --libs prefix-foo1
atf_check \
-o inline:"-L/test/bar/lib -lfoo1 -lfoo2 \n" \
pkgconf --libs prefix-foo1 prefix-foo2
@@ -160,9 +160,9 @@ isystem_munge_order_body()
isystem_munge_sysroot_body()
{
- export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR='/test'
+ export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="${selfdir}"
atf_check \
- -o match:"-isystem /test/opt/bad/include" \
+ -o match:"-isystem ${selfdir}/opt/bad/include" \
pkgconf --cflags isystem
}
@@ -176,9 +176,9 @@ idirafter_munge_order_body()
idirafter_munge_sysroot_body()
{
- export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR='/test'
+ export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="${selfdir}"
atf_check \
- -o match:"-idirafter /test/opt/bad/include" \
+ -o match:"-idirafter ${selfdir}/opt/bad/include" \
pkgconf --cflags idirafter
}
@@ -195,20 +195,16 @@ pcpath_body()
export PKG_CONFIG_PATH="${selfdir}/lib2"
atf_check \
-o inline:"-fPIC -I/test/include/foo \n" \
- pkgconf --cflags ${selfdir}/lib3/bar.pc
+ pkgconf --cflags ${selfdir}/lib3/bar.pc
}
sysroot_munge_body()
{
- export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="/sysroot"
+ sed "s|/sysroot/|${selfdir}/|g" ${selfdir}/lib1/sysroot-dir.pc > ${selfdir}/lib1/sysroot-dir-selfdir.pc
+ export PKG_CONFIG_PATH="${selfdir}/lib1" PKG_CONFIG_SYSROOT_DIR="${selfdir}"
atf_check \
- -o inline:"-L/sysroot/lib -lfoo \n" \
- pkgconf --libs sysroot-dir
-
- export PKG_CONFIG_SYSROOT_DIR="/sysroot2"
- atf_check \
- -o inline:"-L/sysroot2/sysroot/lib -lfoo \n" \
- pkgconf --libs sysroot-dir
+ -o inline:"-L${selfdir}/lib -lfoo \n" \
+ pkgconf --libs sysroot-dir-selfdir
}
virtual_variable_body()
@@ -244,8 +240,8 @@ malformed_quoting_body()
explicit_sysroot_body()
{
- export PKG_CONFIG_SYSROOT_DIR=/sysroot
- atf_check -o inline:"/sysroot/usr/share/test\n" \
+ export PKG_CONFIG_SYSROOT_DIR=${selfdir}
+ atf_check -o inline:"${selfdir}/usr/share/test\n" \
pkgconf --with-path="${selfdir}/lib1" --variable=pkgdatadir explicit-sysroot
}
diff --git a/tests/test_env.sh.in b/tests/test_env.sh.in
index 17ee1f5..2c081f6 100644
--- a/tests/test_env.sh.in
+++ b/tests/test_env.sh.in
@@ -24,7 +24,7 @@ done
selfdir="@abs_top_srcdir@/tests"
LIBRARY_PATH_ENV="LIBRARY_PATH"
PATH_SEP=":"
-SYSROOT_DIR="${selfdir}/test"
+SYSROOT_DIR="${selfdir}"
case "$(uname -s)" in
Msys|CYGWIN*) PATH_SEP=";";;
Haiku) LIBRARY_PATH_ENV="BELIBRARIES";;
--
2.31.1

@ -1,8 +0,0 @@
#!/bin/sh
# Multilib safe wrapper for pkg-config to call correct platform-specific version of pkg-config
## Vendored definition of %_target_platform from redhat-rpm-config to avoid depending on it
TARGET_PLATFORM=$(rpm --eval '%{_target_cpu}-%{_vendor}-%{_target_os}%{?_gnu}')
exec "@PKGCONF_BINDIR@/${TARGET_PLATFORM}-pkg-config" "$@"

@ -1,16 +1,12 @@
#!/bin/sh
#!/bin/bash
# Simple wrapper to tell pkgconf to behave as a platform-specific version of pkg-config
# Platform: @TARGET_PLATFORM@
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 "$@"
pkgconf $@
exit $?

@ -12,36 +12,20 @@
%global pkgconfig_evr 1:%{pkgconfig_verrel}
%endif
# Tests are disabled on RHEL 9 because of the extensive dependencies
%if 0%{?rhel} >= 9
%bcond_with tests
%else
%bcond_without tests
%endif
# Search path for pc files for pkgconf
%global pkgconf_libdirs %{_libdir}/pkgconfig:%{_datadir}/pkgconfig
Name: pkgconf
Version: 1.7.3
Release: 10%{?dist}
Version: 1.4.2
Release: 1%{?dist}
Summary: Package compiler and linker metadata toolkit
License: ISC
URL: http://pkgconf.org/
# Mirror at https://releases.pagure.org/pkgconf/pkgconf/
Source0: https://distfiles.dereferenced.org/%{name}/%{name}-%{version}.tar.xz
# Simple wrapper scripts to offer platform versions of pkgconfig
# Simple wrapper script to offer platform versions of pkgconfig
Source1: platform-pkg-config.in
Source2: pkg-config.in
# Don't prepend sysroot_dir if pkg-config file lies outside of sysroot_dir
# See https://github.com/pkgconf/pkgconf/issues/213
# See https://bugzilla.redhat.com/show_bug.cgi?id=1974883
# See https://bugzilla.redhat.com/1975416
# Cherry picked from https://github.com/pkgconf/pkgconf/commit/ed86f2dda3bc99e34775f0fae54e314718037516
Patch1: 0001-Don-t-prepend-sysroot_dir-if-pkg-config-file-lies-ou.patch
BuildRequires: gcc
BuildRequires: make
@ -51,11 +35,9 @@ BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
%if %{with tests}
# For unit tests
BuildRequires: kyua
BuildRequires: %{_bindir}/kyua
BuildRequires: atf-tests
%endif
# pkgconf uses libpkgconf internally
Requires: lib%{name}%{?_isa} = %{version}-%{release}
@ -133,9 +115,7 @@ autoreconf -fiv
%check
%if %{with tests}
make check
%endif
%install
@ -143,35 +123,19 @@ make check
find %{buildroot} -name '*.la' -print -delete
mkdir -p %{buildroot}%{_sysconfdir}/pkgconfig/personality.d
mkdir -p %{buildroot}%{_datadir}/pkgconfig/personality.d
# pkgconf rpm macros
mkdir -p %{buildroot}%{_rpmmacrodir}/
cat > %{buildroot}%{_rpmmacrodir}/macros.pkgconf <<EOM
%%pkgconfig_personalitydir %{_datadir}/pkgconfig/personality.d
EOM
%if %{with pkgconfig_compat}
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
install -pm 0755 %{SOURCE2} %{buildroot}%{_bindir}/pkg-config
ln -sf pkgconf %{buildroot}%{_bindir}/pkg-config
sed -e "s|@PKGCONF_BINDIR@|%{_bindir}|" \
-i %{buildroot}%{_bindir}/pkg-config
# Link pkg-config(1) to pkgconf(1)
echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/pkg-config.1
# I don't have a better way to deal with this...
cp -a %{buildroot}%{_mandir}/man1/pkgconf.1 %{buildroot}%{_mandir}/man1/pkg-config.1
mkdir -p %{buildroot}%{_libdir}/pkgconfig
mkdir -p %{buildroot}%{_datadir}/pkgconfig
@ -191,11 +155,6 @@ rm -rf %{buildroot}%{_datadir}/aclocal
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%{_mandir}/man5/pc.5*
%{_mandir}/man5/%{name}-personality.5*
%{_rpmmacrodir}/macros.pkgconf
%dir %{_sysconfdir}/pkgconfig
%dir %{_sysconfdir}/pkgconfig/personality.d
%dir %{_datadir}/pkgconfig/personality.d
%files -n lib%{name}
%license COPYING
@ -220,88 +179,8 @@ rm -rf %{buildroot}%{_datadir}/aclocal
%endif
%changelog
* Thu Oct 07 2021 Richard W.M. Jones <rjones@redhat.com> - 1.7.3-10
- Don't prepend sysroot_dir if pkg-config file lies outside of sysroot_dir
resolves: rhbz#1975416
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.7.3-9
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.7.3-8
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Mon Feb 22 2021 Tomas Popela <tpopela@redhat.com> - 1.7.3-7
- Conditionalize the unit tests, disable them on RHEL 9
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Oct 19 2020 Neal Gompa <ngompa13@gmail.com> - 1.7.3-5
- Use internal target platform definition for pkg-config wrapper
* Thu Oct 15 2020 Neal Gompa <ngompa13@gmail.com> - 1.7.3-4
- Fix pkg-config wrapper for armv7hl
* Thu Oct 15 2020 Neal Gompa <ngompa13@gmail.com> - 1.7.3-3
- Make /usr/bin/pkg-config multilib safe
* Mon Aug 10 2020 Neal Gompa <ngompa13@gmail.com> - 1.7.3-2
- Add /usr/local paths to pkg-config(1) search path for non RPM builds
* Mon Aug 03 2020 Neal Gompa <ngompa13@gmail.com> - 1.7.3-1
- Update to 1.7.3
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-3
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon May 25 2020 Igor Raits <ignatenkobrain@fedoraproject.org> - 1.7.0-1
- Update to 1.7.0
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Jul 14 13:23:30 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.6.3-1
- Update to 1.6.3
* Fri Jul 12 09:36:57 CEST 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.6.2-1
- Update to 1.6.2
* Mon Mar 25 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.6.1-1
- Update to 1.6.1
* Sat Feb 09 2019 Neal Gompa <ngompa13@gmail.com> - 1.6.0-1
- Update to 1.6.0
- Add personality.d directories for cross-targets
- Add pkgconf rpm macros for pkgconf directories
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Nov 27 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.5.4-1
- Update to 1.5.4
* Tue Jul 31 2018 Florian Weimer <fweimer@redhat.com> - 1.5.3-2
- Rebuild with fixed binutils
* Sun Jul 29 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.5.3-1
- Update to 1.5.3
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 29 2018 Neal Gompa <ngompa13@gmail.com> - 1.5.1-2
- Add patch to fix system path override issue
* Wed Jun 27 2018 Neal Gompa <ngompa13@gmail.com> - 1.5.1-1
- Upgrade to 1.5.1
* Wed Jul 26 2023 MSVSphere Packaging Team <packager@msvsphere.ru> - 1.4.2-1
- Rebuilt for MSVSphere 8.8
* Sat Mar 31 2018 Neal Gompa <ngompa13@gmail.com> - 1.4.2-1
- Update to 1.4.2

Loading…
Cancel
Save