nixpkgs/pkgs/development/ocaml-modules/stdint/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

38 lines
1.2 KiB
Nix
Raw Normal View History

2022-10-26 07:56:24 +00:00
{ lib, fetchurl, buildDunePackage, ocaml, qcheck }:
2017-10-02 10:18:35 +00:00
2019-12-18 09:20:00 +00:00
buildDunePackage rec {
2019-03-26 10:04:59 +00:00
pname = "stdint";
2022-10-26 07:56:24 +00:00
version = "0.7.2";
2019-12-18 09:20:00 +00:00
2022-10-26 07:56:24 +00:00
duneVersion = "3";
2022-10-26 07:56:24 +00:00
minimalOCamlVersion = "4.03";
src = fetchurl {
url = "https://github.com/andrenth/ocaml-stdint/releases/download/${version}/stdint-${version}.tbz";
2022-10-26 07:56:24 +00:00
sha256 = "sha256-FWAZjYvJx68+qVLEDavoJmZpQhDsw/35u/60MhHpd+Y=";
2017-10-02 10:18:35 +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
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-10-26 07:56:24 +00:00
'skip "Logical shifts must not sign-extend"'
'';
doCheck = lib.versionAtLeast ocaml.version "4.08";
checkInputs = [ qcheck ];
2017-10-02 10:18:35 +00:00
meta = {
description = "Various signed and unsigned integers for OCaml";
2019-12-18 09:20:00 +00:00
homepage = "https://github.com/andrenth/ocaml-stdint";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.gebner ];
2017-10-02 10:18:35 +00:00
};
}