about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2021-01-06 08:11:28 +0100
committerVincent Laporte <vbgl@users.noreply.github.com>2021-01-13 09:49:20 +0100
commit0476529037a38b980d1600c3de0f922c9aebe98b (patch)
tree7d2e86dbcbbb93d97af88e075ffbee9153884477 /pkgs/development/ocaml-modules
parentc36b928f4fec702ff590c827048f519868cee9b9 (diff)
downloadnixlib-0476529037a38b980d1600c3de0f922c9aebe98b.tar
nixlib-0476529037a38b980d1600c3de0f922c9aebe98b.tar.gz
nixlib-0476529037a38b980d1600c3de0f922c9aebe98b.tar.bz2
nixlib-0476529037a38b980d1600c3de0f922c9aebe98b.tar.lz
nixlib-0476529037a38b980d1600c3de0f922c9aebe98b.tar.xz
nixlib-0476529037a38b980d1600c3de0f922c9aebe98b.tar.zst
nixlib-0476529037a38b980d1600c3de0f922c9aebe98b.zip
ocamlPackages.zed: refactor
Remove legacy version 1.4 (whose evaluation actually fails)

Refactor with `buildDunePackage`

Use dune 2
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/zed/default.nix44
1 files changed, 13 insertions, 31 deletions
diff --git a/pkgs/development/ocaml-modules/zed/default.nix b/pkgs/development/ocaml-modules/zed/default.nix
index 96342915862d..a7889523bcca 100644
--- a/pkgs/development/ocaml-modules/zed/default.nix
+++ b/pkgs/development/ocaml-modules/zed/default.nix
@@ -1,36 +1,19 @@
-{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild, camomile, react, dune, charInfo_width }:
+{ lib, buildDunePackage, fetchFromGitHub, camomile, react, charInfo_width }:
 
-let param =
-  if lib.versionAtLeast ocaml.version "4.02" then
-  {
-    version = "3.1.0";
-    sha256 = "04vr1a94imsghm98iigc35rhifsz0rh3qz2qm0wam2wvp6vmrx0p";
-    buildInputs = [ dune ];
-    propagatedBuildInputs = [ charInfo_width ];
-    extra = {
-     buildPhase = "dune build -p zed";
-     inherit (dune) installPhase; };
-  } else {
-    version = "1.4";
-    sha256 = "0d8qfy0qiydrrqi8qc9rcwgjigql6vx9gl4zp62jfz1lmjgb2a3w";
-    buildInputs = [ ocamlbuild ];
-    propagatedBuildInputs = [ camomile ];
-    extra = { createFindlibDestdir = true; };
-  }
-; in
+buildDunePackage rec {
+  pname = "zed";
+  version = "3.1.0";
 
-stdenv.mkDerivation (rec {
-  inherit (param) version;
-  name = "ocaml-zed-${version}";
+  useDune2 = true;
 
-  src = fetchzip {
-    url = "https://github.com/diml/zed/archive/${version}.tar.gz";
-    inherit (param) sha256;
+  src = fetchFromGitHub {
+    owner = "ocaml-community";
+    repo = pname;
+    rev = version;
+    sha256 = "04vr1a94imsghm98iigc35rhifsz0rh3qz2qm0wam2wvp6vmrx0p";
   };
 
-  buildInputs = [ ocaml findlib ] ++ param.buildInputs;
-
-  propagatedBuildInputs = [ react ] ++ param.propagatedBuildInputs;
+  propagatedBuildInputs = [ charInfo_width react ];
 
   meta = {
     description = "Abstract engine for text edition in OCaml";
@@ -41,11 +24,10 @@ stdenv.mkDerivation (rec {
 
     To support efficient text edition capabilities, Zed provides macro recording and cursor management facilities.
     '';
-    homepage = "https://github.com/diml/zed";
+    inherit (src.meta) homepage;
     license = lib.licenses.bsd3;
-    platforms = ocaml.meta.platforms or [];
     maintainers = [
       lib.maintainers.gal_bolle
     ];
   };
-} // param.extra)
+}