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/files/, dev-libs/openssl/
Date: Fri, 29 Dec 2017 01:57:23
Message-Id: 1514512630.e2a23951221fb5f24e6dfa7d01d17ce4fe64d750.whissi@gentoo
1 commit: e2a23951221fb5f24e6dfa7d01d17ce4fe64d750
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 29 01:56:56 2017 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 29 01:57:10 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2a23951
7
8 dev-libs/openssl: Rev bump to allow building with Perl 5.26
9
10 Ebuild changes:
11 ===============
12 - EAPI bumped to EAPI=6
13
14 - Added to for '.' in @INC (thanks to Joakim Gebart Nohlgård)
15
16 Closes: https://bugs.gentoo.org/639876
17 Package-Manager: Portage-2.3.19, Repoman-2.3.6
18
19 .../files/openssl-0.9.8z_p8-perl-5.26.patch | 13 ++
20 dev-libs/openssl/openssl-0.9.8z_p8-r1.ebuild | 167 +++++++++++++++++++++
21 2 files changed, 180 insertions(+)
22
23 diff --git a/dev-libs/openssl/files/openssl-0.9.8z_p8-perl-5.26.patch b/dev-libs/openssl/files/openssl-0.9.8z_p8-perl-5.26.patch
24 new file mode 100644
25 index 00000000000..c932b820425
26 --- /dev/null
27 +++ b/dev-libs/openssl/files/openssl-0.9.8z_p8-perl-5.26.patch
28 @@ -0,0 +1,13 @@
29 +https://bugs.gentoo.org/639876
30 +
31 +--- a/crypto/des/asm/des-586.pl
32 ++++ b/crypto/des/asm/des-586.pl
33 +@@ -4,7 +4,7 @@
34 + # Svend Olaf Mikkelsen <svolaf@××××××××××.dk>
35 + #
36 +
37 +-push(@INC,"perlasm","../../perlasm");
38 ++push(@INC,".","perlasm","../../perlasm");
39 + require "x86asm.pl";
40 + require "cbc.pl";
41 + require "desboth.pl";
42
43 diff --git a/dev-libs/openssl/openssl-0.9.8z_p8-r1.ebuild b/dev-libs/openssl/openssl-0.9.8z_p8-r1.ebuild
44 new file mode 100644
45 index 00000000000..5fcc6d8ea4e
46 --- /dev/null
47 +++ b/dev-libs/openssl/openssl-0.9.8z_p8-r1.ebuild
48 @@ -0,0 +1,167 @@
49 +# Copyright 1999-2017 Gentoo Foundation
50 +# Distributed under the terms of the GNU General Public License v2
51 +
52 +# this ebuild is only for the libcrypto.so.0.9.8 and libssl.so.0.9.8 SONAME for ABI compat
53 +
54 +EAPI="6"
55 +
56 +inherit eutils flag-o-matic toolchain-funcs multilib multilib-minimal
57 +
58 +#PLEVEL=$(printf "\\$(printf '%03o' $((${PV##*_p} + 96)))")
59 +PLEVEL='h' # _p8 -> tr '[1-9]' '[a-i]' -> 'h'
60 +MY_PV=${PV/_p*/${PLEVEL}}
61 +MY_P=${PN}-${MY_PV}
62 +S="${WORKDIR}/${MY_P}"
63 +DESCRIPTION="Toolkit for SSL v2/v3 and TLS v1"
64 +HOMEPAGE="https://www.openssl.org/"
65 +SRC_URI="mirror://openssl/source/${MY_P}.tar.gz"
66 +
67 +LICENSE="openssl"
68 +SLOT="0.9.8"
69 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
70 +IUSE="bindist gmp kerberos cpu_flags_x86_sse2 test zlib"
71 +RESTRICT="!bindist? ( bindist )"
72 +
73 +RDEPEND="gmp? ( >=dev-libs/gmp-5.1.3-r1[${MULTILIB_USEDEP}] )
74 + zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
75 + kerberos? ( >=app-crypt/mit-krb5-1.11.4[${MULTILIB_USEDEP}] )
76 + abi_x86_32? (
77 + !<=app-emulation/emul-linux-x86-baselibs-20140508-r4
78 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
79 + )
80 + !=dev-libs/openssl-0.9.8*:0"
81 +DEPEND="${RDEPEND}
82 + >=dev-lang/perl-5
83 + test? (
84 + sys-apps/diffutils
85 + sys-devel/bc
86 + )"
87 +
88 +# Do not install any docs
89 +DOCS=()
90 +
91 +PATCHES=(
92 + "${FILESDIR}"/${PN}-0.9.8e-bsd-sparc64.patch
93 + "${FILESDIR}"/${PN}-0.9.8h-ldflags.patch #181438
94 + "${FILESDIR}"/${PN}-0.9.8m-binutils.patch #289130
95 + "${FILESDIR}"/${PN}-0.9.8z_p8-perl-5.26.patch
96 +)
97 +
98 +src_prepare() {
99 + default
100 +
101 + # disable fips in the build
102 + # make sure the man pages are suffixed #302165
103 + # don't bother building man pages if they're disabled
104 + sed -i \
105 + -e '/DIRS/s: fips : :g' \
106 + -e '/^MANSUFFIX/s:=.*:=ssl:' \
107 + -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
108 + -e $(has noman FEATURES \
109 + && echo '/^install:/s:install_docs::' \
110 + || echo '/^MANDIR=/s:=.*:=/usr/share/man:') \
111 + Makefile{,.org} \
112 + || die
113 + # show the actual commands in the log
114 + sed -i '/^SET_X/s:=.*:=set -x:' Makefile.shared || die
115 + # update the enginedir path.
116 + # punt broken config we don't care about as it fails sanity check.
117 + sed -i \
118 + -e '/^"debug-ben-debug-64"/d' \
119 + -e "/foo.*engines/s|/lib/engines|/$(get_libdir)/engines|" \
120 + Configure || die
121 +
122 + # since we're forcing $(CC) as makedep anyway, just fix
123 + # the conditional as always-on
124 + # helps clang (#417795), and versioned gcc (#499818)
125 + sed -i 's/expr.*MAKEDEPEND.*;/true;/' util/domd || die
126 +
127 + # quiet out unknown driver argument warnings since openssl
128 + # doesn't have well-split CFLAGS and we're making it even worse
129 + # and 'make depend' uses -Werror for added fun (#417795 again)
130 + [[ ${CC} == *clang* ]] && append-flags -Qunused-arguments
131 +
132 + # allow openssl to be cross-compiled
133 + cp "${FILESDIR}"/gentoo.config-0.9.8 gentoo.config || die "cp cross-compile failed"
134 + chmod a+rx gentoo.config || die
135 +
136 + append-flags -fno-strict-aliasing
137 + append-flags -Wa,--noexecstack
138 +
139 + sed -i '1s,^:$,#!/usr/bin/perl,' Configure || die #141906
140 + sed -i '/^"debug-bodo/d' Configure || die # 0.9.8za shipped broken
141 + ./config --test-sanity || die "I AM NOT SANE"
142 +
143 + multilib_copy_sources
144 +}
145 +
146 +multilib_src_configure() {
147 + unset APPS #197996
148 + unset SCRIPTS #312551
149 +
150 + tc-export CC AR RANLIB
151 +
152 + # Clean out patent-or-otherwise-encumbered code
153 + # Camellia: Royalty Free http://en.wikipedia.org/wiki/Camellia_(cipher)
154 + # IDEA: Expired http://en.wikipedia.org/wiki/International_Data_Encryption_Algorithm
155 + # EC: ????????? ??/??/2015 http://en.wikipedia.org/wiki/Elliptic_Curve_Cryptography
156 + # MDC2: Expired http://en.wikipedia.org/wiki/MDC-2
157 + # RC5: 5,724,428 03/03/2015 http://en.wikipedia.org/wiki/RC5
158 +
159 + use_ssl() { use $1 && echo "enable-${2:-$1} ${*:3}" || echo "no-${2:-$1}" ; }
160 + echoit() { echo "$@" ; "$@" ; }
161 +
162 + local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
163 +
164 + local sslout=$(./gentoo.config)
165 + einfo "Use configuration ${sslout:-(openssl knows best)}"
166 + local config="Configure"
167 + [[ -z ${sslout} ]] && config="config"
168 +
169 + echoit \
170 + ./${config} \
171 + ${sslout} \
172 + $(use cpu_flags_x86_sse2 || echo "no-sse2") \
173 + enable-camellia \
174 + $(use_ssl !bindist ec) \
175 + enable-idea \
176 + enable-mdc2 \
177 + $(use_ssl !bindist rc5) \
178 + enable-tlsext \
179 + $(use_ssl gmp gmp -lgmp) \
180 + $(use_ssl kerberos krb5 --with-krb5-flavor=${krb5}) \
181 + $(use_ssl zlib) \
182 + --prefix=/usr \
183 + --openssldir=/etc/ssl \
184 + shared threads \
185 + || die "Configure failed"
186 +
187 + # Clean out hardcoded flags that openssl uses
188 + local CFLAG=$(grep ^CFLAG= Makefile | LC_ALL=C sed \
189 + -e 's:^CFLAG=::' \
190 + -e 's:-fomit-frame-pointer ::g' \
191 + -e 's:-O[0-9] ::g' \
192 + -e 's:-march=[-a-z0-9]* ::g' \
193 + -e 's:-mcpu=[-a-z0-9]* ::g' \
194 + -e 's:-m[a-z0-9]* ::g' \
195 + )
196 + sed -i \
197 + -e "/^LIBDIR=/s|=.*|=$(get_libdir)|" \
198 + -e "/^CFLAG/s|=.*|=${CFLAG} ${CFLAGS}|" \
199 + -e "/^SHARED_LDFLAGS=/s|$| ${LDFLAGS}|" \
200 + Makefile || die
201 +}
202 +
203 +multilib_src_compile() {
204 + # depend is needed to use $confopts
205 + emake -j1 depend
206 + emake -j1 build_libs
207 +}
208 +
209 +multilib_src_test() {
210 + emake -j1 test
211 +}
212 +
213 +multilib_src_install() {
214 + dolib.so lib{crypto,ssl}.so.0.9.8
215 +}