3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/ocaml-modules/torch/default.nix

55 lines
929 B
Nix
Raw Normal View History

2020-06-24 08:52:44 +01:00
{ lib
2020-01-31 20:30:02 +00:00
, buildDunePackage
, fetchFromGitHub
, cmdliner
, ctypes
, npy
, ocaml-compiler-libs
, ppx_custom_printf
, ppx_expect
, ppx_sexp_conv
, sexplib
, stdio
, pytorch
}:
buildDunePackage rec {
pname = "torch";
2020-06-24 08:52:44 +01:00
version = "0.9b";
2020-01-31 20:30:02 +00:00
minimumOCamlVersion = "4.07";
src = fetchFromGitHub {
2020-06-24 08:52:44 +01:00
owner = "LaurentMazare";
2020-01-31 20:30:02 +00:00
repo = "ocaml-${pname}";
rev = version;
2020-06-24 08:52:44 +01:00
sha256 = "1xn8zfs3viz80agckcpl9a4vjbq6j5g280i95jyy5s0zbcnajpnm";
2020-01-31 20:30:02 +00:00
};
propagatedBuildInputs = [
cmdliner
ctypes
npy
ocaml-compiler-libs
pytorch
pytorch.dev
ppx_custom_printf
ppx_expect
ppx_sexp_conv
sexplib
stdio
];
preBuild = ''export LIBTORCH=${pytorch.dev}/'';
doCheck = true;
checkPhase = "dune runtest";
2020-06-24 08:52:44 +01:00
meta = with lib; {
2020-01-31 20:30:02 +00:00
inherit (src.meta) homepage;
description = "Ocaml bindings to Pytorch";
maintainers = [ maintainers.bcdarwin ];
license = licenses.asl20;
};
}