1 { lib, stdenv, fetchurl, gettext, pkg-config, perlPackages
2 , libidn2, zlib, pcre, libuuid, libiconv, libintl
4 , withLibpsl ? false, libpsl
5 , withOpenssl ? true, openssl
8 stdenv.mkDerivation rec {
13 url = "mirror://gnu/wget/${pname}-${version}.tar.lz";
14 hash = "sha256-NoNhml9Q7cvMsXIKeQBvo3v5uaJVqMW0gEi8PHqHS9k=";
18 ./remove-runtime-dep-on-openssl-headers.patch
24 '' + lib.optionalString doCheck ''
25 # Work around lack of DNS resolution in chroots.
26 for i in "tests/"*.pm "tests/"*.px
28 sed -i "$i" -e's/localhost/127.0.0.1/g'
32 nativeBuildInputs = [ gettext pkg-config perlPackages.perl lzip libiconv libintl ];
33 buildInputs = [ libidn2 zlib pcre libuuid ]
34 ++ lib.optionals doCheck [ perlPackages.IOSocketSSL perlPackages.LWP python3 ]
35 ++ lib.optional withOpenssl openssl
36 ++ lib.optional withLibpsl libpsl
37 ++ lib.optional stdenv.isDarwin perlPackages.perl;
40 (lib.withFeatureAs withOpenssl "ssl" "openssl")
41 ] ++ lib.optionals stdenv.isDarwin [
42 # https://lists.gnu.org/archive/html/bug-wget/2021-01/msg00076.html
43 "--without-included-regex"
49 description = "Tool for retrieving files using HTTP, HTTPS, and FTP";
50 homepage = "https://www.gnu.org/software/wget/";
51 license = licenses.gpl3Plus;
53 '' GNU Wget is a free software package for retrieving files using HTTP,
54 HTTPS and FTP, the most widely-used Internet protocols. It is a
55 non-interactive commandline tool, so it may easily be called from
56 scripts, cron jobs, terminals without X-Windows support, etc.
59 maintainers = with maintainers; [ fpletz ];
60 platforms = platforms.all;