summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2020-10-25 19:54:25 +0100
committerVincent Laporte <vbgl@users.noreply.github.com>2021-02-01 16:11:29 +0100
commit6a27377958acc3f036843eced9332bee7ef46995 (patch)
tree63aca467da5963ef3442dcbd47ad99a4bf0a9525
parent99bb24459d1f0c3a9ec6bcfdbd3ecaa8dd624f3e (diff)
ocamlPackages.cstruct: 5.0.0 → 6.0.0
-rw-r--r--pkgs/development/ocaml-modules/cstruct/default.nix10
-rw-r--r--pkgs/development/ocaml-modules/cstruct/lwt.nix2
-rw-r--r--pkgs/development/ocaml-modules/cstruct/ppx.nix24
-rw-r--r--pkgs/development/ocaml-modules/cstruct/sexp.nix7
-rw-r--r--pkgs/top-level/ocaml-packages.nix2
5 files changed, 35 insertions, 10 deletions
diff --git a/pkgs/development/ocaml-modules/cstruct/default.nix b/pkgs/development/ocaml-modules/cstruct/default.nix
index acd5d83e4f1e..8b0c4ee9ebbc 100644
--- a/pkgs/development/ocaml-modules/cstruct/default.nix
+++ b/pkgs/development/ocaml-modules/cstruct/default.nix
@@ -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;
diff --git a/pkgs/development/ocaml-modules/cstruct/lwt.nix b/pkgs/development/ocaml-modules/cstruct/lwt.nix
index 113df1e89b5c..df8941d1260d 100644
--- a/pkgs/development/ocaml-modules/cstruct/lwt.nix
+++ b/pkgs/development/ocaml-modules/cstruct/lwt.nix
@@ -8,7 +8,7 @@ buildDunePackage {
pname = "cstruct-lwt";
inherit (cstruct) version src useDune2 meta;
- minimumOCamlVersion = "4.02";
+ minimumOCamlVersion = "4.03";
propagatedBuildInputs = [ cstruct lwt ];
}
diff --git a/pkgs/development/ocaml-modules/cstruct/ppx.nix b/pkgs/development/ocaml-modules/cstruct/ppx.nix
index 44343812090d..aa003295e908 100644
--- a/pkgs/development/ocaml-modules/cstruct/ppx.nix
+++ b/pkgs/development/ocaml-modules/cstruct/ppx.nix
@@ -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 ];
}
diff --git a/pkgs/development/ocaml-modules/cstruct/sexp.nix b/pkgs/development/ocaml-modules/cstruct/sexp.nix
index 742cb6522ebf..b04810e48038 100644
--- a/pkgs/development/ocaml-modules/cstruct/sexp.nix
+++ b/pkgs/development/ocaml-modules/cstruct/sexp.nix
@@ -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 ];
}
diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix
index f7c57305992e..4e78891b5e25 100644
--- a/pkgs/top-level/ocaml-packages.nix
+++ b/pkgs/top-level/ocaml-packages.nix
@@ -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 {};