@@ -1,14 +1,20 @@
1−{stdenv, fetchurl, ocaml, zlib, bzip2, ncurses, file, gd, libpng, libjpeg }:
1+{ stdenv, fetchurl, ocamlPackages, zlib, bzip2, ncurses, file, gd, libpng, libjpeg }:
22
33stdenv.mkDerivation (rec {
4− name = "mldonkey-3.1.5";
4+ name = "mldonkey-3.1.6";
55
66 src = fetchurl {
7− url = "mirror://sourceforge/mldonkey/${name}.tar.bz2";
8− sha256 = "1jqik6b09p27ckssppfiqpph7alxbgpnf9w1s0lalmi3qyyd9ybl";
7+ url = https://github.com/ygrek/mldonkey/releases/download/release-3-1-6/mldonkey-3.1.6.tar.bz2;
8+ sha256 = "0g84islkj72ymp0zzppcj9n4r21h0vlghnq87hv2wg580mybadhv";
99 };
1010
11− buildInputs = [ ocaml zlib ncurses bzip2 file gd libpng libjpeg ];
11+ preConfigure = stdenv.lib.optionalString (ocamlPackages.camlp4 != null) ''
12+ substituteInPlace Makefile --replace '+camlp4' \
13+ '${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4'
14+ '';
15+
16+ buildInputs = [ zlib ncurses bzip2 file gd libpng libjpeg ] ++
17+ (with ocamlPackages; [ ocaml camlp4 ]);
1218 configureFlags = [ "--disable-gui" ];
1319
1420 meta = {
@@ -17,7 +23,7 @@ stdenv.mkDerivation (rec {
1723 license = stdenv.lib.licenses.gpl2;
1824 platforms = stdenv.lib.platforms.unix;
1925 };
20−} // (if !ocaml.nativeCompilers then
26+} // (if !ocamlPackages.ocaml.nativeCompilers then
2127{
2228 # Byte code compilation (the ocaml opt compiler is not supported in some platforms)
2329 buildPhase = "make mlnet.byte";