Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/curl/files/, net-misc/curl/
Date: Fri, 30 Dec 2016 01:45:38
Message-Id: 1483062301.7edeee5b966afc5550d2b4c03b4d7f09c7db2973.blueness@gentoo
1 commit: 7edeee5b966afc5550d2b4c03b4d7f09c7db2973
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 30 01:45:01 2016 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 30 01:45:01 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7edeee5b
7
8 net-misc/curl: fix bug #604104
9
10 Package-Manager: portage-2.3.0
11
12 net-misc/curl/curl-7.52.1-r1.ebuild | 252 ++++++++++++++++++++++
13 net-misc/curl/files/curl-7.52.1-fix-openssl.patch | 36 ++++
14 2 files changed, 288 insertions(+)
15
16 diff --git a/net-misc/curl/curl-7.52.1-r1.ebuild b/net-misc/curl/curl-7.52.1-r1.ebuild
17 new file mode 100644
18 index 00000000..a3bb758
19 --- /dev/null
20 +++ b/net-misc/curl/curl-7.52.1-r1.ebuild
21 @@ -0,0 +1,252 @@
22 +# Copyright 1999-2016 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Id$
25 +
26 +EAPI="6"
27 +
28 +inherit autotools eutils prefix multilib-minimal
29 +
30 +DESCRIPTION="A Client that groks URLs"
31 +HOMEPAGE="https://curl.haxx.se/"
32 +SRC_URI="https://curl.haxx.se/download/${P}.tar.bz2"
33 +
34 +LICENSE="MIT"
35 +SLOT="0"
36 +KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86 ~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
37 +#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
38 +IUSE="adns http2 idn ipv6 kerberos ldap metalink rtmp samba ssh ssl static-libs test threads"
39 +IUSE+=" curl_ssl_axtls curl_ssl_gnutls curl_ssl_libressl curl_ssl_mbedtls curl_ssl_nss +curl_ssl_openssl curl_ssl_polarssl curl_ssl_winssl"
40 +IUSE+=" elibc_Winnt"
41 +
42 +#lead to lots of false negatives, bug #285669
43 +RESTRICT="test"
44 +
45 +RDEPEND="ldap? ( net-nds/openldap[${MULTILIB_USEDEP}] )
46 + ssl? (
47 + curl_ssl_axtls? (
48 + net-libs/axtls:0=[${MULTILIB_USEDEP}]
49 + app-misc/ca-certificates
50 + )
51 + curl_ssl_gnutls? (
52 + net-libs/gnutls:0=[static-libs?,${MULTILIB_USEDEP}]
53 + dev-libs/nettle:0=[${MULTILIB_USEDEP}]
54 + app-misc/ca-certificates
55 + )
56 + curl_ssl_libressl? (
57 + dev-libs/libressl:0=[static-libs?,${MULTILIB_USEDEP}]
58 + )
59 + curl_ssl_mbedtls? (
60 + net-libs/mbedtls:0=[${MULTILIB_USEDEP}]
61 + app-misc/ca-certificates
62 + )
63 + curl_ssl_openssl? (
64 + dev-libs/openssl:0=[static-libs?,${MULTILIB_USEDEP}]
65 + )
66 + curl_ssl_nss? (
67 + dev-libs/nss:0[${MULTILIB_USEDEP}]
68 + app-misc/ca-certificates
69 + )
70 + curl_ssl_polarssl? (
71 + net-libs/polarssl:0=[${MULTILIB_USEDEP}]
72 + app-misc/ca-certificates
73 + )
74 + )
75 + http2? ( net-libs/nghttp2[${MULTILIB_USEDEP}] )
76 + idn? ( net-dns/libidn2:0[static-libs?,${MULTILIB_USEDEP}] )
77 + adns? ( net-dns/c-ares:0[${MULTILIB_USEDEP}] )
78 + kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
79 + metalink? ( >=media-libs/libmetalink-0.1.1[${MULTILIB_USEDEP}] )
80 + rtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] )
81 + ssh? ( net-libs/libssh2[static-libs?,${MULTILIB_USEDEP}] )
82 + sys-libs/zlib[${MULTILIB_USEDEP}]
83 + abi_x86_32? (
84 + !<=app-emulation/emul-linux-x86-baselibs-20140508-r13
85 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)]
86 + )"
87 +
88 +# Do we need to enforce the same ssl backend for curl and rtmpdump? Bug #423303
89 +# rtmp? (
90 +# media-video/rtmpdump
91 +# curl_ssl_gnutls? ( media-video/rtmpdump[gnutls] )
92 +# curl_ssl_openssl? ( media-video/rtmpdump[-gnutls,ssl] )
93 +# )
94 +
95 +# ssl providers to be added:
96 +# fbopenssl $(use_with spnego)
97 +
98 +DEPEND="${RDEPEND}
99 + >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
100 + test? (
101 + sys-apps/diffutils
102 + dev-lang/perl
103 + )"
104 +
105 +# c-ares must be disabled for threads
106 +# only one ssl provider can be enabled
107 +REQUIRED_USE="
108 + curl_ssl_winssl? ( elibc_Winnt )
109 + threads? ( !adns )
110 + ssl? (
111 + ^^ (
112 + curl_ssl_axtls
113 + curl_ssl_gnutls
114 + curl_ssl_libressl
115 + curl_ssl_mbedtls
116 + curl_ssl_nss
117 + curl_ssl_openssl
118 + curl_ssl_polarssl
119 + curl_ssl_winssl
120 + )
121 + )"
122 +
123 +DOCS=( CHANGES README docs/FEATURES docs/INTERNALS.md \
124 + docs/MANUAL docs/FAQ docs/BUGS docs/CONTRIBUTE.md )
125 +
126 +MULTILIB_WRAPPED_HEADERS=(
127 + /usr/include/curl/curlbuild.h
128 +)
129 +
130 +MULTILIB_CHOST_TOOLS=(
131 + /usr/bin/curl-config
132 +)
133 +
134 +src_prepare() {
135 + eapply "${FILESDIR}"/${PN}-7.30.0-prefix.patch
136 + eapply "${FILESDIR}"/${PN}-respect-cflags-3.patch
137 + eapply "${FILESDIR}"/${PN}-fix-gnutls-nettle.patch
138 + eapply "${FILESDIR}"/${P}-fix-openssl.patch
139 +
140 + sed -i '/LD_LIBRARY_PATH=/d' configure.ac || die #382241
141 +
142 + eapply_user
143 + eprefixify curl-config.in
144 + eautoreconf
145 +}
146 +
147 +multilib_src_configure() {
148 + # We make use of the fact that later flags override earlier ones
149 + # So start with all ssl providers off until proven otherwise
150 + local myconf=()
151 + myconf+=( --without-axtls --without-gnutls --without-mbedtls --without-nss --without-polarssl --without-ssl --without-winssl )
152 + myconf+=( --without-ca-fallback --with-ca-bundle="${EPREFIX}"/etc/ssl/certs/ca-certificates.crt )
153 + if use ssl ; then
154 + if use curl_ssl_axtls; then
155 + einfo "SSL provided by axtls"
156 + myconf+=( --with-axtls )
157 + elif use curl_ssl_gnutls; then
158 + einfo "SSL provided by gnutls"
159 + myconf+=( --with-gnutls --with-nettle )
160 + elif use curl_ssl_libressl; then
161 + einfo "SSL provided by LibreSSL"
162 + myconf+=( --with-ssl --with-ca-path="${EPREFIX}"/etc/ssl/certs )
163 + elif use curl_ssl_mbedtls; then
164 + einfo "SSL provided by mbedtls"
165 + myconf+=( --with-mbedtls )
166 + elif use curl_ssl_nss; then
167 + einfo "SSL provided by nss"
168 + myconf+=( --with-nss )
169 + elif use curl_ssl_polarssl; then
170 + einfo "SSL provided by polarssl"
171 + myconf+=( --with-polarssl )
172 + elif use curl_ssl_openssl; then
173 + einfo "SSL provided by openssl"
174 + myconf+=( --with-ssl --with-ca-path="${EPREFIX}"/etc/ssl/certs )
175 + elif use curl_ssl_winssl; then
176 + einfo "SSL provided by Windows"
177 + myconf+=( --with-winssl )
178 + else
179 + eerror "We can't be here because of REQUIRED_USE."
180 + fi
181 + else
182 + einfo "SSL disabled"
183 + fi
184 +
185 + # These configuration options are organized alphabetically
186 + # within each category. This should make it easier if we
187 + # ever decide to make any of them contingent on USE flags:
188 + # 1) protocols first. To see them all do
189 + # 'grep SUPPORT_PROTOCOLS configure.ac'
190 + # 2) --enable/disable options second.
191 + # 'grep -- --enable configure | grep Check | awk '{ print $4 }' | sort
192 + # 3) --with/without options third.
193 + # grep -- --with configure | grep Check | awk '{ print $4 }' | sort
194 + ECONF_SOURCE="${S}" \
195 + econf \
196 + --enable-crypto-auth \
197 + --enable-dict \
198 + --enable-file \
199 + --enable-ftp \
200 + --enable-gopher \
201 + --enable-http \
202 + --enable-imap \
203 + $(use_enable ldap) \
204 + $(use_enable ldap ldaps) \
205 + --disable-ntlm-wb \
206 + --enable-pop3 \
207 + --enable-rt \
208 + --enable-rtsp \
209 + $(use_enable samba smb) \
210 + $(use_with ssh libssh2) \
211 + --enable-smtp \
212 + --enable-telnet \
213 + --enable-tftp \
214 + --enable-tls-srp \
215 + $(use_enable adns ares) \
216 + --enable-cookies \
217 + --enable-hidden-symbols \
218 + $(use_enable ipv6) \
219 + --enable-largefile \
220 + --without-libpsl \
221 + --enable-manual \
222 + --enable-proxy \
223 + --disable-soname-bump \
224 + --disable-sspi \
225 + $(use_enable static-libs static) \
226 + $(use_enable threads threaded-resolver) \
227 + --disable-versioned-symbols \
228 + --without-cyassl \
229 + --without-darwinssl \
230 + $(use_with idn libidn2) \
231 + $(use_with kerberos gssapi "${EPREFIX}"/usr) \
232 + $(use_with metalink libmetalink) \
233 + $(use_with http2 nghttp2) \
234 + $(use_with rtmp librtmp) \
235 + --without-spnego \
236 + --without-winidn \
237 + --with-zlib \
238 + "${myconf[@]}"
239 +
240 + if ! multilib_is_native_abi; then
241 + # avoid building the client
242 + sed -i -e '/SUBDIRS/s:src::' Makefile || die
243 + sed -i -e '/SUBDIRS/s:scripts::' Makefile || die
244 + fi
245 +
246 + # Fix up the pkg-config file to be more robust.
247 + # https://github.com/curl/curl/issues/864
248 + local priv=() libs=()
249 + # We always enable zlib.
250 + libs+=( "-lz" )
251 + priv+=( "zlib" )
252 + if use http2; then
253 + libs+=( "-lnghttp2" )
254 + priv+=( "libnghttp2" )
255 + fi
256 + if use curl_ssl_openssl; then
257 + libs+=( "-lssl" "-lcrypto" )
258 + priv+=( "openssl" )
259 + fi
260 + grep -q Requires.private libcurl.pc && die "need to update ebuild"
261 + libs=$(printf '|%s' "${libs[@]}")
262 + sed -i -r \
263 + -e "/^Libs.private/s:(${libs#|})( |$)::g" \
264 + libcurl.pc || die
265 + echo "Requires.private: ${priv[*]}" >> libcurl.pc
266 +}
267 +
268 +multilib_src_install_all() {
269 + einstalldocs
270 + prune_libtool_files --all
271 +
272 + rm -rf "${ED}"/etc/
273 +}
274
275 diff --git a/net-misc/curl/files/curl-7.52.1-fix-openssl.patch b/net-misc/curl/files/curl-7.52.1-fix-openssl.patch
276 new file mode 100644
277 index 00000000..259f618
278 --- /dev/null
279 +++ b/net-misc/curl/files/curl-7.52.1-fix-openssl.patch
280 @@ -0,0 +1,36 @@
281 +From a7b38c9dc98481e4a5fc37e51a8690337c674dfb Mon Sep 17 00:00:00 2001
282 +From: Daniel Stenberg <daniel@××××.se>
283 +Date: Mon, 26 Dec 2016 00:06:33 +0100
284 +Subject: [PATCH] vtls: s/SSLEAY/OPENSSL
285 +
286 +Fixed an old leftover use of the USE_SSLEAY define which would make a
287 +socket get removed from the applications sockets to monitor when the
288 +multi_socket API was used, leading to timeouts.
289 +
290 +Bug: #1174
291 +---
292 + lib/vtls/vtls.c | 4 ++--
293 + 1 file changed, 2 insertions(+), 2 deletions(-)
294 +
295 +diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c
296 +index b808e1c..707f24b 100644
297 +--- a/lib/vtls/vtls.c
298 ++++ b/lib/vtls/vtls.c
299 +@@ -484,7 +484,7 @@ void Curl_ssl_close_all(struct Curl_easy *data)
300 + curlssl_close_all(data);
301 + }
302 +
303 +-#if defined(USE_SSLEAY) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \
304 ++#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \
305 + defined(USE_DARWINSSL) || defined(USE_NSS)
306 + /* This function is for OpenSSL, GnuTLS, darwinssl, and schannel only. */
307 + int Curl_ssl_getsock(struct connectdata *conn, curl_socket_t *socks,
308 +@@ -518,7 +518,7 @@ int Curl_ssl_getsock(struct connectdata *conn,
309 + (void)numsocks;
310 + return GETSOCK_BLANK;
311 + }
312 +-/* USE_SSLEAY || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */
313 ++/* USE_OPENSSL || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */
314 + #endif
315 +
316 + void Curl_ssl_close(struct connectdata *conn, int sockindex)