summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/stdint
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
committerAlyssa Ross <hi@alyssa.is>2021-08-04 10:43:07 +0000
commit62614cbef7da005c1eda8c9400160f6bcd6546b8 (patch)
treec2630f69080637987b68acb1ee8676d2681fe304 /pkgs/development/ocaml-modules/stdint
parentd9c82ed3044c72cecf01c6ea042489d30914577c (diff)
parente24069138dfec3ef94f211f1da005bb5395adc11 (diff)
downloadnixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.gz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.bz2
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.lz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.xz
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.tar.zst
nixpkgs-62614cbef7da005c1eda8c9400160f6bcd6546b8.zip
Merge branch 'nixpkgs-update' into master
Diffstat (limited to 'pkgs/development/ocaml-modules/stdint')
-rw-r--r--pkgs/development/ocaml-modules/stdint/default.nix41
1 files changed, 33 insertions, 8 deletions
diff --git a/pkgs/development/ocaml-modules/stdint/default.nix b/pkgs/development/ocaml-modules/stdint/default.nix
index bffef61956e..52d97e12998 100644
--- a/pkgs/development/ocaml-modules/stdint/default.nix
+++ b/pkgs/development/ocaml-modules/stdint/default.nix
@@ -1,18 +1,43 @@
-{ lib, fetchFromGitHub, buildDunePackage }:
+{ lib, fetchurl, fetchpatch, buildDunePackage, qcheck }:
 
 buildDunePackage rec {
   pname = "stdint";
-  version = "0.6.0";
+  version = "0.7.0";
 
-  minimumOCamlVersion = "4.07";
+  useDune2 = true;
 
-  src = fetchFromGitHub {
-    owner = "andrenth";
-    repo = "ocaml-stdint";
-    rev = version;
-    sha256 = "19ccxs0vij81vyc9nqc9kbr154ralb9dgc2y2nr71a5xkx6xfn0y";
+  minimumOCamlVersion = "4.03";
+
+  src = fetchurl {
+    url = "https://github.com/andrenth/ocaml-stdint/releases/download/${version}/stdint-${version}.tbz";
+    sha256 = "4fcc66aef58e2b96e7af3bbca9d910aa239e045ba5fb2400aaef67d0041252dc";
   };
 
+  patches = [
+    # fix test bug, remove at next release
+    (fetchpatch {
+      url = "https://github.com/andrenth/ocaml-stdint/commit/fc64293f99f597cdfd4470954da6fb323988e2af.patch";
+      sha256 = "0nxck14vfjfzldsf8cdj2jg1cvhnyh37hqnrcxbdkqmpx4rxkbxs";
+    })
+  ];
+
+  # 1. disable remaining broken tests, see
+  #    https://github.com/andrenth/ocaml-stdint/issues/59
+  # 2. fix tests to liberal test range
+  #    https://github.com/andrenth/ocaml-stdint/pull/61
+  postPatch = ''
+    substituteInPlace tests/stdint_test.ml \
+      --replace 'test "An integer should perform left-shifts correctly"' \
+                'skip "An integer should perform left-shifts correctly"' \
+      --replace 'test "Logical shifts must not sign-extend"' \
+                'skip "Logical shifts must not sign-extend"' \
+      --replace 'let pos_int = QCheck.map_same_type abs in_range' \
+                'let pos_int = QCheck.int_range 0 maxi'
+  '';
+
+  doCheck = true;
+  checkInputs = [ qcheck ];
+
   meta = {
     description = "Various signed and unsigned integers for OCaml";
     homepage = "https://github.com/andrenth/ocaml-stdint";