Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 31 additions & 24 deletions pkgs/development/ocaml-modules/pyml/default.nix
Original file line number Diff line number Diff line change
@@ -1,48 +1,55 @@
{ stdenv, lib, fetchFromGitHub, ocaml, findlib, utop, python3, stdcompat, ncurses }:

stdenv.mkDerivation rec {
{ buildDunePackage
, lib
, fetchFromGitHub
, fetchpatch
, utop
, python3
, stdcompat
}:

buildDunePackage rec {
pname = "pyml";
Comment thread
jtojnar marked this conversation as resolved.
Outdated
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 = [
python3
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;
};
}
22 changes: 9 additions & 13 deletions pkgs/development/ocaml-modules/stdcompat/default.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}