2021-01-15 13:21:58 +00:00
|
|
|
{ lib, stdenv, fetchurl, ocamlPackages, zlib, bzip2, ncurses, file, gd, libpng, libjpeg }:
|
2009-01-04 17:35:11 +00:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation ({
|
2017-07-08 14:21:42 +01:00
|
|
|
name = "mldonkey-3.1.6";
|
2016-08-02 17:19:16 +01:00
|
|
|
|
2009-01-04 17:35:11 +00:00
|
|
|
src = fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "https://github.com/ygrek/mldonkey/releases/download/release-3-1-6/mldonkey-3.1.6.tar.bz2";
|
2017-07-08 14:21:42 +01:00
|
|
|
sha256 = "0g84islkj72ymp0zzppcj9n4r21h0vlghnq87hv2wg580mybadhv";
|
2009-01-04 17:35:11 +00:00
|
|
|
};
|
2016-08-02 17:19:16 +01:00
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
preConfigure = lib.optionalString (ocamlPackages.camlp4 != null) ''
|
2017-07-08 14:21:42 +01:00
|
|
|
substituteInPlace Makefile --replace '+camlp4' \
|
|
|
|
'${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4'
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ zlib ncurses bzip2 file gd libpng libjpeg ] ++
|
|
|
|
(with ocamlPackages; [ ocaml camlp4 ]);
|
2016-08-02 17:19:16 +01:00
|
|
|
configureFlags = [ "--disable-gui" ];
|
|
|
|
|
2009-01-04 17:35:11 +00:00
|
|
|
meta = {
|
|
|
|
description = "Client for many p2p networks, with multiple frontends";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://mldonkey.sourceforge.net/";
|
2021-01-15 13:21:58 +00:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = lib.platforms.unix;
|
2009-01-04 17:35:11 +00:00
|
|
|
};
|
2017-07-08 14:21:42 +01:00
|
|
|
} // (if !ocamlPackages.ocaml.nativeCompilers then
|
2010-01-16 16:41:33 +00:00
|
|
|
{
|
2012-09-23 22:55:42 +01:00
|
|
|
# Byte code compilation (the ocaml opt compiler is not supported in some platforms)
|
2009-11-08 00:32:12 +00:00
|
|
|
buildPhase = "make mlnet.byte";
|
|
|
|
installPhase = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/bin
|
2009-11-08 00:32:12 +00:00
|
|
|
cp mlnet.byte $out/bin/mlnet
|
|
|
|
'';
|
|
|
|
|
|
|
|
# ocaml bytecode selfcontained binaries loose the bytecode if stripped
|
|
|
|
dontStrip = true;
|
2010-01-16 16:41:33 +00:00
|
|
|
} else {}))
|