From 35e2079bd5a3c5a213068c9fae1fa766cf1fb249 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 22 Oct 2022 10:26:42 +0200 Subject: [PATCH] =?UTF-8?q?ocamlPackages.pyml:=2020220615=20=E2=86=92=2020?= =?UTF-8?q?220905?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/thierry-martinez/pyml/releases/tag/20220905 Aldo switch to dune, which has been available since 2021-09-24. And remove unneeded dependencies: - ncurses was needed for Python in the past - ocaml and findlib are implied by dune --- .../ocaml-modules/pyml/default.nix | 53 +++++++++++-------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/pkgs/development/ocaml-modules/pyml/default.nix b/pkgs/development/ocaml-modules/pyml/default.nix index 97fcf1d5caa..9eba3ab3185 100644 --- a/pkgs/development/ocaml-modules/pyml/default.nix +++ b/pkgs/development/ocaml-modules/pyml/default.nix @@ -1,23 +1,37 @@ -{ stdenv, lib, fetchFromGitHub, ocaml, findlib, utop, python3, stdcompat, ncurses }: +{ buildDunePackage +, lib +, fetchFromGitHub +, fetchpatch +, utop +, python3 +, stdcompat +}: -stdenv.mkDerivation rec { +buildDunePackage rec { pname = "pyml"; - version = "20220615"; + version = "20220905"; src = fetchFromGitHub { - owner = "thierry-martinez"; - repo = pname; - rev = version; - sha256 = "sha256-my/xn9vrYTcHyjXGBNamgqpBz2/6bTyQHuE9ViVGLjw="; + owner = "thierry-martinez"; + repo = "pyml"; + rev = version; + sha256 = "PL4tFIKQLRutSn9Sf84/ImJv0DqkstNnJaNBqWDTKDQ="; }; - nativeBuildInputs = [ - ocaml - findlib + patches = [ + # Fixes test crash. + # https://github.com/thierry-martinez/pyml/issues/85 + (fetchpatch { + url = "https://github.com/thierry-martinez/pyml/commit/a0bc5aca8632bea273f869d622cad2f55e754a7c.patch"; + sha256 = "bOqAokm5DE5rlvkBMQZtwMppRmoK9cvjJeGeP6BusnE="; + excludes = [ + "CHANGES.md" + ]; + }) ]; + buildInputs = [ utop - ncurses ]; propagatedBuildInputs = [ @@ -25,24 +39,17 @@ stdenv.mkDerivation rec { stdcompat ]; + checkInputs = [ + python3.pkgs.numpy + ]; + strictDeps = true; - buildPhase = '' - make all pymltop pymlutop PREFIX=$out - ''; - - installPhase = '' - runHook preInstall - mkdir -p $out/bin - mkdir -p $OCAMLFIND_DESTDIR/stublibs - make install PREFIX=$out - runHook postInstall - ''; - doCheck = true; meta = { description = "OCaml bindings for Python"; + homepage = "https://github.com/thierry-martinez/pyml"; license = lib.licenses.bsd2; }; }