Skip to content

Commit

Permalink
mldonkey: 3.1.7-2 -> 3.2.1 (NixOS#372745)
Browse files Browse the repository at this point in the history
  • Loading branch information
wegank authored Jan 10, 2025
2 parents 61b77b9 + c86350d commit a3c6ed7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 33 deletions.
75 changes: 43 additions & 32 deletions pkgs/applications/networking/p2p/mldonkey/default.nix
Original file line number Diff line number Diff line change
@@ -1,53 +1,64 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
fetchFromGitHub,
autoreconfHook,
autoconf-archive,
ocamlPackages,
pkg-config,
zlib,
}:

stdenv.mkDerivation rec {
pname = "mldonkey";
version = "3.1.7-2";
version = "3.2.1";

src = fetchurl {
url = "https://ygrek.org/p/release/mldonkey/mldonkey-${version}.tar.bz2";
sha256 = "b926e7aa3de4b4525af73c88f1724d576b4add56ef070f025941dd51cb24a794";
src = fetchFromGitHub {
owner = "ygrek";
repo = "mldonkey";
tag = "release-${lib.replaceStrings [ "." ] [ "-" ] version}";
hash = "sha256-Dbb7163CdqHY7/FJY2yWBFRudT+hTFT6fO4sFgt6C/A=";
};

patches = [
# Fixes C++17 compat
(fetchpatch {
url = "https://github.com/ygrek/mldonkey/pull/66/commits/20ff84c185396f3d759cf4ef46b9f0bd33a51060.patch";
hash = "sha256-MCqx0jVfOaLkZhhv0b1cTdO6BK2/f6TxTWmx+NZjXME=";
})
# Fixes OCaml 4.12 compat
(fetchpatch {
url = "https://github.com/ygrek/mldonkey/commit/a153f0f7a4826d86d51d4bacedc0330b70fcbc34.patch";
hash = "sha256-/Muk3mPFjQJ48FqaozGa7o8YSPhDLXRz9K1EyfxlzC8=";
})
# Fixes OCaml 4.14 compat
(fetchpatch {
url = "https://github.com/FabioLolix/AUR-artifacts/raw/6721c2d4ef0be9a99499ecf2787e378e50b915e9/mldonkey-fix-build.patch";
hash = "sha256-HPW/CKfhywy+Km5/64Iok4tO9LJjAk53jVlsYzIRPfs=";
})
];

preConfigure = ''
substituteInPlace Makefile --replace '+camlp4' \
'${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4'
postPatch = ''
substituteInPlace config/Makefile.in \
--replace-fail '+camlp4' '${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4'
'';

strictDeps = true;
nativeBuildInputs = with ocamlPackages; [
ocaml
camlp4

nativeBuildInputs = [
autoreconfHook
autoconf-archive
ocamlPackages.camlp4
ocamlPackages.findlib
ocamlPackages.ocaml
pkg-config
];

buildInputs = [
ocamlPackages.num
zlib
];
buildInputs = (with ocamlPackages; [ num ]) ++ [ zlib ];

preAutoreconf = ''
cd config
'';

postAutoreconf = ''
cd ..
'';

env =
{
NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
}
# https://github.com/ygrek/mldonkey/issues/117
// lib.optionalAttrs stdenv.cc.isClang {
CXXFLAGS = "-std=c++98";
};

meta = {
broken = stdenv.hostPlatform.isDarwin;
description = "Client for many p2p networks, with multiple frontends";
homepage = "https://github.com/ygrek/mldonkey";
license = lib.licenses.gpl2Only;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14433,7 +14433,7 @@ with pkgs;
mixxx = qt6Packages.callPackage ../applications/audio/mixxx { };

mldonkey = callPackage ../applications/networking/p2p/mldonkey {
ocamlPackages = ocaml-ng.ocamlPackages_4_14_unsafe_string;
ocamlPackages = ocaml-ng.ocamlPackages_4_14;
};

mmex = callPackage ../applications/office/mmex {
Expand Down

0 comments on commit a3c6ed7

Please sign in to comment.