2016-10-08 07:44:25 +01:00
|
|
|
{ version, sha256, stdenv, fetchurl, ocaml, findlib, ocamlbuild }:
|
2015-11-11 11:24:42 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "menhir-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://pauillac.inria.fr/~fpottier/menhir/menhir-${version}.tar.gz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2016-10-08 07:44:25 +01:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ];
|
2015-11-11 11:24:42 +00:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
preBuild = ''
|
2016-08-29 02:28:15 +01:00
|
|
|
# fix makefiles.
|
2015-11-11 11:24:42 +00:00
|
|
|
RM=$(type -p rm)
|
|
|
|
CHMOD=$(type -p chmod)
|
2016-08-29 02:28:15 +01:00
|
|
|
for f in src/Makefile demos/OMakefile* demos/Makefile*
|
2015-11-11 11:24:42 +00:00
|
|
|
do
|
|
|
|
substituteInPlace $f \
|
|
|
|
--replace /bin/rm $RM \
|
2016-08-29 02:28:15 +01:00
|
|
|
--replace /bin/chmod $CHMOD
|
2015-11-11 11:24:42 +00: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 21:16:35 +01:00
|
|
|
(if versionAtLeast version "20170418" then gpl2 else qpl) /* generator */
|
2015-11-11 11:24:42 +00:00
|
|
|
lgpl2 /* library */
|
|
|
|
];
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2015-11-11 11:24:42 +00:00
|
|
|
maintainers = with maintainers; [ z77z ];
|
|
|
|
};
|
|
|
|
}
|