From c86350d9916de8182d7263ca30a1ce7f9d6020be Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Fri, 10 Jan 2025 21:40:40 +0100 Subject: [PATCH] mldonkey: 3.1.7-2 -> 3.2.1 --- .../networking/p2p/mldonkey/default.nix | 75 +++++++++++-------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 44 insertions(+), 33 deletions(-) diff --git a/pkgs/applications/networking/p2p/mldonkey/default.nix b/pkgs/applications/networking/p2p/mldonkey/default.nix index 1f144f9577e26..fb8cd5bf71974 100644 --- a/pkgs/applications/networking/p2p/mldonkey/default.nix +++ b/pkgs/applications/networking/p2p/mldonkey/default.nix @@ -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; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cd1a3db79f569..f5b26b51fe764 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14447,7 +14447,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 {