2022-11-04 12:27:35 +00:00
|
|
|
{ lib, fetchurl, buildDunePackage, ocaml, qcheck }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildDunePackage rec {
|
|
|
|
pname = "stdint";
|
2022-11-04 12:27:35 +00:00
|
|
|
version = "0.7.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
duneVersion = "3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
minimalOCamlVersion = "4.03";
|
2021-02-16 17:04:54 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/andrenth/ocaml-stdint/releases/download/${version}/stdint-${version}.tbz";
|
2022-11-04 12:27:35 +00:00
|
|
|
sha256 = "sha256-FWAZjYvJx68+qVLEDavoJmZpQhDsw/35u/60MhHpd+Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-22 21:28:39 +00:00
|
|
|
# 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
|
2021-02-16 17:04:54 +00:00
|
|
|
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"' \
|
2022-11-04 12:27:35 +00:00
|
|
|
'skip "Logical shifts must not sign-extend"'
|
2021-02-16 17:04:54 +00:00
|
|
|
'';
|
|
|
|
|
2021-09-28 08:13:01 +00:00
|
|
|
doCheck = lib.versionAtLeast ocaml.version "4.08";
|
2021-02-16 17:04:54 +00:00
|
|
|
checkInputs = [ qcheck ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "Various signed and unsigned integers for OCaml";
|
|
|
|
homepage = "https://github.com/andrenth/ocaml-stdint";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.gebner ];
|
|
|
|
};
|
|
|
|
}
|