26 stdenv.mkDerivation rec {
31 url = "mirror://gnu/wget/wget-${version}.tar.lz";
32 hash = "sha256-GSJcx1awoIj8gRSNxqQKDI8ymvf9hIPxx7L+UPTgih8=";
55 ++ lib.optional withOpenssl openssl
56 ++ lib.optional withLibpsl libpsl
57 ++ lib.optionals stdenv.hostPlatform.isDarwin [
65 (lib.withFeatureAs withOpenssl "ssl" "openssl")
67 ++ lib.optionals stdenv.hostPlatform.isDarwin [
68 # https://lists.gnu.org/archive/html/bug-wget/2021-01/msg00076.html
69 "--without-included-regex"
73 # avoid runtime references to build-only depends
75 nuke-refs src/version.c
78 enableParallelBuilding = true;
80 __darwinAllowLocalNetworking = true;
84 patchShebangs tests fuzz
86 # Work around lack of DNS resolution in chroots.
87 for i in "tests/"*.pm "tests/"*.px
89 sed -i "$i" -e's/localhost/127.0.0.1/g'
92 + lib.optionalString stdenv.hostPlatform.isDarwin ''
93 # depending on the underlying filesystem, some tests
94 # creating exotic file names fail
95 for f in tests/Test-ftp-iri.px \
96 tests/Test-ftp-iri-fallback.px \
97 tests/Test-ftp-iri-recursive.px \
98 tests/Test-ftp-iri-disabled.px \
99 tests/Test-iri-disabled.px \
100 tests/Test-iri-list.px ;
102 # just return magic "skip" exit code 77
103 sed -i 's/^exit/exit 77 #/' $f
109 perlPackages.HTTPDaemon
112 ++ lib.optionals stdenv.hostPlatform.isDarwin [
113 perlPackages.IOSocketSSL
117 description = "Tool for retrieving files using HTTP, HTTPS, and FTP";
118 homepage = "https://www.gnu.org/software/wget/";
119 license = lib.licenses.gpl3Plus;
121 GNU Wget is a free software package for retrieving files using HTTP,
122 HTTPS and FTP, the most widely-used Internet protocols. It is a
123 non-interactive commandline tool, so it may easily be called from
124 scripts, cron jobs, terminals without X-Windows support, etc.
126 mainProgram = "wget";
127 maintainers = with lib.maintainers; [ fpletz ];
128 platforms = lib.platforms.all;