Skip to content

Commit

Permalink
ocamlPackages.zed: refactor
Browse files Browse the repository at this point in the history
Remove legacy version 1.4 (whose evaluation actually fails)

Refactor with `buildDunePackage`

Use dune 2
  • Loading branch information
vbgl committed Jan 13, 2021
1 parent c36b928 commit 0476529
Showing 1 changed file with 13 additions and 31 deletions.
44 changes: 13 additions & 31 deletions 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";
Expand All @@ -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)
}

0 comments on commit 0476529

Please sign in to comment.