Adds camlp4
Camlp4 is a software system for writing extensible parsers for programming languages. Camlp4 was part of the official OCaml distribution until its version 4.01.0. Homepage: https://github.com/ocaml/camlp4
This commit is contained in:
46
pkgs/development/tools/ocaml/camlp4/default.nix
Normal file
46
pkgs/development/tools/ocaml/camlp4/default.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{stdenv, fetchurl, which, ocaml}:
|
||||
let
|
||||
ocaml_version = (stdenv.lib.getVersion ocaml);
|
||||
in
|
||||
|
||||
assert stdenv.lib.versionAtLeast ocaml_version "4.02";
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "camlp4-4.02.0+1";
|
||||
src = fetchurl {
|
||||
url = https://github.com/ocaml/camlp4/archive/4.02.0+1.tar.gz;
|
||||
sha256 = "0055f4jiz82rgn581xhq3mr4qgq2qgdxqppmp8i2x1xnsim4h9pn";
|
||||
};
|
||||
|
||||
buildInputs = [ which ocaml ];
|
||||
|
||||
dontAddPrefix = true;
|
||||
|
||||
preConfigure = ''
|
||||
configureFlagsArray=(
|
||||
--bindir=$out/bin
|
||||
--libdir=$out/lib/ocaml/${ocaml_version}/site-lib
|
||||
--pkgdir=$out/lib/ocaml/${ocaml_version}/site-lib
|
||||
)
|
||||
'';
|
||||
|
||||
postConfigure = ''
|
||||
substituteInPlace camlp4/META.in \
|
||||
--replace +camlp4 $out/lib/ocaml/${ocaml_version}/site-lib/camlp4
|
||||
substituteInPlace camlp4/config/Camlp4_config.ml \
|
||||
--replace \
|
||||
"Filename.concat ocaml_standard_library" \
|
||||
"Filename.concat \"$out/lib/ocaml/${ocaml_version}/site-lib\""
|
||||
'';
|
||||
|
||||
|
||||
makePhase = "make all";
|
||||
|
||||
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;
|
||||
platforms = ocaml.meta.platforms;
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{stdenv, fetchurl, ocaml, findlib, ounit}:
|
||||
{stdenv, fetchurl, ocaml, findlib}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "ocamlify-0.0.2";
|
||||
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
|
||||
sha256 = "1f0fghvlbfryf5h3j4as7vcqrgfjb4c8abl5y0y5h069vs4kp5ii";
|
||||
};
|
||||
|
||||
buildInputs = [ocaml findlib ounit];
|
||||
buildInputs = [ocaml findlib];
|
||||
|
||||
configurePhase = "ocaml setup.ml -configure --prefix $out";
|
||||
buildPhase = "ocaml setup.ml -build";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{stdenv, fetchurl, ocaml, findlib, ounit}:
|
||||
{stdenv, fetchurl, ocaml, findlib}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "ocamlmod-0.0.7";
|
||||
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
|
||||
sha256 = "11kg7wh0gy492ma5c6bcjh6frv1a9lh9f26hiys2i0d1ky8s0ad3";
|
||||
};
|
||||
|
||||
buildInputs = [ocaml findlib ounit];
|
||||
buildInputs = [ocaml findlib];
|
||||
|
||||
configurePhase = "ocaml setup.ml -configure --prefix $out";
|
||||
buildPhase = "ocaml setup.ml -build";
|
||||
|
||||
Reference in New Issue
Block a user