Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/zlib/, sys-libs/zlib/files/
Date: Fri, 28 Jan 2022 07:54:00
Message-Id: 1643356407.bace9b48a6fe43bdf685f4aa81ca422130e2f807.sam@gentoo
1 commit: bace9b48a6fe43bdf685f4aa81ca422130e2f807
2 Author: Adrian Ratiu <adrian.ratiu <AT> collabora <DOT> com>
3 AuthorDate: Thu Jan 20 19:15:59 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 28 07:53:27 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bace9b48
7
8 sys-libs/zlib: add patch to fix configure AR/RANLIB/NM detection
9
10 This adds a patch from the zlib-devel ML to fix a minor
11 build inconsistency leading to GNU tools usage in LLVM
12 configured builds.
13
14 The reason we're adding it directly here is zlib upstream
15 takes forever to release new versions and there's not much
16 activity for some time (last release was in Jan 2017).
17
18 Closes: https://bugs.gentoo.org/831628
19 Signed-off-by: Adrian Ratiu <adrian.ratiu <AT> collabora.com>
20 Closes: https://github.com/gentoo/gentoo/pull/23888
21 Signed-off-by: Sam James <sam <AT> gentoo.org>
22
23 ...2.11-configure-fix-AR-RANLIB-NM-detection.patch | 79 ++++++++++++++++++++++
24 sys-libs/zlib/zlib-1.2.11-r4.ebuild | 1 +
25 2 files changed, 80 insertions(+)
26
27 diff --git a/sys-libs/zlib/files/zlib-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch b/sys-libs/zlib/files/zlib-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch
28 new file mode 100644
29 index 000000000000..68108a16fc3c
30 --- /dev/null
31 +++ b/sys-libs/zlib/files/zlib-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch
32 @@ -0,0 +1,79 @@
33 +From 9ce4e2e190cd382407eb3029b7127e378a7c9627 Mon Sep 17 00:00:00 2001
34 +From: Adrian Ratiu <adrian.ratiu@×××××××××.com>
35 +Date: Mon, 17 Jan 2022 10:49:58 +0200
36 +Subject: [PATCH] configure: fix AR/RANLIB/NM detection
37 +
38 +Taken from zlib-devel ML:
39 +https://madler.net/pipermail/zlib-devel_madler.net/2022-January/003322.html
40 +
41 +Bug: https://bugs.gentoo.org/831628
42 +
43 +Scenarios where ${CROSS_PREFIX}ar & co are set but not desired
44 +are possible, for example in ChromiumOS we use the GNU binutils
45 +tools & GCC to build glibc but LLVM/Clang is used for the rest
46 +of the system.
47 +
48 +This allows $AR/$RANLIB/$NM to override default CROSS_PREFIX
49 +tools so they can be set to llvm-ar/ranlib/nm.
50 +
51 +Suggested-by: Manoj Gupta <manojgupta@××××××××.org>
52 +Signed-off-by: Adrian Ratiu <adrian.ratiu@×××××××××.com>
53 +---
54 + configure | 38 ++++++++++++++++++++++----------------
55 + 1 file changed, 22 insertions(+), 16 deletions(-)
56 +
57 +diff --git a/configure b/configure
58 +index e974d1f..180cf09 100755
59 +--- a/configure
60 ++++ b/configure
61 +@@ -46,25 +46,31 @@ VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.
62 + VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
63 +
64 + # establish commands for library building
65 +-if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
66 +- AR=${AR-"${CROSS_PREFIX}ar"}
67 +- test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
68 +-else
69 +- AR=${AR-"ar"}
70 +- test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
71 ++if [ -z "AR" ] ; then
72 ++ if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
73 ++ AR=${AR-"${CROSS_PREFIX}ar"}
74 ++ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
75 ++ else
76 ++ AR="ar"
77 ++ test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
78 ++ fi
79 + fi
80 + ARFLAGS=${ARFLAGS-"rc"}
81 +-if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
82 +- RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
83 +- test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
84 +-else
85 +- RANLIB=${RANLIB-"ranlib"}
86 ++if [ -z "RANLIB" ] ; then
87 ++ if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
88 ++ RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
89 ++ test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
90 ++ else
91 ++ RANLIB="ranlib"
92 ++ fi
93 + fi
94 +-if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
95 +- NM=${NM-"${CROSS_PREFIX}nm"}
96 +- test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
97 +-else
98 +- NM=${NM-"nm"}
99 ++if [ -z "$NM" ] ; then
100 ++ if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
101 ++ NM=${"${CROSS_PREFIX}nm"}
102 ++ test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
103 ++ else
104 ++ NM="nm"
105 ++ fi
106 + fi
107 +
108 + # set defaults before processing command line options
109 +--
110 +2.34.1
111 +
112
113 diff --git a/sys-libs/zlib/zlib-1.2.11-r4.ebuild b/sys-libs/zlib/zlib-1.2.11-r4.ebuild
114 index bc2fe9834ee2..3b8524a12c6e 100644
115 --- a/sys-libs/zlib/zlib-1.2.11-r4.ebuild
116 +++ b/sys-libs/zlib/zlib-1.2.11-r4.ebuild
117 @@ -34,6 +34,7 @@ DEPEND="${RDEPEND}"
118 PATCHES=(
119 "${FILESDIR}"/${PN}-1.2.11-fix-deflateParams-usage.patch
120 "${FILESDIR}"/${PN}-1.2.11-minizip-drop-crypt-header.patch #658536
121 + "${FILESDIR}"/${PN}-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch #831628
122 )
123
124 src_prepare() {