2016-10-08 08:45:59 +02:00
|
|
|
{ stdenv, fetchzip, which, ocaml, ocamlbuild }:
|
|
|
|
|
|
|
|
let param = {
|
|
|
|
"4.02.3" = {
|
|
|
|
version = "4.02+6";
|
|
|
|
sha256 = "06yl4q0qazl7g25b0axd1gdkfd4qpqzs1gr5fkvmkrcbz113h1hj"; };
|
|
|
|
"4.03.0" = {
|
|
|
|
version = "4.03+1";
|
|
|
|
sha256 = "1f2ndch6f1m4fgnxsjb94qbpwjnjgdlya6pard44y6n0dqxi1wsq"; };
|
2016-11-09 14:00:43 +01:00
|
|
|
"4.04.0" = {
|
|
|
|
version = "4.04+1";
|
|
|
|
sha256 = "1ad7rygqjxrc1im95gw9lp8q83nhdaf383f2808f1p63yl42xm7k"; };
|
2016-10-08 08:45:59 +02:00
|
|
|
}."${ocaml.version}";
|
|
|
|
in
|
2014-09-23 00:24:28 +02:00
|
|
|
|
2016-10-05 09:32:30 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2015-07-28 17:30:40 +02:00
|
|
|
name = "camlp4-${version}";
|
2016-10-08 08:45:59 +02:00
|
|
|
inherit (param) version;
|
2016-10-05 09:32:30 +02:00
|
|
|
|
2015-07-28 17:30:40 +02:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/ocaml/camlp4/archive/${version}.tar.gz";
|
2016-10-08 08:45:59 +02:00
|
|
|
inherit (param) sha256;
|
2014-09-23 00:24:28 +02:00
|
|
|
};
|
|
|
|
|
2016-10-08 08:45:59 +02:00
|
|
|
buildInputs = [ which ocaml ocamlbuild ];
|
2014-09-23 00:24:28 +02:00
|
|
|
|
|
|
|
dontAddPrefix = true;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
configureFlagsArray=(
|
|
|
|
--bindir=$out/bin
|
2016-10-05 09:32:30 +02:00
|
|
|
--libdir=$out/lib/ocaml/${ocaml.version}/site-lib
|
|
|
|
--pkgdir=$out/lib/ocaml/${ocaml.version}/site-lib
|
2014-09-23 00:24:28 +02:00
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
substituteInPlace camlp4/META.in \
|
2016-10-05 09:32:30 +02:00
|
|
|
--replace +camlp4 $out/lib/ocaml/${ocaml.version}/site-lib/camlp4
|
2014-09-23 00:24:28 +02:00
|
|
|
'';
|
|
|
|
|
2014-11-09 02:45:42 +01:00
|
|
|
makeFlags = "all";
|
2014-09-23 00:24:28 +02: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 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-09-23 00:24:28 +02:00
|
|
|
};
|
|
|
|
}
|