2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, ctypes, libsodium }:
|
2019-11-18 21:00:36 +00:00
|
|
|
|
2023-10-30 05:46:56 +00:00
|
|
|
lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
|
|
|
|
"sodium is not available for OCaml ${ocaml.version}"
|
|
|
|
|
2019-11-18 21:00:36 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ocaml${ocaml.version}-sodium";
|
|
|
|
version = "0.6.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dsheets";
|
|
|
|
repo = "ocaml-sodium";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "124gpi1jhac46x05gp5viykyrafnlp03v1cmkl13c6pgcs8w04pv";
|
|
|
|
};
|
|
|
|
|
2021-03-06 20:17:28 +00:00
|
|
|
patches = [
|
|
|
|
# ctypes.stubs no longer pulls in bigarray automatically
|
|
|
|
./lib-gen-link-bigarray.patch
|
|
|
|
];
|
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild ];
|
2019-11-18 21:00:36 +00:00
|
|
|
propagatedBuildInputs = [ ctypes libsodium ];
|
|
|
|
|
2022-02-22 09:59:04 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2019-11-18 21:00:36 +00:00
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2021-01-11 12:49:15 +00:00
|
|
|
hardeningDisable = lib.optional stdenv.isDarwin "strictoverflow";
|
2019-11-18 21:00:36 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/dsheets/ocaml-sodium";
|
2019-11-18 21:00:36 +00:00
|
|
|
description = "Binding to libsodium 1.0.9+";
|
2022-05-10 17:36:58 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2019-11-18 21:00:36 +00:00
|
|
|
maintainers = [ maintainers.rixed ];
|
|
|
|
};
|
|
|
|
}
|