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/
Date: Fri, 29 Jun 2018 13:35:56
Message-Id: 1530279260.99fbeebb2ceac399a075f8434be9769ff51a2d40.blueness@gentoo
1 commit: 99fbeebb2ceac399a075f8434be9769ff51a2d40
2 Author: Stephen Shkardoon <ss23 <AT> ss23 <DOT> geek <DOT> nz>
3 AuthorDate: Fri Jun 29 10:25:37 2018 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 29 13:34:20 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99fbeebb
7
8 net-misc/curl: fix generated libcurl.pc when not using ssl
9
10 Closes: https://bugs.gentoo.org/659572
11 Package-Manager: Portage-2.3.40, Repoman-2.3.9
12
13 net-misc/curl/curl-7.60.0-r1.ebuild | 247 ++++++++++++++++++++++++++++++++++++
14 1 file changed, 247 insertions(+)
15
16 diff --git a/net-misc/curl/curl-7.60.0-r1.ebuild b/net-misc/curl/curl-7.60.0-r1.ebuild
17 new file mode 100644
18 index 00000000000..4fc76476938
19 --- /dev/null
20 +++ b/net-misc/curl/curl-7.60.0-r1.ebuild
21 @@ -0,0 +1,247 @@
22 +# Copyright 1999-2018 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI="6"
26 +
27 +inherit autotools eutils prefix multilib-minimal
28 +
29 +DESCRIPTION="A Client that groks URLs"
30 +HOMEPAGE="https://curl.haxx.se/"
31 +SRC_URI="https://curl.haxx.se/download/${P}.tar.bz2"
32 +
33 +LICENSE="MIT"
34 +SLOT="0"
35 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
36 +IUSE="adns brotli http2 idn ipv6 kerberos ldap metalink rtmp samba ssh ssl static-libs test threads"
37 +IUSE+=" curl_ssl_axtls curl_ssl_gnutls curl_ssl_libressl curl_ssl_mbedtls curl_ssl_nss +curl_ssl_openssl curl_ssl_winssl"
38 +IUSE+=" elibc_Winnt"
39 +
40 +#lead to lots of false negatives, bug #285669
41 +RESTRICT="test"
42 +
43 +RDEPEND="ldap? ( net-nds/openldap[${MULTILIB_USEDEP}] )
44 + brotli? ( app-arch/brotli:= )
45 + ssl? (
46 + curl_ssl_axtls? (
47 + net-libs/axtls:0=[${MULTILIB_USEDEP}]
48 + app-misc/ca-certificates
49 + )
50 + curl_ssl_gnutls? (
51 + net-libs/gnutls:0=[static-libs?,${MULTILIB_USEDEP}]
52 + dev-libs/nettle:0=[${MULTILIB_USEDEP}]
53 + app-misc/ca-certificates
54 + )
55 + curl_ssl_libressl? (
56 + dev-libs/libressl:0=[static-libs?,${MULTILIB_USEDEP}]
57 + )
58 + curl_ssl_mbedtls? (
59 + net-libs/mbedtls:0=[${MULTILIB_USEDEP}]
60 + app-misc/ca-certificates
61 + )
62 + curl_ssl_openssl? (
63 + dev-libs/openssl:0=[static-libs?,${MULTILIB_USEDEP}]
64 + )
65 + curl_ssl_nss? (
66 + dev-libs/nss:0[${MULTILIB_USEDEP}]
67 + app-misc/ca-certificates
68 + )
69 + )
70 + http2? ( net-libs/nghttp2[${MULTILIB_USEDEP}] )
71 + idn? ( net-dns/libidn2:0[static-libs?,${MULTILIB_USEDEP}] )
72 + adns? ( net-dns/c-ares:0[${MULTILIB_USEDEP}] )
73 + kerberos? ( >=virtual/krb5-0-r1[${MULTILIB_USEDEP}] )
74 + metalink? ( >=media-libs/libmetalink-0.1.1[${MULTILIB_USEDEP}] )
75 + rtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] )
76 + ssh? ( net-libs/libssh2[static-libs?,${MULTILIB_USEDEP}] )
77 + sys-libs/zlib[${MULTILIB_USEDEP}]"
78 +
79 +# Do we need to enforce the same ssl backend for curl and rtmpdump? Bug #423303
80 +# rtmp? (
81 +# media-video/rtmpdump
82 +# curl_ssl_gnutls? ( media-video/rtmpdump[gnutls] )
83 +# curl_ssl_openssl? ( media-video/rtmpdump[-gnutls,ssl] )
84 +# )
85 +
86 +# ssl providers to be added:
87 +# fbopenssl $(use_with spnego)
88 +
89 +DEPEND="${RDEPEND}
90 + >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
91 + test? (
92 + sys-apps/diffutils
93 + dev-lang/perl
94 + )"
95 +
96 +# c-ares must be disabled for threads
97 +# only one ssl provider can be enabled
98 +REQUIRED_USE="
99 + curl_ssl_winssl? ( elibc_Winnt )
100 + threads? ( !adns )
101 + ssl? (
102 + ^^ (
103 + curl_ssl_axtls
104 + curl_ssl_gnutls
105 + curl_ssl_libressl
106 + curl_ssl_mbedtls
107 + curl_ssl_nss
108 + curl_ssl_openssl
109 + curl_ssl_winssl
110 + )
111 + )"
112 +
113 +DOCS=( CHANGES README docs/FEATURES docs/INTERNALS.md \
114 + docs/MANUAL docs/FAQ docs/BUGS docs/CONTRIBUTE.md )
115 +
116 +MULTILIB_WRAPPED_HEADERS=(
117 + /usr/include/curl/curlbuild.h
118 +)
119 +
120 +MULTILIB_CHOST_TOOLS=(
121 + /usr/bin/curl-config
122 +)
123 +
124 +src_prepare() {
125 + eapply "${FILESDIR}"/${PN}-7.30.0-prefix.patch
126 + eapply "${FILESDIR}"/${PN}-respect-cflags-3.patch
127 + eapply "${FILESDIR}"/${PN}-fix-gnutls-nettle.patch
128 +
129 + sed -i '/LD_LIBRARY_PATH=/d' configure.ac || die #382241
130 +
131 + eapply_user
132 + eprefixify curl-config.in
133 + eautoreconf
134 +
135 + if [[ ${CHOST} == *-darwin17 ]] ; then
136 + # https://bugs.gentoo.org/show_bug.cgi?id=637252
137 + sed -i -e '/-Werror=partial-availability/s/Werror/Wno-error/g' \
138 + configure || die
139 + fi
140 +}
141 +
142 +multilib_src_configure() {
143 + # We make use of the fact that later flags override earlier ones
144 + # So start with all ssl providers off until proven otherwise
145 + # TODO: in the future, we may want to add wolfssl (https://www.wolfssl.com/)
146 + local myconf=()
147 + myconf+=( --without-axtls --without-gnutls --without-mbedtls --without-nss --without-polarssl --without-ssl --without-winssl )
148 + myconf+=( --without-ca-fallback --with-ca-bundle="${EPREFIX}"/etc/ssl/certs/ca-certificates.crt )
149 + if use ssl ; then
150 + if use curl_ssl_axtls; then
151 + einfo "SSL provided by axtls"
152 + myconf+=( --with-axtls )
153 + elif use curl_ssl_gnutls; then
154 + einfo "SSL provided by gnutls"
155 + myconf+=( --with-gnutls --with-nettle )
156 + elif use curl_ssl_libressl; then
157 + einfo "SSL provided by LibreSSL"
158 + myconf+=( --with-ssl --with-ca-path="${EPREFIX}"/etc/ssl/certs )
159 + elif use curl_ssl_mbedtls; then
160 + einfo "SSL provided by mbedtls"
161 + myconf+=( --with-mbedtls )
162 + elif use curl_ssl_nss; then
163 + einfo "SSL provided by nss"
164 + myconf+=( --with-nss )
165 + elif use curl_ssl_openssl; then
166 + einfo "SSL provided by openssl"
167 + myconf+=( --with-ssl --with-ca-path="${EPREFIX}"/etc/ssl/certs )
168 + elif use curl_ssl_winssl; then
169 + einfo "SSL provided by Windows"
170 + myconf+=( --with-winssl )
171 + else
172 + eerror "We can't be here because of REQUIRED_USE."
173 + fi
174 + else
175 + einfo "SSL disabled"
176 + fi
177 +
178 + # These configuration options are organized alphabetically
179 + # within each category. This should make it easier if we
180 + # ever decide to make any of them contingent on USE flags:
181 + # 1) protocols first. To see them all do
182 + # 'grep SUPPORT_PROTOCOLS configure.ac'
183 + # 2) --enable/disable options second.
184 + # 'grep -- --enable configure | grep Check | awk '{ print $4 }' | sort
185 + # 3) --with/without options third.
186 + # grep -- --with configure | grep Check | awk '{ print $4 }' | sort
187 + ECONF_SOURCE="${S}" \
188 + econf \
189 + --enable-crypto-auth \
190 + --enable-dict \
191 + --enable-file \
192 + --enable-ftp \
193 + --enable-gopher \
194 + --enable-http \
195 + --enable-imap \
196 + $(use_enable ldap) \
197 + $(use_enable ldap ldaps) \
198 + --disable-ntlm-wb \
199 + --enable-pop3 \
200 + --enable-rt \
201 + --enable-rtsp \
202 + $(use_enable samba smb) \
203 + $(use_with ssh libssh2) \
204 + --enable-smtp \
205 + --enable-telnet \
206 + --enable-tftp \
207 + --enable-tls-srp \
208 + $(use_enable adns ares) \
209 + --enable-cookies \
210 + --enable-hidden-symbols \
211 + $(use_enable ipv6) \
212 + --enable-largefile \
213 + --without-libpsl \
214 + --enable-manual \
215 + --enable-proxy \
216 + --disable-sspi \
217 + $(use_enable static-libs static) \
218 + $(use_enable threads threaded-resolver) \
219 + $(use_enable threads pthreads) \
220 + --disable-versioned-symbols \
221 + --without-cyassl \
222 + --without-darwinssl \
223 + $(use_with idn libidn2) \
224 + $(use_with kerberos gssapi "${EPREFIX}"/usr) \
225 + $(use_with metalink libmetalink) \
226 + $(use_with http2 nghttp2) \
227 + $(use_with rtmp librtmp) \
228 + $(use_with brotli) \
229 + --without-spnego \
230 + --without-winidn \
231 + --without-wolfssl \
232 + --with-zlib \
233 + "${myconf[@]}"
234 +
235 + if ! multilib_is_native_abi; then
236 + # avoid building the client
237 + sed -i -e '/SUBDIRS/s:src::' Makefile || die
238 + sed -i -e '/SUBDIRS/s:scripts::' Makefile || die
239 + fi
240 +
241 + # Fix up the pkg-config file to be more robust.
242 + # https://github.com/curl/curl/issues/864
243 + local priv=() libs=()
244 + # We always enable zlib.
245 + libs+=( "-lz" )
246 + priv+=( "zlib" )
247 + if use http2; then
248 + libs+=( "-lnghttp2" )
249 + priv+=( "libnghttp2" )
250 + fi
251 + if use ssl && use curl_ssl_openssl; then
252 + libs+=( "-lssl" "-lcrypto" )
253 + priv+=( "openssl" )
254 + fi
255 + grep -q Requires.private libcurl.pc && die "need to update ebuild"
256 + libs=$(printf '|%s' "${libs[@]}")
257 + sed -i -r \
258 + -e "/^Libs.private/s:(${libs#|})( |$)::g" \
259 + libcurl.pc || die
260 + echo "Requires.private: ${priv[*]}" >> libcurl.pc
261 +}
262 +
263 +multilib_src_install_all() {
264 + einstalldocs
265 + prune_libtool_files --all
266 +
267 + rm -rf "${ED}"/etc/
268 +}