about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2018-02-22 17:30:56 +0000
committerVincent Laporte <vbgl@users.noreply.github.com>2018-02-27 08:28:27 +0100
commit629a2398db484227d23424604b96bfc61accc1ac (patch)
tree4982e53a452743e6363568087cb1b9bef90de467 /pkgs/development/ocaml-modules
parent19cc36d197182bf8bbbe8ad446072b2dfcd4f919 (diff)
downloadnixlib-629a2398db484227d23424604b96bfc61accc1ac.tar
nixlib-629a2398db484227d23424604b96bfc61accc1ac.tar.gz
nixlib-629a2398db484227d23424604b96bfc61accc1ac.tar.bz2
nixlib-629a2398db484227d23424604b96bfc61accc1ac.tar.lz
nixlib-629a2398db484227d23424604b96bfc61accc1ac.tar.xz
nixlib-629a2398db484227d23424604b96bfc61accc1ac.tar.zst
nixlib-629a2398db484227d23424604b96bfc61accc1ac.zip
ocamlPackages.angstrom: 0.5.1 -> 0.8.1
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r--pkgs/development/ocaml-modules/angstrom/default.nix34
1 files changed, 16 insertions, 18 deletions
diff --git a/pkgs/development/ocaml-modules/angstrom/default.nix b/pkgs/development/ocaml-modules/angstrom/default.nix
index c4ed5acbe1b6..154b4890e4fc 100644
--- a/pkgs/development/ocaml-modules/angstrom/default.nix
+++ b/pkgs/development/ocaml-modules/angstrom/default.nix
@@ -1,31 +1,29 @@
-{ stdenv, fetchFromGitHub, ocaml, ocamlbuild, cstruct, result, findlib }:
-
-let param =
-  if stdenv.lib.versionAtLeast ocaml.version "4.03"
-  then {
-    version = "0.5.1";
-    sha256 = "0rm79xyszy9aqvflcc13y9xiya82z31fzmr3b3hx91pmqviymhgc";
-  } else {
-    version = "0.4.0";
-    sha256 = "019s3jwhnswa914bgj1fa6q67k0bl2ahqdaqfnavcbyii8763kh2";
-  };
-in
+{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, alcotest, result }:
+
+if !stdenv.lib.versionAtLeast ocaml.version "4.03"
+then throw "angstrom is not available for OCaml ${ocaml.version}"
+else
 
 stdenv.mkDerivation rec {
-  inherit (param) version;
-  name = "ocaml-angstrom-${version}";
+  version = "0.8.1";
+  name = "ocaml${ocaml.version}-angstrom-${version}";
 
   src = fetchFromGitHub {
     owner  = "inhabitedtype";
     repo   = "angstrom";
     rev    = "${version}";
-    inherit (param) sha256;
+    sha256 = "067r3vy5lac1bfx947gy722amna3dbcak54nlh24vx87pmcq31qc";
   };
 
-  createFindlibDestdir = true;
+  buildInputs = [ ocaml findlib jbuilder alcotest ];
+  propagatedBuildInputs = [ result ];
+
+  buildPhase = "jbuilder build -p angstrom";
+
+  doCheck = true;
+  checkPhase = "jbuilder runtest -p angstrom";
 
-  buildInputs = [ ocaml findlib ocamlbuild ];
-  propagatedBuildInputs = [ result cstruct ];
+  inherit (jbuilder) installPhase;
 
   meta = {
     homepage = https://github.com/inhabitedtype/angstrom;