depot/third_party/nixpkgs/pkgs/development/ocaml-modules/ocplib-endian/default.nix
Default email c7e6337bd0 Project import generated by Copybara.
GitOrigin-RevId: 08e4dc3a907a6dfec8bb3bbf1540d8abbffea22b
2023-04-29 12:46:19 -04:00

29 lines
795 B
Nix

{ lib, buildDunePackage, fetchFromGitHub, ocaml, cppo }:
buildDunePackage rec {
version = "1.2";
pname = "ocplib-endian";
src = fetchFromGitHub {
owner = "OCamlPro";
repo = "ocplib-endian";
rev = version;
sha256 = "sha256-THTlhOfXAPaqTt1qBkht+D67bw6M175QLvXoUMgjks4=";
};
postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "5.0") ''
substituteInPlace src/dune \
--replace "libraries ocplib_endian bigarray" "libraries ocplib_endian"
'';
minimalOCamlVersion = "4.03";
nativeBuildInputs = [ cppo ];
meta = with lib; {
description = "Optimised functions to read and write int16/32/64";
homepage = "https://github.com/OCamlPro/ocplib-endian";
license = licenses.lgpl21;
maintainers = with maintainers; [ vbgl ];
};
}