Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/openssl/
Date: Fri, 23 Aug 2019 18:10:51
Message-Id: 1566583820.975f55449d9ecbac24beb97081273946083168b4.whissi@gentoo
1 commit: 975f55449d9ecbac24beb97081273946083168b4
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 23 17:44:30 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 23 18:10:20 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=975f5544
7
8 dev-libs/openssl: don't destroy user flags
9
10 Thanks-to: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
11 Closes: https://bugs.gentoo.org/671016
12 Package-Manager: Portage-2.3.72, Repoman-2.3.17
13 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
14
15 dev-libs/openssl/openssl-1.0.2s-r1.ebuild | 26 +++++++++++++++++---------
16 dev-libs/openssl/openssl-1.0.2s-r200.ebuild | 26 +++++++++++++++++---------
17 dev-libs/openssl/openssl-1.1.0k-r1.ebuild | 22 ++++++++++++++--------
18 dev-libs/openssl/openssl-1.1.1c-r1.ebuild | 22 ++++++++++++++--------
19 4 files changed, 62 insertions(+), 34 deletions(-)
20
21 diff --git a/dev-libs/openssl/openssl-1.0.2s-r1.ebuild b/dev-libs/openssl/openssl-1.0.2s-r1.ebuild
22 index a2cb9f7917e..b4902db7e53 100644
23 --- a/dev-libs/openssl/openssl-1.0.2s-r1.ebuild
24 +++ b/dev-libs/openssl/openssl-1.0.2s-r1.ebuild
25 @@ -187,7 +187,9 @@ multilib_src_configure() {
26 [[ -z ${sslout} ]] && config="config"
27
28 # Fedora hobbled-EC needs 'no-ec2m', 'no-srp'
29 - echoit \
30 + # Make sure user flags don't get added *yet* to avoid duplicated
31 + # flags.
32 + CFLAGS= LDFLAGS= echoit \
33 ./${config} \
34 ${sslout} \
35 $(use cpu_flags_x86_sse2 || echo "no-sse2") \
36 @@ -216,17 +218,23 @@ multilib_src_configure() {
37 || die
38
39 # Clean out hardcoded flags that openssl uses
40 - local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
41 + local DEFAULT_CFLAGS=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
42 -e 's:^CFLAG=::' \
43 - -e 's:-fomit-frame-pointer ::g' \
44 - -e 's:-O[0-9] ::g' \
45 - -e 's:-march=[-a-z0-9]* ::g' \
46 - -e 's:-mcpu=[-a-z0-9]* ::g' \
47 - -e 's:-m[a-z0-9]* ::g' \
48 + -e 's:\(^\| \)-fomit-frame-pointer::g' \
49 + -e 's:\(^\| \)-O[^ ]*::g' \
50 + -e 's:\(^\| \)-march=[^ ]*::g' \
51 + -e 's:\(^\| \)-mcpu=[^ ]*::g' \
52 + -e 's:\(^\| \)-m[^ ]*::g' \
53 + -e 's:^ *::' \
54 + -e 's: *$::' \
55 + -e 's: \+: :g' \
56 + -e 's:\\:\\\\:g'
57 )
58 +
59 + # Now insert clean default flags with user flags
60 sed -i \
61 - -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
62 - -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
63 + -e "/^CFLAG/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
64 + -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \
65 Makefile || die
66 }
67
68
69 diff --git a/dev-libs/openssl/openssl-1.0.2s-r200.ebuild b/dev-libs/openssl/openssl-1.0.2s-r200.ebuild
70 index 281b169b64b..24f2b3a5663 100644
71 --- a/dev-libs/openssl/openssl-1.0.2s-r200.ebuild
72 +++ b/dev-libs/openssl/openssl-1.0.2s-r200.ebuild
73 @@ -191,7 +191,9 @@ multilib_src_configure() {
74 [[ -z ${sslout} ]] && config="config"
75
76 # Fedora hobbled-EC needs 'no-ec2m', 'no-srp'
77 - echoit \
78 + # Make sure user flags don't get added *yet* to avoid duplicated
79 + # flags.
80 + CFLAGS= LDFLAGS= echoit \
81 ./${config} \
82 ${sslout} \
83 $(use cpu_flags_x86_sse2 || echo "no-sse2") \
84 @@ -220,17 +222,23 @@ multilib_src_configure() {
85 || die
86
87 # Clean out hardcoded flags that openssl uses
88 - local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
89 + local DEFAULT_CFLAGS=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
90 -e 's:^CFLAG=::' \
91 - -e 's:-fomit-frame-pointer ::g' \
92 - -e 's:-O[0-9] ::g' \
93 - -e 's:-march=[-a-z0-9]* ::g' \
94 - -e 's:-mcpu=[-a-z0-9]* ::g' \
95 - -e 's:-m[a-z0-9]* ::g' \
96 + -e 's:\(^\| \)-fomit-frame-pointer::g' \
97 + -e 's:\(^\| \)-O[^ ]*::g' \
98 + -e 's:\(^\| \)-march=[^ ]*::g' \
99 + -e 's:\(^\| \)-mcpu=[^ ]*::g' \
100 + -e 's:\(^\| \)-m[^ ]*::g' \
101 + -e 's:^ *::' \
102 + -e 's: *$::' \
103 + -e 's: \+: :g' \
104 + -e 's:\\:\\\\:g'
105 )
106 +
107 + # Now insert clean default flags with user flags
108 sed -i \
109 - -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
110 - -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
111 + -e "/^CFLAG/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
112 + -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \
113 Makefile || die
114 }
115
116
117 diff --git a/dev-libs/openssl/openssl-1.1.0k-r1.ebuild b/dev-libs/openssl/openssl-1.1.0k-r1.ebuild
118 index 937d3b7ed11..7bcd5d03e7e 100644
119 --- a/dev-libs/openssl/openssl-1.1.0k-r1.ebuild
120 +++ b/dev-libs/openssl/openssl-1.1.0k-r1.ebuild
121 @@ -176,7 +176,9 @@ multilib_src_configure() {
122 # 'srp' was restricted until early 2017 as well.
123 # "disable-deprecated" option breaks too many consumers.
124 # Don't set it without thorough revdeps testing.
125 - echoit \
126 + # Make sure user flags don't get added *yet* to avoid duplicated
127 + # flags.
128 + CFLAGS= LDFLAGS= echoit \
129 ./${config} \
130 ${sslout} \
131 $(use cpu_flags_x86_sse2 || echo "no-sse2") \
132 @@ -203,16 +205,20 @@ multilib_src_configure() {
133 || die
134
135 # Clean out hardcoded flags that openssl uses
136 - # Fix quoting for sed
137 local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \
138 -e 's:^CFLAGS=::' \
139 - -e 's:-fomit-frame-pointer ::g' \
140 - -e 's:-O[0-9] ::g' \
141 - -e 's:-march=[-a-z0-9]* ::g' \
142 - -e 's:-mcpu=[-a-z0-9]* ::g' \
143 - -e 's:-m[a-z0-9]* ::g' \
144 - -e 's:\\:\\\\:g' \
145 + -e 's:\(^\| \)-fomit-frame-pointer::g' \
146 + -e 's:\(^\| \)-O[^ ]*::g' \
147 + -e 's:\(^\| \)-march=[^ ]*::g' \
148 + -e 's:\(^\| \)-mcpu=[^ ]*::g' \
149 + -e 's:\(^\| \)-m[^ ]*::g' \
150 + -e 's:^ *::' \
151 + -e 's: *$::' \
152 + -e 's: \+: :g' \
153 + -e 's:\\:\\\\:g'
154 )
155 +
156 + # Now insert clean default flags with user flags
157 sed -i \
158 -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
159 -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \
160
161 diff --git a/dev-libs/openssl/openssl-1.1.1c-r1.ebuild b/dev-libs/openssl/openssl-1.1.1c-r1.ebuild
162 index 683c5707566..a3a0f2a2c06 100644
163 --- a/dev-libs/openssl/openssl-1.1.1c-r1.ebuild
164 +++ b/dev-libs/openssl/openssl-1.1.1c-r1.ebuild
165 @@ -172,7 +172,9 @@ multilib_src_configure() {
166 # 'srp' was restricted until early 2017 as well.
167 # "disable-deprecated" option breaks too many consumers.
168 # Don't set it without thorough revdeps testing.
169 - echoit \
170 + # Make sure user flags don't get added *yet* to avoid duplicated
171 + # flags.
172 + CFLAGS= LDFLAGS= echoit \
173 ./${config} \
174 ${sslout} \
175 $(use cpu_flags_x86_sse2 || echo "no-sse2") \
176 @@ -199,16 +201,20 @@ multilib_src_configure() {
177 || die
178
179 # Clean out hardcoded flags that openssl uses
180 - # Fix quoting for sed
181 local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \
182 -e 's:^CFLAGS=::' \
183 - -e 's:-fomit-frame-pointer ::g' \
184 - -e 's:-O[0-9] ::g' \
185 - -e 's:-march=[-a-z0-9]* ::g' \
186 - -e 's:-mcpu=[-a-z0-9]* ::g' \
187 - -e 's:-m[a-z0-9]* ::g' \
188 - -e 's:\\:\\\\:g' \
189 + -e 's:\(^\| \)-fomit-frame-pointer::g' \
190 + -e 's:\(^\| \)-O[^ ]*::g' \
191 + -e 's:\(^\| \)-march=[^ ]*::g' \
192 + -e 's:\(^\| \)-mcpu=[^ ]*::g' \
193 + -e 's:\(^\| \)-m[^ ]*::g' \
194 + -e 's:^ *::' \
195 + -e 's: *$::' \
196 + -e 's: \+: :g' \
197 + -e 's:\\:\\\\:g'
198 )
199 +
200 + # Now insert clean default flags with user flags
201 sed -i \
202 -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
203 -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \