2011-11-26 19:39:14 +00:00
|
|
|
{stdenv, fetchurl, ocaml, transitional ? false}:
|
|
|
|
|
|
|
|
let
|
|
|
|
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
|
|
|
pname = "camlp5";
|
|
|
|
version = "5.15";
|
|
|
|
webpage = http://pauillac.inria.fr/~ddr/camlp5/;
|
|
|
|
metafile = ./META;
|
|
|
|
in
|
|
|
|
|
2014-09-19 19:09:37 +01:00
|
|
|
assert !stdenv.lib.versionOlder "4.00" ocaml_version;
|
|
|
|
|
2011-11-26 19:39:14 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
|
|
|
name = "${pname}${if transitional then "_transitional" else ""}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${webpage}/distrib/src/${pname}-${version}.tgz";
|
|
|
|
sha256 = "1sx5wlfpydqskm97gp7887p3avbl3vanlmrwj35wx5mbzj6kn9nq";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ocaml ];
|
|
|
|
|
|
|
|
prefixKey = "-prefix ";
|
|
|
|
|
|
|
|
preConfigure = "configureFlagsArray=(" + (if transitional then "--transitional" else "--strict") +
|
|
|
|
" --libdir $out/lib/ocaml/${ocaml_version}/site-lib)";
|
|
|
|
|
|
|
|
buildFlags = "world.opt";
|
|
|
|
|
|
|
|
postInstall = "cp ${metafile} $out/lib/ocaml/${ocaml_version}/site-lib/camlp5/META";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Preprocessor-pretty-printer for OCaml";
|
|
|
|
longDescription = ''
|
|
|
|
Camlp5 is a preprocessor and pretty-printer for OCaml programs.
|
|
|
|
It also provides parsing and printing tools.
|
|
|
|
'';
|
|
|
|
homepage = "${webpage}";
|
2014-11-06 19:40:20 +00:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
|
|
|
branch = "5";
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2011-11-26 19:39:14 +00:00
|
|
|
maintainers = [
|
|
|
|
stdenv.lib.maintainers.z77z
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|