nixpkgs/pkgs/development/ocaml-modules/pycaml/default.nix
Arie Middelkoop c87285c255 Updated the coccinelle package to the latest release (1.0.0-RC9).
Added additional ocaml modules which are needed for coccinelle.

svn path=/nixpkgs/trunk/; revision=31579
2012-01-16 10:20:13 +00:00

52 lines
1.7 KiB
Nix

{stdenv, fetchurl, ocaml, findlib, python, ocaml_make}:
# The actual version of pycaml is unclear, as it is the original
# 0.82 version with some patches applied in order to use it for
# the kompostilo type setter (see README). Apparently, some of
# the patches provide Python 3.1 support.
# This version also differs from the Debian version, which
# is also a heavily patched 0.82.
# Therefore, we may at some point try to find out what is
# actually the "real" version (if the library is still alive).
stdenv.mkDerivation {
name = "pycaml-0.82";
src = fetchurl {
name = "pycaml.tar.gz";
url = "http://github.com/chemoelectric/pycaml/tarball/master";
sha256 = "ff6d863c42b4ef798f50ff5eff77b47b77b5c0d28b6f65364e8a436a216dc591";
};
buildInputs = [ocaml findlib python];
createFindlibDestdir = true;
phases = [ "unpackPhase" "patchPhase" "buildPhase" "installPhase" ];
# fix some paths to the appropriate store paths.
patchPhase = ''
sed -i "Makefile" -e's|/usr/include/OCamlMakefile|${ocaml_make}|g'
sed -i "Makefile" -e's|/usr|${python}|g'
'';
buildPhase = ''
make -f Makefile -j1 PYVER=`python -c 'import sys; print("{0}.{1}".format(sys.version_info.major, sys.version_info.minor));'`
'';
# the Makefile is not shipped with an install target, hence we do it ourselves.
installPhase = ''
ocamlfind install pycaml \
dllpycaml_stubs.so* libpycaml_stubs.a pycaml.a pycaml.cma \
pycaml.cmi pycaml.cmo pycaml.cmx pycaml.cmxa pycaml.ml pycaml.mli \
pycaml.o pycaml_stubs.c pycaml_stubs.h pycaml_stubs.o META
'';
meta = {
homepage = "http://github.com/chemoelectric/pycaml";
description = "Bindings for python and ocaml";
license = "LGPL";
platforms = ocaml.meta.platforms;
};
}