2023-04-29 16:46:19 +00:00
|
|
|
{ lib, buildDunePackage, fetchFromGitHub, ocaml, cppo }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
buildDunePackage rec {
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "1.2";
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "ocplib-endian";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "OCamlPro";
|
|
|
|
repo = "ocplib-endian";
|
|
|
|
rev = version;
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-THTlhOfXAPaqTt1qBkht+D67bw6M175QLvXoUMgjks4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "5.0") ''
|
|
|
|
substituteInPlace src/dune \
|
2023-07-15 17:15:38 +00:00
|
|
|
--replace "(libraries bytes)" "" \
|
|
|
|
--replace "libraries ocplib_endian bigarray bytes" "libraries ocplib_endian"
|
2023-04-29 16:46:19 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
minimalOCamlVersion = "4.03";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ cppo ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Optimised functions to read and write int16/32/64";
|
|
|
|
homepage = "https://github.com/OCamlPro/ocplib-endian";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = licenses.lgpl21;
|
|
|
|
maintainers = with maintainers; [ vbgl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|