Files
nixpkgs/pkgs/by-name/ml/mldonkey/package.nix
Guy Chronister 2eaf7e14b5 mldonkey: migrate to by-name
Assisted-by: Cursor Composer 2.5
2026-06-08 10:30:30 -05:00

78 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
autoconf-archive,
ocaml-ng,
pkg-config,
zlib,
}:
let
ocamlPackages = ocaml-ng.ocamlPackages_4_14;
in
stdenv.mkDerivation (finalAttrs: {
pname = "mldonkey";
version = "3.2.1";
src = fetchFromGitHub {
owner = "ygrek";
repo = "mldonkey";
tag = "release-${lib.replaceStrings [ "." ] [ "-" ] finalAttrs.version}";
hash = "sha256-Dbb7163CdqHY7/FJY2yWBFRudT+hTFT6fO4sFgt6C/A=";
};
patches = [
./gettext-0.25.patch
];
postPatch = ''
substituteInPlace config/Makefile.in \
--replace-fail '+camlp4' '${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4'
'';
strictDeps = true;
__structuredAttrs = true;
nativeBuildInputs = [
autoreconfHook
autoconf-archive
ocamlPackages.camlp4
ocamlPackages.findlib
ocamlPackages.ocaml
pkg-config
];
buildInputs = [
ocamlPackages.num
zlib
];
preAutoreconf = ''
cd config
'';
postAutoreconf = ''
cd ..
'';
env = {
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -DPROTOTYPES=1";
}
# https://github.com/ygrek/mldonkey/issues/117
// lib.optionalAttrs stdenv.cc.isClang {
CXXFLAGS = "-std=c++98";
}
// lib.optionalAttrs stdenv.hostPlatform.isDarwin {
NIX_LDFLAGS = "-liconv";
};
meta = {
description = "Client for many p2p networks, with multiple frontends";
homepage = "https://github.com/ygrek/mldonkey";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.unix;
};
})