2016-10-08 08:44:25 +02:00
|
|
|
{ version, sha256, stdenv, fetchurl, ocaml, findlib, ocamlbuild }:
|
2015-11-11 12:24:42 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "menhir-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://pauillac.inria.fr/~fpottier/menhir/menhir-${version}.tar.gz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2016-10-08 08:44:25 +02:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ];
|
2015-11-11 12:24:42 +01:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
preBuild = ''
|
2016-08-29 03:28:15 +02:00
|
|
|
# fix makefiles.
|
2015-11-11 12:24:42 +01:00
|
|
|
RM=$(type -p rm)
|
|
|
|
CHMOD=$(type -p chmod)
|
2016-08-29 03:28:15 +02:00
|
|
|
for f in src/Makefile demos/OMakefile* demos/Makefile*
|
2015-11-11 12:24:42 +01:00
|
|
|
do
|
|
|
|
substituteInPlace $f \
|
|
|
|
--replace /bin/rm $RM \
|
2016-08-29 03:28:15 +02:00
|
|
|
--replace /bin/chmod $CHMOD
|
2015-11-11 12:24:42 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
export PREFIX=$out
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://pauillac.inria.fr/~fpottier/menhir/;
|
|
|
|
description = "A LR(1) parser generator for OCaml";
|
|
|
|
longDescription = ''
|
|
|
|
Menhir is a LR(1) parser generator for the Objective Caml programming
|
|
|
|
language. That is, Menhir compiles LR(1) grammar specifications down
|
|
|
|
to OCaml code. Menhir was designed and implemented by François Pottier
|
|
|
|
and Yann Régis-Gianas.
|
|
|
|
'';
|
|
|
|
license = with licenses; [
|
2017-04-20 22:16:35 +02:00
|
|
|
(if versionAtLeast version "20170418" then gpl2 else qpl) /* generator */
|
2015-11-11 12:24:42 +01:00
|
|
|
lgpl2 /* library */
|
|
|
|
];
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2015-11-11 12:24:42 +01:00
|
|
|
maintainers = with maintainers; [ z77z ];
|
|
|
|
};
|
|
|
|
}
|