summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/menhir
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2021-05-29 15:50:56 +0200
committerVincent Laporte <vbgl@users.noreply.github.com>2021-06-05 13:38:01 +0200
commit5ca9831cb101a41192919d876d82b3640d389e50 (patch)
tree61939ea1cac995b8fdb7bfe4bec4494ae510fd65 /pkgs/development/ocaml-modules/menhir
parentc3d87595f101339701fcb63dc6cb962406597fbf (diff)
downloadnixpkgs-5ca9831cb101a41192919d876d82b3640d389e50.tar
nixpkgs-5ca9831cb101a41192919d876d82b3640d389e50.tar.gz
nixpkgs-5ca9831cb101a41192919d876d82b3640d389e50.tar.bz2
nixpkgs-5ca9831cb101a41192919d876d82b3640d389e50.tar.lz
nixpkgs-5ca9831cb101a41192919d876d82b3640d389e50.tar.xz
nixpkgs-5ca9831cb101a41192919d876d82b3640d389e50.tar.zst
nixpkgs-5ca9831cb101a41192919d876d82b3640d389e50.zip
ocamlPackages.menhir: 20190626 → 20210419
ocamlPackages.menhirLib: init at 20210419
ocamlPackages.menhirSdk: init at 20210419
Diffstat (limited to 'pkgs/development/ocaml-modules/menhir')
-rw-r--r--pkgs/development/ocaml-modules/menhir/default.nix30
-rw-r--r--pkgs/development/ocaml-modules/menhir/generic.nix43
-rw-r--r--pkgs/development/ocaml-modules/menhir/lib.nix29
-rw-r--r--pkgs/development/ocaml-modules/menhir/sdk.nix15
4 files changed, 59 insertions, 58 deletions
diff --git a/pkgs/development/ocaml-modules/menhir/default.nix b/pkgs/development/ocaml-modules/menhir/default.nix
index cbb759205e0..686cf982058 100644
--- a/pkgs/development/ocaml-modules/menhir/default.nix
+++ b/pkgs/development/ocaml-modules/menhir/default.nix
@@ -1,15 +1,15 @@
-{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild
-, version ? if lib.versionAtLeast (lib.getVersion ocaml) "4.02" then "20190626" else "20140422"
-}@args:
-
-let
-  src = fetchurl (
-  if version == "20140422" then { url = "http://cristal.inria.fr/~fpottier/menhir/menhir-20140422.tar.gz"; sha256 = "1ki1f2id6a14h9xpv2k8yb6px7dyw8cvwh39csyzj4qpzx7wia0d"; }
-  else if version == "20170712" then { url = "http://gallium.inria.fr/~fpottier/menhir/menhir-20170712.tar.gz"; sha256 = "006hq3bwj81j67f2k9cgzj5wr4hai8j36925p5n3sd2j01ljsj6a"; }
-  else if version == "20181113" then { url = "https://gitlab.inria.fr/fpottier/menhir/repository/20181113/archive.tar.gz"; sha256 = "0hl611l0gyl7b2bm7m0sk7vjz14m0i7znrnjq3gw58pylj934dx4"; }
-  else if version == "20190626" then { url = "https://gitlab.inria.fr/fpottier/menhir/repository/20190626/archive.tar.gz"; sha256 = "0nigjnskg89knyi2zj1w211mb1pvkrwfqpz9a0qbw80k3hm8gg0h"; }
-  else throw ("menhir: unknown version " ++ version)
-  );
-in
-
-import ./generic.nix (args // { inherit version src; })
+{ lib, fetchFromGitLab, buildDunePackage
+, menhirLib, menhirSdk
+}:
+
+buildDunePackage rec {
+  pname = "menhir";
+
+  inherit (menhirLib) version src useDune2;
+
+  buildInputs = [ menhirLib menhirSdk ];
+
+  meta = menhirSdk.meta // {
+    description = "A LR(1) parser generator for OCaml";
+  };
+}
diff --git a/pkgs/development/ocaml-modules/menhir/generic.nix b/pkgs/development/ocaml-modules/menhir/generic.nix
deleted file mode 100644
index a917d634a19..00000000000
--- a/pkgs/development/ocaml-modules/menhir/generic.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ version, src, lib, stdenv, ocaml, findlib, ocamlbuild, ... }:
-
-stdenv.mkDerivation {
-  pname = "menhir";
-  inherit version;
-
-  inherit src;
-
-  buildInputs = [ ocaml findlib ocamlbuild ];
-
-  createFindlibDestdir = true;
-
-  preBuild = ''
-    # fix makefiles.
-    RM=$(type -p rm)
-    CHMOD=$(type -p chmod)
-    for f in src/Makefile demos/OMakefile* demos/Makefile*
-    do
-      substituteInPlace $f \
-        --replace /bin/rm $RM \
-        --replace /bin/chmod $CHMOD
-    done
-
-    export PREFIX=$out
-  '';
-
-  meta = with 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; [
-      (if versionAtLeast version "20170418" then gpl2 else qpl) /* generator */
-      lgpl2 /* library */
-    ];
-    platforms = ocaml.meta.platforms or [];
-    maintainers = with maintainers; [ maggesi ];
-  };
-}
diff --git a/pkgs/development/ocaml-modules/menhir/lib.nix b/pkgs/development/ocaml-modules/menhir/lib.nix
new file mode 100644
index 00000000000..3f6660f23ee
--- /dev/null
+++ b/pkgs/development/ocaml-modules/menhir/lib.nix
@@ -0,0 +1,29 @@
+{ lib, fetchFromGitLab, buildDunePackage }:
+
+buildDunePackage rec {
+  pname = "menhirLib";
+  version = "20210419";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.inria.fr";
+    owner = "fpottier";
+    repo = "menhir";
+    rev = version;
+    sha256 = "0jcbr7s3iwfr7xxfybs3h407g76yfp5yq5r9i0wg2ahvvbqh03ky";
+  };
+
+  useDune2 = true;
+
+  meta = with lib; {
+    homepage = "http://pauillac.inria.fr/~fpottier/menhir/";
+    description = "Runtime support library for parsers generated by Menhir";
+    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; [ lgpl2Only ];
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/pkgs/development/ocaml-modules/menhir/sdk.nix b/pkgs/development/ocaml-modules/menhir/sdk.nix
new file mode 100644
index 00000000000..0e60849494c
--- /dev/null
+++ b/pkgs/development/ocaml-modules/menhir/sdk.nix
@@ -0,0 +1,15 @@
+{ lib, fetchFromGitLab, buildDunePackage
+, menhirLib
+}:
+
+buildDunePackage rec {
+  pname = "menhirSdk";
+
+  inherit (menhirLib) version src useDune2;
+
+  meta = menhirLib.meta // {
+    description = "Compile-time library for auxiliary tools related to Menhir";
+    license = with lib.licenses; [ gpl2Only ];
+  };
+}
+