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