commit:     6fcd44ef37805c5c43770ca0f207d8a0bd99cb75
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 31 14:28:06 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 31 14:28:06 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6fcd44ef

app-arch/xz-utils: fix PGO with libarchive tar

Closes: https://bugs.gentoo.org/933200
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-arch/xz-utils/xz-utils-5.6.2.ebuild | 9 +++++++--
 app-arch/xz-utils/xz-utils-9999.ebuild  | 9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/app-arch/xz-utils/xz-utils-5.6.2.ebuild 
b/app-arch/xz-utils/xz-utils-5.6.2.ebuild
index 43e7da134e9a..687084d7fdae 100644
--- a/app-arch/xz-utils/xz-utils-5.6.2.ebuild
+++ b/app-arch/xz-utils/xz-utils-5.6.2.ebuild
@@ -116,17 +116,22 @@ multilib_src_compile() {
        if use pgo ; then
                emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check
 
+               local tar_pgo_args=(
+                       --mtime=@2718281828
+               )
+               has_version "app-alternatives/tar[gnu]" && tar_pgo_args+=( 
--sort=name )
+
                if multilib_is_native_abi ; then
                        (
                                shopt -s globstar
 
                                tar \
-                                       --sort=name --mtime=@2718281828 \
+                                       "${tar_pgo_args[@]}" \
                                        -cf xz-pgo-test-01.tar \
                                        {"${S}","${BUILD_DIR}"}/**/*.[cho] \
                                        {"${S}","${BUILD_DIR}"}/**/*.so* \
                                        {"${S}","${BUILD_DIR}"}/**/**.txt \
-                                       {"${S}","${BUILD_DIR}"}/tests/files \
+                                       {"${S}","${BUILD_DIR}"}/tests/files
 
                                stat --printf="xz-pgo-test-01.tar.tar size: 
%s\n" xz-pgo-test-01.tar
                                md5sum xz-pgo-test-01.tar

diff --git a/app-arch/xz-utils/xz-utils-9999.ebuild 
b/app-arch/xz-utils/xz-utils-9999.ebuild
index 43e7da134e9a..687084d7fdae 100644
--- a/app-arch/xz-utils/xz-utils-9999.ebuild
+++ b/app-arch/xz-utils/xz-utils-9999.ebuild
@@ -116,17 +116,22 @@ multilib_src_compile() {
        if use pgo ; then
                emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check
 
+               local tar_pgo_args=(
+                       --mtime=@2718281828
+               )
+               has_version "app-alternatives/tar[gnu]" && tar_pgo_args+=( 
--sort=name )
+
                if multilib_is_native_abi ; then
                        (
                                shopt -s globstar
 
                                tar \
-                                       --sort=name --mtime=@2718281828 \
+                                       "${tar_pgo_args[@]}" \
                                        -cf xz-pgo-test-01.tar \
                                        {"${S}","${BUILD_DIR}"}/**/*.[cho] \
                                        {"${S}","${BUILD_DIR}"}/**/*.so* \
                                        {"${S}","${BUILD_DIR}"}/**/**.txt \
-                                       {"${S}","${BUILD_DIR}"}/tests/files \
+                                       {"${S}","${BUILD_DIR}"}/tests/files
 
                                stat --printf="xz-pgo-test-01.tar.tar size: 
%s\n" xz-pgo-test-01.tar
                                md5sum xz-pgo-test-01.tar

Reply via email to