ocamlPackages.cstruct: 5.0.0 → 6.0.0

This commit is contained in:
sternenseemann 2020-10-25 19:54:25 +01:00 committed by Vincent Laporte
parent 99bb24459d
commit 6a27377958
5 changed files with 35 additions and 10 deletions

View file

@ -1,8 +1,8 @@
{ lib, fetchurl, buildDunePackage, bigarray-compat }:
{ lib, fetchurl, buildDunePackage, bigarray-compat, alcotest, ocaml }:
buildDunePackage rec {
pname = "cstruct";
version = "5.0.0";
version = "6.0.0";
useDune2 = true;
@ -10,11 +10,15 @@ buildDunePackage rec {
src = fetchurl {
url = "https://github.com/mirage/ocaml-cstruct/releases/download/v${version}/cstruct-v${version}.tbz";
sha256 = "1z403q2nkgz5x07j0ypy6q0mk2yxgqbp1jlqkngbajna7124x2pb";
sha256 = "0xi6cj85z033fqrqdkwac6gg07629vzdhx03c3lhiwwc4lpnv8bq";
};
propagatedBuildInputs = [ bigarray-compat ];
# alcotest isn't available for OCaml < 4.05 due to fmt
doCheck = lib.versionAtLeast ocaml.version "4.05";
checkInputs = [ alcotest ];
meta = {
description = "Access C-like structures directly from OCaml";
license = lib.licenses.isc;

View file

@ -8,7 +8,7 @@ buildDunePackage {
pname = "cstruct-lwt";
inherit (cstruct) version src useDune2 meta;
minimumOCamlVersion = "4.02";
minimumOCamlVersion = "4.03";
propagatedBuildInputs = [ cstruct lwt ];
}

View file

@ -1,4 +1,7 @@
{ lib, buildDunePackage, cstruct, sexplib, ppx_tools_versioned, ppxlib }:
{ lib, buildDunePackage, cstruct, sexplib, ppxlib, stdlib-shims
, ounit, cppo, ppx_sexp_conv, cstruct-unix, cstruct-sexp
, fetchpatch
}:
if !lib.versionAtLeast (cstruct.version or "1") "3"
then cstruct
@ -8,7 +11,22 @@ buildDunePackage {
pname = "ppx_cstruct";
inherit (cstruct) version src useDune2 meta;
minimumOCamlVersion = "4.03";
minimumOCamlVersion = "4.07";
propagatedBuildInputs = [ cstruct ppx_tools_versioned ppxlib sexplib ];
# prevent ANSI escape sequences from messing up the test cases
# https://github.com/mirage/ocaml-cstruct/issues/283
patches = [
(fetchpatch {
url = "https://github.com/mirage/ocaml-cstruct/pull/285/commits/60dfed98b4c34455bf339ac60e2ed5ef05feb48f.patch";
sha256 = "1x9i62nrlfy9l44vb0a7qjfrg2wyki4c8nmmqnzwpcbkgxi3q6n5";
})
];
propagatedBuildInputs = [ cstruct ppxlib sexplib stdlib-shims ];
# disable until ppx_sexp_conv uses ppxlib 0.20.0 (or >= 0.16.0)
# since the propagation of the older ppxlib breaks the ppx_cstruct
# build.
doCheck = false;
checkInputs = [ ounit cppo ppx_sexp_conv cstruct-sexp cstruct-unix ];
}

View file

@ -8,8 +8,11 @@ buildDunePackage rec {
pname = "cstruct-sexp";
inherit (cstruct) version src useDune2 meta;
doCheck = lib.versionAtLeast ocaml.version "4.03";
checkInputs = lib.optional doCheck alcotest;
minimumOCamlVersion = "4.03";
# alcotest is only available on OCaml >= 4.05 due to fmt
doCheck = lib.versionAtLeast ocaml.version "4.05";
checkInputs = [ alcotest ];
propagatedBuildInputs = [ cstruct sexplib ];
}

View file

@ -975,7 +975,7 @@ let
ppx_blob = callPackage ../development/ocaml-modules/ppx_blob { };
ppx_cstruct = callPackage ../development/ocaml-modules/cstruct/ppx.nix {};
ppx_cstruct = callPackage ../development/ocaml-modules/cstruct/ppx.nix { };
ppx_derivers = callPackage ../development/ocaml-modules/ppx_derivers {};