summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/checkseum
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2019-10-29 06:31:14 +0000
committerVincent Laporte <vbgl@users.noreply.github.com>2019-11-05 07:13:09 +0000
commit8632698b067243c2693c0d050c0a58c8227f907f (patch)
tree12cd9212ec71c6ab93f84407a4fbd4c909e2c9c3 /pkgs/development/ocaml-modules/checkseum
parentc855dceacf55060540b89151dc8d1aadd118406c (diff)
downloadnixpkgs-8632698b067243c2693c0d050c0a58c8227f907f.tar
nixpkgs-8632698b067243c2693c0d050c0a58c8227f907f.tar.gz
nixpkgs-8632698b067243c2693c0d050c0a58c8227f907f.tar.bz2
nixpkgs-8632698b067243c2693c0d050c0a58c8227f907f.tar.lz
nixpkgs-8632698b067243c2693c0d050c0a58c8227f907f.tar.xz
nixpkgs-8632698b067243c2693c0d050c0a58c8227f907f.tar.zst
nixpkgs-8632698b067243c2693c0d050c0a58c8227f907f.zip
ocamlPackages.checkseum: 0.0.3 → 0.1.1
This fixes the “decompress” library on non-x86_64 platforms
Diffstat (limited to 'pkgs/development/ocaml-modules/checkseum')
-rw-r--r--pkgs/development/ocaml-modules/checkseum/default.nix45
1 files changed, 16 insertions, 29 deletions
diff --git a/pkgs/development/ocaml-modules/checkseum/default.nix b/pkgs/development/ocaml-modules/checkseum/default.nix
index 18e06d260f4..731dd476c5d 100644
--- a/pkgs/development/ocaml-modules/checkseum/default.nix
+++ b/pkgs/development/ocaml-modules/checkseum/default.nix
@@ -1,41 +1,28 @@
-{ stdenv, fetchurl, ocaml, findlib, dune, alcotest, cmdliner, fmt, optint, rresult }:
+{ lib, fetchurl, buildDunePackage
+, bigarray-compat, optint
+, cmdliner, fmt, rresult
+, alcotest
+}:
 
-if !stdenv.lib.versionAtLeast ocaml.version "4.03"
-then throw "checkseum is not available for OCaml ${ocaml.version}"
-else
+buildDunePackage rec {
+  version = "0.1.1";
+  pname = "checkseum";
 
-# The C implementation is not portable: x86 only
-let hasC = stdenv.isi686 || stdenv.isx86_64; in
-
-stdenv.mkDerivation rec {
-  version = "0.0.3";
-  name = "ocaml${ocaml.version}-checkseum-${version}";
   src = fetchurl {
-    url = "https://github.com/mirage/checkseum/releases/download/v0.0.3/checkseum-v0.0.3.tbz";
-    sha256 = "12j45zsvil1ynwx1x8fbddhqacc8r1zf7f6h576y3f3yvbg7l1fm";
+    url = "https://github.com/mirage/checkseum/releases/download/v${version}/checkseum-v${version}.tbz";
+    sha256 = "0aa2r1l65a5hcgciw6n8r5ij4gpgg0cf9k24isybxiaiz63k94d3";
   };
 
-  postPatch = stdenv.lib.optionalString (!hasC) ''
-    rm -r bin src-c
-  '';
-
-  buildInputs = [ ocaml findlib dune alcotest cmdliner fmt rresult ];
-  propagatedBuildInputs = [ optint ];
-
-  buildPhase = "dune build";
-
-  doCheck = hasC;
-  checkPhase = "dune runtest";
-
-  inherit (dune) installPhase;
+  buildInputs = [ cmdliner fmt rresult ];
+  propagatedBuildInputs = [ bigarray-compat optint ];
+  checkInputs = lib.optionals doCheck [ alcotest ];
 
-  passthru = { inherit hasC; };
+  doCheck = true;
 
   meta = {
     homepage = "https://github.com/mirage/checkseum";
     description = "ADLER-32 and CRC32C Cyclic Redundancy Check";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.vbgl ];
-    inherit (ocaml.meta) platforms;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
   };
 }