Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/openssl/
Date: Wed, 29 Jun 2022 00:03:15
Message-Id: 1656460876.e509d05a877800358c778520f149e51c978ca0f4.sam@gentoo
1 commit: e509d05a877800358c778520f149e51c978ca0f4
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 29 00:01:16 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 29 00:01:16 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e509d05a
7
8 Revert "dev-libs/openssl: add 3.0.4"
9
10 This reverts commit 0b821769c686087817a412b9f6f47ad03603491b.
11
12 This doesn't include the AVX512 overflow patch and
13 we'd discussed not bumping it on IRC. But I should've
14 pre-emptively masked / added a note in the ebuild.
15
16 Signed-off-by: Sam James <sam <AT> gentoo.org>
17
18 dev-libs/openssl/Manifest | 2 -
19 dev-libs/openssl/openssl-3.0.4.ebuild | 323 ----------------------------------
20 2 files changed, 325 deletions(-)
21
22 diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest
23 index 86edfb8addcb..fd4aba44df2c 100644
24 --- a/dev-libs/openssl/Manifest
25 +++ b/dev-libs/openssl/Manifest
26 @@ -13,5 +13,3 @@ DIST openssl-3.0.2.tar.gz.asc 488 BLAKE2B 2f6482114271c4f512159fa159486a3b347063
27 DIST openssl-3.0.3-test-fixes-expiry.patch.xz 29056 BLAKE2B 11be776b9c4baec770d81ff180581d7d8292261f32ebfcb2cfd399d684cef1b9e7b4575d906f23e8a61d853eafb178e1b0e01d9324dbe598c876c0ef74bcf5e8 SHA512 23bc571dfca453deb4f1812aea5fc1bcf1c27358d8638a66ce7f359a698b09a35bdc86e01db36aa5e59b37cc7e36f0ced6f1463b383fb0d904aada69f5d5cb04
28 DIST openssl-3.0.3.tar.gz 15058905 BLAKE2B 8141d13dbea2f1febdd4e46aa404e9f3bac51e1fdc0c9b0df8bf3bf6852e18b09201a2a8cbee99f72e8d6de660834093449b7a14a3fbdda8511286ca3b6743e7 SHA512 949472025211fabdaf2564122f0a9a3baef0facb6373e90cf6c4485164a50898050b179722d0b358c4d8cf1787384ea30d5fd03b98757634631d3e8978509b1a
29 DIST openssl-3.0.3.tar.gz.asc 488 BLAKE2B 3f31e3a73706b69683220e05b1b4ddc75dc3e7e12652dca711e4aa0eb3c023ef736aee9ade15172d7f28e1e1af03e86d4854ec6c3d167cad42882f483c5e56d4 SHA512 04afe65c6af1ae43a9967462383a6a4f567f5acff19ec1952cd6fce2dc3c3d4dfb3cb54126562724c148f40dcb66668abf727282d35730bbf36f82b5c6bacace
30 -DIST openssl-3.0.4.tar.gz 15069605 BLAKE2B e8ef09d74aa128fee0ddc347458a41cde65af07a6e6836889a0230cd7989e46b5d10a4930eb7a63c0cf93485914ec33665d14637b6c27fd442c0e9becb2d2a86 SHA512 478cd801dc4787688e6d9062969ae738c24f869bb186f717ad3be54ae8f2630e5cd845c504efd3405ea1ecda07ebee00014cc6ef7bca9585a6240cf89d516557
31 -DIST openssl-3.0.4.tar.gz.asc 488 BLAKE2B 54f652ae78c6f39aef970fd7372808c876d37a823cc31431d770db67caf11342d1045992e393242d4c73253e4e16640dd9bd56203864394e907976918909e5dc SHA512 c30af3cda92b06cff864ed33c17d8dcb8c7d429ed8419f96d19d3049dfaa268c73ec7753815a134b069ae7f4ea20fb4bcdd04f86d33628592ce4500777494c85
32
33 diff --git a/dev-libs/openssl/openssl-3.0.4.ebuild b/dev-libs/openssl/openssl-3.0.4.ebuild
34 deleted file mode 100644
35 index ede15424a910..000000000000
36 --- a/dev-libs/openssl/openssl-3.0.4.ebuild
37 +++ /dev/null
38 @@ -1,323 +0,0 @@
39 -# Copyright 1999-2022 Gentoo Authors
40 -# Distributed under the terms of the GNU General Public License v2
41 -
42 -EAPI=7
43 -
44 -VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/openssl.org.asc
45 -inherit edo flag-o-matic linux-info toolchain-funcs multilib-minimal multiprocessing verify-sig
46 -
47 -DESCRIPTION="Robust, full-featured Open Source Toolkit for the Transport Layer Security (TLS)"
48 -HOMEPAGE="https://www.openssl.org/"
49 -
50 -MY_P=${P/_/-}
51 -
52 -if [[ ${PV} == 9999 ]] ; then
53 - EGIT_REPO_URI="https://github.com/openssl/openssl.git"
54 -
55 - inherit git-r3
56 -else
57 - SRC_URI="mirror://openssl/source/${MY_P}.tar.gz
58 - verify-sig? ( mirror://openssl/source/${MY_P}.tar.gz.asc )"
59 - KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux"
60 -fi
61 -
62 -S="${WORKDIR}"/${MY_P}
63 -
64 -LICENSE="Apache-2.0"
65 -SLOT="0/3" # .so version of libssl/libcrypto
66 -IUSE="+asm cpu_flags_x86_sse2 fips ktls rfc3779 sctp static-libs test tls-compression vanilla verify-sig weak-ssl-ciphers"
67 -RESTRICT="!test? ( test )"
68 -
69 -COMMON_DEPEND="
70 - >=app-misc/c_rehash-1.7-r1
71 - tls-compression? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
72 -"
73 -BDEPEND="
74 - >=dev-lang/perl-5
75 - sctp? ( >=net-misc/lksctp-tools-1.0.12 )
76 - test? (
77 - sys-apps/diffutils
78 - sys-devel/bc
79 - sys-process/procps
80 - )
81 - verify-sig? ( sec-keys/openpgp-keys-openssl )"
82 -
83 -DEPEND="${COMMON_DEPEND}"
84 -RDEPEND="${COMMON_DEPEND}"
85 -PDEPEND="app-misc/ca-certificates"
86 -
87 -REQUIRED_USE="test? ( rfc3779 )"
88 -
89 -MULTILIB_WRAPPED_HEADERS=(
90 - /usr/include/openssl/configuration.h
91 -)
92 -
93 -pkg_setup() {
94 - if use ktls ; then
95 - if kernel_is -lt 4 18 ; then
96 - ewarn "Kernel implementation of TLS (USE=ktls) requires kernel >=4.18!"
97 - else
98 - CONFIG_CHECK="~TLS ~TLS_DEVICE"
99 - ERROR_TLS="You will be unable to offload TLS to kernel because CONFIG_TLS is not set!"
100 - ERROR_TLS_DEVICE="You will be unable to offload TLS to kernel because CONFIG_TLS_DEVICE is not set!"
101 -
102 - linux-info_pkg_setup
103 - fi
104 - fi
105 -
106 - [[ ${MERGE_TYPE} == binary ]] && return
107 -
108 - # must check in pkg_setup; sysctl doesn't work with userpriv!
109 - if use test && use sctp ; then
110 - # test_ssl_new will fail with "Ensure SCTP AUTH chunks are enabled in kernel"
111 - # if sctp.auth_enable is not enabled.
112 - local sctp_auth_status=$(sysctl -n net.sctp.auth_enable 2>/dev/null)
113 - if [[ -z "${sctp_auth_status}" ]] || [[ ${sctp_auth_status} != 1 ]] ; then
114 - die "FEATURES=test with USE=sctp requires net.sctp.auth_enable=1!"
115 - fi
116 - fi
117 -}
118 -
119 -src_unpack() {
120 - # Can delete this once test fix patch is dropped
121 - if use verify-sig ; then
122 - # Needed for downloaded patch (which is unsigned, which is fine)
123 - verify-sig_verify_detached "${DISTDIR}"/${P}.tar.gz{,.asc}
124 - fi
125 -
126 - default
127 -}
128 -
129 -src_prepare() {
130 - # Allow openssl to be cross-compiled
131 - cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
132 - chmod a+rx gentoo.config || die
133 -
134 - # Keep this in sync with app-misc/c_rehash
135 - SSL_CNF_DIR="/etc/ssl"
136 -
137 - # Make sure we only ever touch Makefile.org and avoid patching a file
138 - # that gets blown away anyways by the Configure script in src_configure
139 - rm -f Makefile
140 -
141 - if ! use vanilla ; then
142 - PATCHES+=(
143 - # Add patches which are Gentoo-specific customisations here
144 - )
145 - fi
146 -
147 - default
148 -
149 - if use test && use sctp && has network-sandbox ${FEATURES} ; then
150 - einfo "Disabling test '80-test_ssl_new.t' which is known to fail with FEATURES=network-sandbox ..."
151 - rm test/recipes/80-test_ssl_new.t || die
152 - fi
153 -
154 - # - Make sure the man pages are suffixed (bug #302165)
155 - # - Don't bother building man pages if they're disabled
156 - # - Make DOCDIR Gentoo compliant
157 - sed -i \
158 - -e '/^MANSUFFIX/s:=.*:=ssl:' \
159 - -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
160 - -e $(has noman FEATURES \
161 - && echo '/^install:/s:install_docs::' \
162 - || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
163 - -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \
164 - Configurations/unix-Makefile.tmpl \
165 - || die
166 -
167 - # Quiet out unknown driver argument warnings since openssl
168 - # doesn't have well-split CFLAGS and we're making it even worse
169 - # and 'make depend' uses -Werror for added fun (bug #417795 again)
170 - tc-is-clang && append-flags -Qunused-arguments
171 -
172 - # We really, really need to build OpenSSL w/ strict aliasing disabled.
173 - # It's filled with violations and it *will* result in miscompiled
174 - # code. This has been in the ebuild for > 10 years but even in 2022,
175 - # it's still relevant:
176 - # - https://github.com/llvm/llvm-project/issues/55255
177 - # - https://github.com/openssl/openssl/issues/18225
178 - # Don't remove the no strict aliasing bits below!
179 - filter-flags -fstrict-aliasing
180 - append-flags -fno-strict-aliasing
181 -
182 - append-flags $(test-flags-CC -Wa,--noexecstack)
183 -
184 - # Prefixify Configure shebang (bug #141906)
185 - sed \
186 - -e "1s,/usr/bin/env,${BROOT}&," \
187 - -i Configure || die
188 -
189 - # Remove test target when FEATURES=test isn't set
190 - if ! use test ; then
191 - sed \
192 - -e '/^$config{dirs}/s@ "test",@@' \
193 - -i Configure || die
194 - fi
195 -
196 - # The config script does stupid stuff to prompt the user. Kill it.
197 - sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
198 - ./config --test-sanity || die "I AM NOT SANE"
199 -
200 - multilib_copy_sources
201 -}
202 -
203 -multilib_src_configure() {
204 - # bug #197996
205 - unset APPS
206 - # bug #312551
207 - unset SCRIPTS
208 - # bug #311473
209 - unset CROSS_COMPILE
210 -
211 - tc-export AR CC CXX RANLIB RC
212 -
213 - use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
214 -
215 - local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
216 -
217 - local sslout=$(./gentoo.config)
218 - einfo "Using configuration: ${sslout:-(openssl knows best)}"
219 - local config="Configure"
220 - [[ -z ${sslout} ]] && config="config"
221 -
222 - # https://github.com/openssl/openssl/blob/master/INSTALL.md#enable-and-disable-features
223 - local myeconfargs=(
224 - ${sslout}
225 -
226 - $(use cpu_flags_x86_sse2 || echo "no-sse2")
227 - enable-camellia
228 - enable-ec
229 - enable-ec2m
230 - enable-sm2
231 - enable-srp
232 - $(use elibc_musl && echo "no-async")
233 - enable-idea
234 - enable-mdc2
235 - enable-rc5
236 - $(use fips && echo "enable-fips")
237 - $(use_ssl asm)
238 - $(use_ssl ktls)
239 - $(use_ssl rfc3779)
240 - $(use_ssl sctp)
241 - $(use test || echo "no-tests")
242 - $(use_ssl tls-compression zlib)
243 - $(use_ssl weak-ssl-ciphers)
244 -
245 - --prefix="${EPREFIX}"/usr
246 - --openssldir="${EPREFIX}"${SSL_CNF_DIR}
247 - --libdir=$(get_libdir)
248 -
249 - shared
250 - threads
251 - )
252 -
253 - CFLAGS= LDFLAGS= edo ./${config} "${myeconfargs[@]}"
254 -
255 - # Clean out hardcoded flags that openssl uses
256 - local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \
257 - -e 's:^CFLAGS=::' \
258 - -e 's:\(^\| \)-fomit-frame-pointer::g' \
259 - -e 's:\(^\| \)-O[^ ]*::g' \
260 - -e 's:\(^\| \)-march=[^ ]*::g' \
261 - -e 's:\(^\| \)-mcpu=[^ ]*::g' \
262 - -e 's:\(^\| \)-m[^ ]*::g' \
263 - -e 's:^ *::' \
264 - -e 's: *$::' \
265 - -e 's: \+: :g' \
266 - -e 's:\\:\\\\:g'
267 - )
268 -
269 - # Now insert clean default flags with user flags
270 - sed -i \
271 - -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
272 - -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \
273 - Makefile \
274 - || die
275 -}
276 -
277 -multilib_src_compile() {
278 - # depend is needed to use $confopts; it also doesn't matter
279 - # that it's -j1 as the code itself serializes subdirs
280 - emake -j1 depend
281 -
282 - emake all
283 -}
284 -
285 -multilib_src_test() {
286 - # VFP = show subtests verbosely and show failed tests verbosely
287 - # Normal V=1 would show everything verbosely but this slows things down.
288 - emake HARNESS_JOBS="$(makeopts_jobs)" VFP=1 test
289 -}
290 -
291 -multilib_src_install() {
292 - # We need to create ${ED}/usr on our own to avoid a race condition (bug #665130)
293 - dodir /usr
294 -
295 - emake DESTDIR="${D}" install
296 -
297 - # This is crappy in that the static archives are still built even
298 - # when USE=static-libs. But this is due to a failing in the openssl
299 - # build system: the static archives are built as PIC all the time.
300 - # Only way around this would be to manually configure+compile openssl
301 - # twice; once with shared lib support enabled and once without.
302 - if ! use static-libs ; then
303 - rm "${ED}"/usr/$(get_libdir)/lib{crypto,ssl}.a || die
304 - fi
305 -}
306 -
307 -multilib_src_install_all() {
308 - # openssl installs perl version of c_rehash by default, but
309 - # we provide a shell version via app-misc/c_rehash
310 - rm "${ED}"/usr/bin/c_rehash || die
311 -
312 - dodoc {AUTHORS,CHANGES,NEWS,README,README-PROVIDERS}.md doc/*.txt doc/${PN}-c-indent.el
313 -
314 - # Create the certs directory
315 - keepdir ${SSL_CNF_DIR}/certs
316 -
317 - # Namespace openssl programs to prevent conflicts with other man pages
318 - cd "${ED}"/usr/share/man || die
319 - local m d s
320 - for m in $(find . -type f | xargs grep -L '#include') ; do
321 - d=${m%/*}
322 - d=${d#./}
323 - m=${m##*/}
324 -
325 - [[ ${m} == openssl.1* ]] && continue
326 -
327 - [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
328 -
329 - mv ${d}/{,ssl-}${m} || die
330 -
331 - # Fix up references to renamed man pages
332 - sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m} || die
333 - ln -s ssl-${m} ${d}/openssl-${m} || die
334 -
335 - # Locate any symlinks that point to this man page
336 - # We assume that any broken links are due to the above renaming
337 - for s in $(find -L ${d} -type l) ; do
338 - s=${s##*/}
339 -
340 - rm -f ${d}/${s}
341 -
342 - # We don't want to "|| die" here
343 - ln -s ssl-${m} ${d}/ssl-${s}
344 - ln -s ssl-${s} ${d}/openssl-${s}
345 - done
346 - done
347 - [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
348 -
349 - # bug #254521
350 - dodir /etc/sandbox.d
351 - echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
352 -
353 - diropts -m0700
354 - keepdir ${SSL_CNF_DIR}/private
355 -}
356 -
357 -pkg_postinst() {
358 - ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes (bug #333069)"
359 - c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null
360 - eend $?
361 -}