Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / ocaml-modules / pycaml / default.nix
blob1aa2590f2ae5f06eb61f5f84752ba261db057832
1 {stdenv, fetchurl, ocaml, findlib, ncurses, python, ocaml_make}:
3 # This is the original pycaml version with patches from debian.
5 stdenv.mkDerivation {
6   name = "pycaml-0.82-14";
8   srcs = [
9     (fetchurl {
10       url = "mirror://debian/pool/main/p/pycaml/pycaml_0.82.orig.tar.gz";
11       sha256 = "d57be559c8d586c575717d47817986bbdbcebe2ffd16ad6b291525c62868babe";
12     })
14     (fetchurl {
15       url = "mirror://debian/pool/main/p/pycaml/pycaml_0.82-14.debian.tar.gz";
16       sha256 = "a763088ec1fa76c769bf586ed6692e7ac035b0a2bfd48a90a8e7a9539ec0c2f1";
17     })
18   ];
20   postPatch = ''
21     rm -f Makefile* configure*
22     cp ../debian/META ../debian/Makefile .
23     sed -i "Makefile" -e's|/usr/share/ocamlmakefile/OCamlMakefile|${ocaml_make}/include/OCamlMakefile|g'
24   '';
26   sourceRoot = "pycaml";
27   patches = [ "../debian/patches/*.patch" ];
29   buildInputs = [ ncurses ocaml findlib python ocaml_make ];
30   createFindlibDestdir = true;
32   # the Makefile is not shipped with an install target, hence we do it ourselves.
33   installPhase = ''
34     ocamlfind install pycaml \
35      dllpycaml_stubs.so libpycaml_stubs.a pycaml.a pycaml.cma \
36      pycaml.cmi pycaml.cmo pycaml.cmx pycaml.cmxa \
37      META
38   '';
40   meta = {
41     homepage = "https://github.com/chemoelectric/pycaml";
42     description = "Bindings for python and ocaml";
43     license = "LGPL";
44     platforms = ocaml.meta.platforms or [];
45   };