2009-11-02 11:47:24 +01:00
|
|
|
{stdenv, fetchurl, ocaml, transitional ? false}:
|
|
|
|
|
|
|
|
let
|
2010-12-20 11:32:22 +01:00
|
|
|
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
2009-11-02 11:47:24 +01:00
|
|
|
pname = "camlp5";
|
2011-11-26 20:39:14 +01:00
|
|
|
version = "6.02.3";
|
2009-11-02 11:47:24 +01:00
|
|
|
webpage = http://pauillac.inria.fr/~ddr/camlp5/;
|
2010-12-20 11:32:22 +01:00
|
|
|
metafile = ./META;
|
2009-11-02 11:47:24 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
|
|
|
name = "${pname}${if transitional then "_transitional" else ""}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${webpage}/distrib/src/${pname}-${version}.tgz";
|
2011-11-26 20:39:14 +01:00
|
|
|
sha256 = "1z9bwh267117br0vlhirv9yy2niqp2n25zfnl14wg6kgg9bqx7rj";
|
2009-11-02 11:47:24 +01:00
|
|
|
};
|
|
|
|
|
2011-11-26 20:39:14 +01:00
|
|
|
patches = fetchurl {
|
|
|
|
url = "${webpage}/distrib/src/patch-${version}-1";
|
|
|
|
sha256 = "159qpvr07mnn72yqwx24c6mw7hs6bl77capsii7apg9dcxar8w7v";
|
|
|
|
};
|
|
|
|
|
|
|
|
patchFlags = "-p 0";
|
|
|
|
|
2009-11-02 11:47:24 +01:00
|
|
|
buildInputs = [ ocaml ];
|
|
|
|
|
|
|
|
prefixKey = "-prefix ";
|
|
|
|
|
2010-12-20 11:32:22 +01:00
|
|
|
preConfigure = "configureFlagsArray=(" + (if transitional then "--transitional" else "--strict") +
|
|
|
|
" --libdir $out/lib/ocaml/${ocaml_version}/site-lib)";
|
2009-11-02 11:47:24 +01:00
|
|
|
|
|
|
|
buildFlags = "world.opt";
|
|
|
|
|
2010-12-20 11:32:22 +01:00
|
|
|
postInstall = "cp ${metafile} $out/lib/ocaml/${ocaml_version}/site-lib/camlp5/META";
|
|
|
|
|
2009-11-02 11:47:24 +01:00
|
|
|
meta = {
|
2009-11-02 12:44:27 +01:00
|
|
|
description = "Preprocessor-pretty-printer for OCaml";
|
2009-11-02 11:47:24 +01:00
|
|
|
longDescription = ''
|
|
|
|
Camlp5 is a preprocessor and pretty-printer for OCaml programs.
|
|
|
|
It also provides parsing and printing tools.
|
|
|
|
'';
|
|
|
|
homepage = "${webpage}";
|
|
|
|
license = "BSD";
|
2010-12-20 11:32:22 +01:00
|
|
|
platforms = ocaml.meta.platforms;
|
|
|
|
maintainers = [
|
|
|
|
stdenv.lib.maintainers.z77z
|
|
|
|
];
|
2009-11-02 11:47:24 +01:00
|
|
|
};
|
|
|
|
}
|