From 75ef7c1f8ea7cf5a4efc59dd279f8f25edf289f0 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 22 Oct 2022 10:28:41 +0200 Subject: [PATCH 1/2] =?UTF-8?q?ocamlPackages.stdcompat:=2018=20=E2=86=92?= =?UTF-8?q?=2019?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/thierry-martinez/stdcompat/releases/tag/v19 --- .../ocaml-modules/stdcompat/default.nix | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/pkgs/development/ocaml-modules/stdcompat/default.nix b/pkgs/development/ocaml-modules/stdcompat/default.nix index 3630be368e556..b8dcc81bfe7ee 100644 --- a/pkgs/development/ocaml-modules/stdcompat/default.nix +++ b/pkgs/development/ocaml-modules/stdcompat/default.nix @@ -1,29 +1,25 @@ -{ stdenv, lib, fetchurl -, ocaml, findlib +{ buildDunePackage +, lib +, fetchurl }: -stdenv.mkDerivation rec { - pname = "ocaml${ocaml.version}-stdcompat"; - version = "18"; +buildDunePackage rec { + pname = "stdcompat"; + version = "19"; src = fetchurl { url = "https://github.com/thierry-martinez/stdcompat/releases/download/v${version}/stdcompat-${version}.tar.gz"; - sha256 = "sha256:01y67rndjlzfp5zq0gbqpg9skqq2hfbvhbq9lfhhk5xidr98sfj8"; + sha256 = "sha256-DKQGd4nnIN6SPls6hcA/2Jvc7ivYNpeMU6rYsVc1ClU="; }; - nativeBuildInputs = [ ocaml findlib ]; - strictDeps = true; - # build fails otherwise - enableParallelBuilding = false; - - configureFlags = [ "--libdir=$(OCAMLFIND_DESTDIR)" ]; + # Otherwise ./configure script will run and create files conflicting with dune. + dontConfigure = true; meta = { homepage = "https://github.com/thierry-martinez/stdcompat"; license = lib.licenses.bsd2; maintainers = [ lib.maintainers.vbgl ]; - inherit (ocaml.meta) platforms; }; } From a028e1dc9634ce1385229cada97af27d524ff3b3 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 22 Oct 2022 10:26:42 +0200 Subject: [PATCH 2/2] =?UTF-8?q?ocamlPackages.pyml:=2020220615=20=E2=86=92?= =?UTF-8?q?=2020220905?= 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 | 55 +++++++++++-------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/pkgs/development/ocaml-modules/pyml/default.nix b/pkgs/development/ocaml-modules/pyml/default.nix index 97fcf1d5caa49..9eba3ab3185b1 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 }: - -stdenv.mkDerivation rec { +{ buildDunePackage +, lib +, fetchFromGitHub +, fetchpatch +, utop +, python3 +, stdcompat +}: + +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 ]; - strictDeps = true; - - buildPhase = '' - make all pymltop pymlutop PREFIX=$out - ''; + checkInputs = [ + python3.pkgs.numpy + ]; - installPhase = '' - runHook preInstall - mkdir -p $out/bin - mkdir -p $OCAMLFIND_DESTDIR/stublibs - make install PREFIX=$out - runHook postInstall - ''; + strictDeps = true; doCheck = true; meta = { description = "OCaml bindings for Python"; + homepage = "https://github.com/thierry-martinez/pyml"; license = lib.licenses.bsd2; }; }