1{ stdenv, fetchurl, gettext, libidn, pkgconfig
2, perl, perlPackages, LWP, python3
3, libiconv, libpsl, openssl ? null }:
4
5stdenv.mkDerivation rec {
6 name = "wget-1.16.3";
7
8 src = fetchurl {
9 url = "mirror://gnu/wget/${name}.tar.xz";
10 sha256 = "0dzv5xf9qxc2bp4cyifmaghh3h464wbm73xiwcrvckf1ynqbgxv7";
11 };
12
13 preConfigure = ''
14 for i in "doc/texi2pod.pl" "util/rmold.pl"; do
15 sed -i "$i" -e 's|/usr/bin.*perl|${perl}/bin/perl|g'
16 done
17 '' + stdenv.lib.optionalString doCheck ''
18 # Work around lack of DNS resolution in chroots.
19 for i in "tests/"*.pm "tests/"*.px
20 do
21 sed -i "$i" -e's/localhost/127.0.0.1/g'
22 done
23 '' + stdenv.lib.optionalString stdenv.isDarwin ''
24 export LIBS="-liconv -lintl"
25 '';
26
27 nativeBuildInputs = [ gettext pkgconfig ];
28 buildInputs = [ libidn libiconv libpsl ]
29 ++ stdenv.lib.optionals doCheck [ perl perlPackages.IOSocketSSL LWP python3 ]
30 ++ stdenv.lib.optional (openssl != null) openssl
31 ++ stdenv.lib.optional stdenv.isDarwin perl;
32
33 configureFlags =
34 if openssl != null then "--with-ssl=openssl" else "--without-ssl";
35
36 doCheck = false;
37
38 meta = with stdenv.lib; {
39 description = "Tool for retrieving files using HTTP, HTTPS, and FTP";
40
41 longDescription =
42 '' GNU Wget is a free software package for retrieving files using HTTP,
43 HTTPS and FTP, the most widely-used Internet protocols. It is a
44 non-interactive commandline tool, so it may easily be called from
45 scripts, cron jobs, terminals without X-Windows support, etc.
46 '';
47
48 license = licenses.gpl3Plus;
49
50 homepage = http://www.gnu.org/software/wget/;
51
52 maintainers = with maintainers; [ fpletz ];
53 platforms = platforms.all;
54 };
55}