Files
nixpkgs/pkgs/by-name/wg/wget2/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

126 lines
2.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitLab,
# build support
autoreconfHook,
flex,
gnulib,
pkg-config,
texinfo,
# libraries
brotli,
bzip2,
gpgme,
libhsts,
libidn2,
libpsl,
lzip,
nghttp2,
openssl,
pcre2,
sslSupport ? true,
xz,
zlib,
zstd,
versionCheckHook,
}:
stdenv.mkDerivation rec {
pname = "wget2";
version = "2.2.0";
outputs = [
"out"
"lib"
"dev"
];
src = fetchFromGitLab {
owner = "gnuwget";
repo = "wget2";
tag = "v${version}";
hash = "sha256-0tOoStZHr5opehFmuQdFRPYvOv8IMrDTBNFtoweY3VM=";
};
patches = [
./gettext-0.25.patch
];
# wget2_noinstall contains forbidden reference to /build/
postPatch = ''
substituteInPlace src/Makefile.am \
--replace-fail "bin_PROGRAMS = wget2 wget2_noinstall" "bin_PROGRAMS = wget2"
'';
strictDeps = true;
nativeBuildInputs = [
autoreconfHook
flex
lzip
pkg-config
texinfo
];
buildInputs = [
brotli
bzip2
gpgme
libhsts
libidn2
libpsl
nghttp2
pcre2
xz
zlib
zstd
]
++ lib.optionals sslSupport [
openssl
];
# TODO: include translation files
autoreconfPhase = ''
# copy gnulib into build dir and make writable.
# Otherwise ./bootstrap copies the non-writable files from nix store and fails to modify them
rmdir gnulib
cp -r ${gnulib} gnulib
chmod -R u+w gnulib/{build-aux,lib}
./bootstrap --no-git --gnulib-srcdir=gnulib --skip-po
'';
configureFlags = [
(lib.enableFeature false "shared")
# TODO: https://gitlab.com/gnuwget/wget2/-/issues/537
(lib.withFeatureAs sslSupport "ssl" "openssl")
];
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/${meta.mainProgram}";
versionCheckProgramArg = "--version";
meta = {
description = "Successor of GNU Wget, a file and recursive website downloader";
longDescription = ''
Designed and written from scratch it wraps around libwget, that provides the basic
functions needed by a web client.
Wget2 works multi-threaded and uses many features to allow fast operation.
In many cases Wget2 downloads much faster than Wget1.x due to HTTP2, HTTP compression,
parallel connections and use of If-Modified-Since HTTP header.
'';
homepage = "https://gitlab.com/gnuwget/wget2";
# wget2 GPLv3+; libwget LGPLv3+
license = with lib.licenses; [
gpl3Plus
lgpl3Plus
];
maintainers = with lib.maintainers; [ SuperSandro2000 ];
mainProgram = "wget2";
};
}