1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7,8} )
8 inherit flag-o-matic python-any-r1 toolchain-funcs
10 DESCRIPTION="Network utility to retrieve files from the WWW"
11 HOMEPAGE="https://www.gnu.org/software/wget/"
12 SRC_URI="mirror://gnu/wget/${P}.tar.gz"
16 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 IUSE="cookie_check debug gnutls idn ipv6 libressl metalink nls ntlm pcre +ssl static test uuid zlib"
18 REQUIRED_USE=" ntlm? ( !gnutls ssl ) gnutls? ( ssl )"
19 RESTRICT="!test? ( test )"
21 # Force a newer libidn2 to avoid libunistring deps. #612498
23 cookie_check? ( net-libs/libpsl )
24 idn? ( >=net-dns/libidn2-0.14:=[static-libs(+)] )
25 metalink? ( media-libs/libmetalink )
26 pcre? ( dev-libs/libpcre2[static-libs(+)] )
28 gnutls? ( net-libs/gnutls:0=[static-libs(+)] )
30 !libressl? ( dev-libs/openssl:0=[static-libs(+)] )
31 libressl? ( dev-libs/libressl:0=[static-libs(+)] )
34 uuid? ( sys-apps/util-linux[static-libs(+)] )
35 zlib? ( sys-libs/zlib[static-libs(+)] )
37 RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
40 static? ( ${LIB_DEPEND} )
46 dev-perl/IO-Socket-SSL
52 nls? ( sys-devel/gettext )
55 DOCS=( AUTHORS MAILING-LIST NEWS README doc/sample.wgetrc )
57 PATCHES=( "${FILESDIR}"/${P}-gcc10-fno-common.patch )
60 use test && python-any-r1_pkg_setup
66 # revert some hack that breaks linking, bug #585924
67 if [[ ${CHOST} == *-darwin* ]] \
68 || [[ ${CHOST} == *-solaris* ]] \
69 || [[ ${CHOST} == *-uclibc* ]] \
70 || [[ ${CHOST} == *-cygwin* ]] \
73 -e 's/^ LIBICONV=$/:/' \
79 # fix compilation on Solaris, we need filio.h for FIONBIO as used in
80 # the included gnutls -- force ioctl.h to include this header
81 [[ ${CHOST} == *-solaris* ]] && append-cppflags -DBSD_COMP=1
84 append-ldflags -static
86 PKG_CONFIG+=" --static"
89 # There is no flag that controls this. libunistring-prefix only
90 # controls the search path (which is why we turn it off below).
91 # Further, libunistring is only needed w/older libidn2 installs,
92 # and since we force the latest, we can force off libunistring. #612498
97 --without-included-libunistring
98 --without-libunistring-prefix
100 $(use_enable idn iri)
104 $(use_enable pcre pcre2)
105 $(use_enable ssl digest)
106 $(use_enable ssl opie)
107 $(use_with cookie_check libpsl)
108 $(use_with idn libidn)
110 $(use_with ssl ssl $(usex gnutls gnutls openssl))
111 $(use_with uuid libuuid)
114 ac_cv_libunistring=no \
115 econf "${myeconfargs[@]}"
122 -e "s:/usr/local/etc:${EPREFIX}/etc:g" \
124 "${ED}"/usr/share/man/man1/wget.1 \
125 "${ED}"/usr/share/info/wget.info \