git.iko.soy/typeable/nixpkgs
on master help sign in
menhir: refactor to generic; init at 20151110 for OCaml >= 4.02
commit6cc033b99e607a753d274ce084095a2a7bfb82e8 authorVincent Laporte <Vincent.Laporte@gmail.com> dateWed 11 Nov 2015, 12:24 (11 years ago) parentcf55e0b
2 files changed+55−47
pkgs/development/ocaml-modules/menhir/default.nix+8−47 pkgs/development/ocaml-modules/menhir/generic.nix+47
pkgs/development/ocaml-modules/menhir/default.nix+8−47
@@ -1,51 +1,12 @@
1−{stdenv, fetchurl, ocaml, findlib}:
1+{ stdenv, fetchurl, ocaml, findlib
2+, version ? if stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.02" then "20151110" else "20140422"
3+}@args:
24
35let
4− ocaml_version = (builtins.parseDrvName ocaml.name).version;
6+ sha256 =
7+ if version == "20140422" then "1ki1f2id6a14h9xpv2k8yb6px7dyw8cvwh39csyzj4qpzx7wia0d"
8+ else if version == "20151110" then "12ijr1gd808f79d7k7ji9zg23xr4szayfgvm6njqamh0jnspq70r"
9+ else throw ("menhir: unknown version " ++ version);
510in
611
7−stdenv.mkDerivation {
8− name = "menhir-20140422";
9−
10− src = fetchurl {
11− url = http://pauillac.inria.fr/~fpottier/menhir/menhir-20140422.tar.gz;
12− sha256 = "1ki1f2id6a14h9xpv2k8yb6px7dyw8cvwh39csyzj4qpzx7wia0d";
13− };
14−
15− buildInputs = [ocaml findlib];
16−
17− createFindlibDestdir = true;
18−
19− preBuild = ''
20− #Fix makefiles.
21− RM=$(type -p rm)
22− CHMOD=$(type -p chmod)
23− ENV=$(type -p env)
24− for f in src/Makefile demos/OMakefile* demos/Makefile* demos/ocamldep.wrapper
25− do
26− substituteInPlace $f \
27− --replace /bin/rm $RM \
28− --replace /bin/chmod $CHMOD \
29− --replace /usr/bin/env $ENV
30− done
31−
32− export PREFIX=$out
33− '';
34−
35− meta = with stdenv.lib; {
36− homepage = http://pauillac.inria.fr/~fpottier/menhir/;
37− description = "A LR(1) parser generator for OCaml";
38− longDescription = ''
39− Menhir is a LR(1) parser generator for the Objective Caml programming
40− language. That is, Menhir compiles LR(1) grammar specifications down
41− to OCaml code. Menhir was designed and implemented by François Pottier
42− and Yann Régis-Gianas.
43− '';
44− license = with licenses; [
45− qpl /* generator */
46− lgpl2 /* library */
47− ];
48− platforms = ocaml.meta.platforms;
49− maintainers = with maintainers; [ z77z ];
50− };
51−}
12+import ./generic.nix (args // { inherit version sha256; })
pkgs/development/ocaml-modules/menhir/generic.nixnew file+47
@@ -0,0 +1,47 @@
1+{ version, sha256, stdenv, fetchurl, ocaml, findlib }:
2+
3+stdenv.mkDerivation {
4+ name = "menhir-${version}";
5+
6+ src = fetchurl {
7+ url = "http://pauillac.inria.fr/~fpottier/menhir/menhir-${version}.tar.gz";
8+ inherit sha256;
9+ };
10+
11+ buildInputs = [ ocaml findlib ];
12+
13+ createFindlibDestdir = true;
14+
15+ preBuild = ''
16+ #Fix makefiles.
17+ RM=$(type -p rm)
18+ CHMOD=$(type -p chmod)
19+ ENV=$(type -p env)
20+ for f in src/Makefile demos/OMakefile* demos/Makefile* demos/ocamldep.wrapper
21+ do
22+ substituteInPlace $f \
23+ --replace /bin/rm $RM \
24+ --replace /bin/chmod $CHMOD \
25+ --replace /usr/bin/env $ENV
26+ done
27+
28+ export PREFIX=$out
29+ '';
30+
31+ meta = with stdenv.lib; {
32+ homepage = http://pauillac.inria.fr/~fpottier/menhir/;
33+ description = "A LR(1) parser generator for OCaml";
34+ longDescription = ''
35+ Menhir is a LR(1) parser generator for the Objective Caml programming
36+ language. That is, Menhir compiles LR(1) grammar specifications down
37+ to OCaml code. Menhir was designed and implemented by François Pottier
38+ and Yann Régis-Gianas.
39+ '';
40+ license = with licenses; [
41+ qpl /* generator */
42+ lgpl2 /* library */
43+ ];
44+ platforms = ocaml.meta.platforms;
45+ maintainers = with maintainers; [ z77z ];
46+ };
47+}