1{
2 lib,
3 fetchurl,
4 buildDunePackage,
5 ocaml,
6 qcheck,
7}:
8
9buildDunePackage rec {
10 pname = "stdint";
11 version = "0.7.2";
12
13 duneVersion = "3";
14
15 minimalOCamlVersion = "4.03";
16
17 src = fetchurl {
18 url = "https://github.com/andrenth/ocaml-stdint/releases/download/${version}/stdint-${version}.tbz";
19 sha256 = "sha256-FWAZjYvJx68+qVLEDavoJmZpQhDsw/35u/60MhHpd+Y=";
20 };
21
22 # 1. disable remaining broken tests, see
23 # https://github.com/andrenth/ocaml-stdint/issues/59
24 # 2. fix tests to liberal test range
25 # https://github.com/andrenth/ocaml-stdint/pull/61
26 postPatch = ''
27 substituteInPlace tests/stdint_test.ml \
28 --replace 'test "An integer should perform left-shifts correctly"' \
29 'skip "An integer should perform left-shifts correctly"' \
30 --replace 'test "Logical shifts must not sign-extend"' \
31 'skip "Logical shifts must not sign-extend"'
32 '';
33
34 doCheck = lib.versionAtLeast ocaml.version "4.08";
35 checkInputs = [ qcheck ];
36
37 meta = {
38 description = "Various signed and unsigned integers for OCaml";
39 homepage = "https://github.com/andrenth/ocaml-stdint";
40 license = lib.licenses.mit;
41 maintainers = [ ];
42 };
43}