ocamlPackages.checkseum: 0.0.3 → 0.1.1
This fixes the “decompress” library on non-x86_64 platforms
This commit is contained in:
parent
c855dceacf
commit
8632698b06
@ -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"
|
buildDunePackage rec {
|
||||||
then throw "checkseum is not available for OCaml ${ocaml.version}"
|
version = "0.1.1";
|
||||||
else
|
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 {
|
src = fetchurl {
|
||||||
url = "https://github.com/mirage/checkseum/releases/download/v0.0.3/checkseum-v0.0.3.tbz";
|
url = "https://github.com/mirage/checkseum/releases/download/v${version}/checkseum-v${version}.tbz";
|
||||||
sha256 = "12j45zsvil1ynwx1x8fbddhqacc8r1zf7f6h576y3f3yvbg7l1fm";
|
sha256 = "0aa2r1l65a5hcgciw6n8r5ij4gpgg0cf9k24isybxiaiz63k94d3";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = stdenv.lib.optionalString (!hasC) ''
|
buildInputs = [ cmdliner fmt rresult ];
|
||||||
rm -r bin src-c
|
propagatedBuildInputs = [ bigarray-compat optint ];
|
||||||
'';
|
checkInputs = lib.optionals doCheck [ alcotest ];
|
||||||
|
|
||||||
buildInputs = [ ocaml findlib dune alcotest cmdliner fmt rresult ];
|
doCheck = true;
|
||||||
propagatedBuildInputs = [ optint ];
|
|
||||||
|
|
||||||
buildPhase = "dune build";
|
|
||||||
|
|
||||||
doCheck = hasC;
|
|
||||||
checkPhase = "dune runtest";
|
|
||||||
|
|
||||||
inherit (dune) installPhase;
|
|
||||||
|
|
||||||
passthru = { inherit hasC; };
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://github.com/mirage/checkseum";
|
homepage = "https://github.com/mirage/checkseum";
|
||||||
description = "ADLER-32 and CRC32C Cyclic Redundancy Check";
|
description = "ADLER-32 and CRC32C Cyclic Redundancy Check";
|
||||||
license = stdenv.lib.licenses.mit;
|
license = lib.licenses.mit;
|
||||||
maintainers = [ stdenv.lib.maintainers.vbgl ];
|
maintainers = [ lib.maintainers.vbgl ];
|
||||||
inherit (ocaml.meta) platforms;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,5 @@ buildDunePackage rec {
|
|||||||
license = lib.licenses.mit;
|
license = lib.licenses.mit;
|
||||||
maintainers = [ lib.maintainers.vbgl ];
|
maintainers = [ lib.maintainers.vbgl ];
|
||||||
homepage = "https://github.com/mirage/decompress";
|
homepage = "https://github.com/mirage/decompress";
|
||||||
broken = !checkseum.hasC;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user