2015-07-28 16:30:40 +01:00
|
|
|
{stdenv, fetchzip, which, ocaml}:
|
2014-09-22 23:24:28 +01:00
|
|
|
|
2016-10-05 08:32:30 +01:00
|
|
|
assert stdenv.lib.versionAtLeast ocaml.version "4.02";
|
2014-09-22 23:24:28 +01:00
|
|
|
|
2016-10-05 08:32:30 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2015-07-28 16:30:40 +01:00
|
|
|
name = "camlp4-${version}";
|
2016-10-05 08:32:30 +01:00
|
|
|
version = "4.02+6";
|
|
|
|
|
2015-07-28 16:30:40 +01:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/ocaml/camlp4/archive/${version}.tar.gz";
|
|
|
|
sha256 = "06yl4q0qazl7g25b0axd1gdkfd4qpqzs1gr5fkvmkrcbz113h1hj";
|
2014-09-22 23:24:28 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ which ocaml ];
|
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
configureFlagsArray=(
|
|
|
|
--bindir=$out/bin
|
2016-10-05 08:32:30 +01:00
|
|
|
--libdir=$out/lib/ocaml/${ocaml.version}/site-lib
|
|
|
|
--pkgdir=$out/lib/ocaml/${ocaml.version}/site-lib
|
2014-09-22 23:24:28 +01:00
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace camlp4/META.in \
|
2016-10-05 08:32:30 +01:00
|
|
|
--replace +camlp4 $out/lib/ocaml/${ocaml.version}/site-lib/camlp4
|
2014-09-22 23:24:28 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
|
2014-11-09 01:45:42 +00:00
|
|
|
makeFlags = "all";
|
2014-09-22 23:24:28 +01:00
|
|
|
|
|
|
|
installTargets = "install install-META";
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A software system for writing extensible parsers for programming languages";
|
|
|
|
homepage = https://github.com/ocaml/camlp4;
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-09-22 23:24:28 +01:00
|
|
|
};
|
|
|
|
}
|