summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/ppxlib/default.nix
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2020-12-08 21:50:04 +0100
committerVincent Laporte <vbgl@users.noreply.github.com>2020-12-18 21:03:56 +0100
commit6a7f79ed839a76cee8323d1a353d5828a8494f93 (patch)
treeb7433b57fde0698a8a53a3c5cc6c4021cd4f50b3 /pkgs/development/ocaml-modules/ppxlib/default.nix
parent8274fec3507d55c99070fecf0d4a8b3db0a974f9 (diff)
downloadnixpkgs-6a7f79ed839a76cee8323d1a353d5828a8494f93.tar
nixpkgs-6a7f79ed839a76cee8323d1a353d5828a8494f93.tar.gz
nixpkgs-6a7f79ed839a76cee8323d1a353d5828a8494f93.tar.bz2
nixpkgs-6a7f79ed839a76cee8323d1a353d5828a8494f93.tar.lz
nixpkgs-6a7f79ed839a76cee8323d1a353d5828a8494f93.tar.xz
nixpkgs-6a7f79ed839a76cee8323d1a353d5828a8494f93.tar.zst
nixpkgs-6a7f79ed839a76cee8323d1a353d5828a8494f93.zip
ocamlPackages.ppxlib: 0.12.0 → 0.13.0
Also refactor to ease selection of a custom version
Diffstat (limited to 'pkgs/development/ocaml-modules/ppxlib/default.nix')
-rw-r--r--pkgs/development/ocaml-modules/ppxlib/default.nix24
1 files changed, 14 insertions, 10 deletions
diff --git a/pkgs/development/ocaml-modules/ppxlib/default.nix b/pkgs/development/ocaml-modules/ppxlib/default.nix
index 8821e562129..7b1e25a8f9b 100644
--- a/pkgs/development/ocaml-modules/ppxlib/default.nix
+++ b/pkgs/development/ocaml-modules/ppxlib/default.nix
@@ -1,24 +1,28 @@
 { lib, fetchFromGitHub, buildDunePackage, ocaml
-, legacy ? false
+, version ? "0.13.0"
 , ocaml-compiler-libs, ocaml-migrate-parsetree, ppx_derivers, stdio
 }:
 
-let param =
-  if legacy then {
-    version = "0.8.1";
+let param = {
+  "0.8.1" = {
     sha256 = "0vm0jajmg8135scbg0x60ivyy5gzv4abwnl7zls2mrw23ac6kml6";
-  } else {
-    version = "0.12.0";
-    sha256 = "1cg0is23c05k1rc94zcdz452p9zn11dpqxm1pnifwx5iygz3w0a1";
-  }; in
+    max_version = "4.10";
+  };
+  "0.13.0" = {
+    sha256 = "0c54g22pm6lhfh3f7s5wbah8y48lr5lj3cqsbvgi99bly1b5vqvl";
+  };
+}."${version}"; in
 
-if lib.versionAtLeast ocaml.version "4.10" && legacy
+if param ? max_version && lib.versionAtLeast ocaml.version param.max_version
+|| param ? min_version && !lib.versionAtLeast ocaml.version param.min_version
 then throw "ppxlib-${param.version} is not available for OCaml ${ocaml.version}"
 else
 
 buildDunePackage rec {
   pname = "ppxlib";
-  inherit (param) version;
+  inherit version;
+
+  useDune2 = param.useDune2 or false;
 
   src = fetchFromGitHub {
     owner = "ocaml-ppx";