summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2021-02-13 21:12:20 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2021-02-17 13:24:41 +0100
commite11e0b15363f62c6e6260e558555ce54df6887f7 (patch)
treee6661fa4c983cee7b1b7a6841a77d80d9bb93b03 /pkgs
parenta4402edf94f77944fa23ee1021747af5bb4a36cd (diff)
downloadnixpkgs-e11e0b15363f62c6e6260e558555ce54df6887f7.tar
nixpkgs-e11e0b15363f62c6e6260e558555ce54df6887f7.tar.gz
nixpkgs-e11e0b15363f62c6e6260e558555ce54df6887f7.tar.bz2
nixpkgs-e11e0b15363f62c6e6260e558555ce54df6887f7.tar.lz
nixpkgs-e11e0b15363f62c6e6260e558555ce54df6887f7.tar.xz
nixpkgs-e11e0b15363f62c6e6260e558555ce54df6887f7.tar.zst
nixpkgs-e11e0b15363f62c6e6260e558555ce54df6887f7.zip
wget2: init at 1.99.2
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/networking/wget2/default.nix100
-rw-r--r--pkgs/top-level/all-packages.nix12
2 files changed, 112 insertions, 0 deletions
diff --git a/pkgs/tools/networking/wget2/default.nix b/pkgs/tools/networking/wget2/default.nix
new file mode 100644
index 00000000000..1537da36163
--- /dev/null
+++ b/pkgs/tools/networking/wget2/default.nix
@@ -0,0 +1,100 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, fetchpatch
+  # build support
+, autoreconfHook
+, flex
+, gnulib
+, lzip
+, pkg-config
+, python3
+, texinfo
+  # libraries
+, brotli
+, bzip2
+, gpgme
+, libhsts
+, libidn2
+, libpsl
+, lzma
+, nghttp2
+, sslSupport ? true
+, openssl
+, pcre2
+, zlib
+, zstd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wget2";
+  version = "1.99.2";
+
+  src = fetchFromGitLab {
+    owner = "gnuwget";
+    repo = pname;
+    rev = version;
+    sha256 = "1gws8y3z8xzi46c48n7jb162mr3ar4c34s7yy8kjcs14yzq951qz";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "fix-autotools-2.70.patch";
+      url = "https://gitlab.com/gnuwget/wget2/-/commit/580af869093cfda6bc8a9d5901850354a16b3666.patch";
+      sha256 = "1x6wq4wxvvy6174d52qrhxkcgmv366f8smxyki49zb6rs4gqhskd";
+    })
+    (fetchpatch {
+      name = "update-potfiles-for-gnulib-2020-11-28.patch";
+      url = "https://gitlab.com/gnuwget/wget2/-/commit/368deb9fcca0c281f9c76333607cc878c3945ad0.patch";
+      sha256 = "1qsz8hbzbgg14wikxsbjjlq0cp3jw4pajbaz9wdn6ny617hdvi8y";
+    })
+  ];
+
+  # wget2_noinstall contains forbidden reference to /build/
+  postPatch = ''
+    substituteInPlace src/Makefile.am \
+      --replace 'bin_PROGRAMS = wget2 wget2_noinstall' 'bin_PROGRAMS = wget2'
+  '';
+
+  nativeBuildInputs = [ autoreconfHook flex lzip pkg-config python3 texinfo ];
+
+  buildInputs = [ brotli bzip2 gpgme libhsts libidn2 libpsl lzma nghttp2 pcre2 zlib zstd ]
+    ++ lib.optional 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}
+
+    # fix bashisms can be removed when https://gitlab.com/gnuwget/wget2/-/commit/c9499dcf2f58983d03e659e2a1a7f21225141edf is in the release
+    sed 's|==|=|g' -i configure.ac
+
+    ./bootstrap --no-git --gnulib-srcdir=gnulib --skip-po
+  '';
+
+  configureFlags = [
+    "--disable-static"
+    # TODO: https://gitlab.com/gnuwget/wget2/-/issues/537
+    (lib.withFeatureAs sslSupport "ssl" "openssl")
+  ];
+
+  outputs = [ "out" "lib" "dev" ];
+
+  meta = with lib; {
+    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 licenses; [ gpl3Plus lgpl3Plus ];
+    maintainers = with maintainers; [ SuperSandro2000 ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 806960b4ad4..15c6f259a44 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9037,6 +9037,18 @@ in
     libpsl = null;
   };
 
+  wget2 = callPackage ../tools/networking/wget2 {
+    # update breaks grub2
+    gnulib = pkgs.gnulib.overrideAttrs (oldAttrs: rec {
+      version = "20210208";
+      src = fetchgit {
+        url = "https://git.savannah.gnu.org/r/gnulib.git";
+        rev = "0b38e1d69f03d3977d7ae7926c1efeb461a8a971";
+        sha256 = "06bj9y8wcfh35h653yk8j044k7h5g82d2j3z3ib69rg0gy1xagzp";
+      };
+    });
+  };
+
   wg-bond = callPackage ../applications/networking/wg-bond { };
 
   which = callPackage ../tools/system/which { };