curl-7.53.1.ebuild 7.1 KB

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