curl-7.52.1-r1.ebuild 7.4 KB

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