2024-09-19 14:19:46 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, gettext, pkg-config, perlPackages
|
2020-04-24 23:36:52 +00:00
|
|
|
, libidn2, zlib, pcre, libuuid, libiconv, libintl
|
2024-07-27 06:49:29 +00:00
|
|
|
, python3, lzip, darwin
|
2022-08-12 12:06:08 +00:00
|
|
|
, withLibpsl ? false, libpsl
|
|
|
|
, withOpenssl ? true, openssl
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "wget";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.24.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-07-27 06:49:29 +00:00
|
|
|
url = "mirror://gnu/wget/wget-${version}.tar.lz";
|
|
|
|
hash = "sha256-V6EHFR5O+U/flK/+z6xZiWPzcvEyk+2cdAMhBTkLNu4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./remove-runtime-dep-on-openssl-headers.patch
|
2024-09-19 14:19:46 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2024-38428.patch";
|
|
|
|
url = "https://git.savannah.gnu.org/cgit/wget.git/patch/?id=ed0c7c7e0e8f7298352646b2fd6e06a11e242ace";
|
|
|
|
hash = "sha256-4ZVPufgG/h0UkxF9hQBAtF6QAG4GEz9hHeqEsD47q4U=";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs doc
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ gettext pkg-config perlPackages.perl lzip libiconv libintl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libidn2 zlib pcre libuuid ]
|
2022-08-12 12:06:08 +00:00
|
|
|
++ lib.optional withOpenssl openssl
|
|
|
|
++ lib.optional withLibpsl libpsl
|
2024-09-26 11:04:55 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.apple_sdk.frameworks.CoreServices perlPackages.perl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
2022-08-12 12:06:08 +00:00
|
|
|
(lib.withFeatureAs withOpenssl "ssl" "openssl")
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2021-03-15 08:37:03 +00:00
|
|
|
# https://lists.gnu.org/archive/html/bug-wget/2021-01/msg00076.html
|
|
|
|
"--without-included-regex"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
2024-09-19 14:19:46 +00:00
|
|
|
doCheck = true;
|
|
|
|
preCheck = ''
|
|
|
|
patchShebangs tests fuzz
|
|
|
|
|
|
|
|
# Work around lack of DNS resolution in chroots.
|
|
|
|
for i in "tests/"*.pm "tests/"*.px
|
|
|
|
do
|
|
|
|
sed -i "$i" -e's/localhost/127.0.0.1/g'
|
|
|
|
done
|
2024-09-26 11:04:55 +00:00
|
|
|
'' + lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2024-09-19 14:19:46 +00:00
|
|
|
# depending on the underlying filesystem, some tests
|
|
|
|
# creating exotic file names fail
|
|
|
|
for f in tests/Test-ftp-iri.px \
|
|
|
|
tests/Test-ftp-iri-fallback.px \
|
|
|
|
tests/Test-ftp-iri-recursive.px \
|
|
|
|
tests/Test-ftp-iri-disabled.px \
|
|
|
|
tests/Test-iri-disabled.px \
|
|
|
|
tests/Test-iri-list.px ;
|
|
|
|
do
|
|
|
|
# just return magic "skip" exit code 77
|
|
|
|
sed -i 's/^exit/exit 77 #/' $f
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
checkInputs = [
|
|
|
|
perlPackages.HTTPDaemon
|
|
|
|
python3
|
2024-09-26 11:04:55 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-09-19 14:19:46 +00:00
|
|
|
perlPackages.IOSocketSSL
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Tool for retrieving files using HTTP, HTTPS, and FTP";
|
2023-08-22 20:05:09 +00:00
|
|
|
homepage = "https://www.gnu.org/software/wget/";
|
|
|
|
license = licenses.gpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription =
|
|
|
|
'' GNU Wget is a free software package for retrieving files using HTTP,
|
|
|
|
HTTPS and FTP, the most widely-used Internet protocols. It is a
|
|
|
|
non-interactive commandline tool, so it may easily be called from
|
|
|
|
scripts, cron jobs, terminals without X-Windows support, etc.
|
|
|
|
'';
|
2023-08-22 20:05:09 +00:00
|
|
|
mainProgram = "wget";
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ fpletz ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|