2019-11-18 22:00:36 +01:00
|
|
|
{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, ctypes, libsodium }:
|
|
|
|
|
2020-05-22 11:10:07 +02:00
|
|
|
if stdenv.lib.versionAtLeast ocaml.version "4.10"
|
|
|
|
then throw "sodium is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2019-11-18 22:00:36 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ocaml${ocaml.version}-sodium";
|
|
|
|
version = "0.6.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dsheets";
|
|
|
|
repo = "ocaml-sodium";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "124gpi1jhac46x05gp5viykyrafnlp03v1cmkl13c6pgcs8w04pv";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ];
|
|
|
|
propagatedBuildInputs = [ ctypes libsodium ];
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
hardeningDisable = stdenv.lib.optional stdenv.isDarwin "strictoverflow";
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/dsheets/ocaml-sodium";
|
2019-11-18 22:00:36 +01:00
|
|
|
description = "Binding to libsodium 1.0.9+";
|
|
|
|
platforms = ocaml.meta.platforms or [];
|
|
|
|
maintainers = [ maintainers.rixed ];
|
|
|
|
};
|
|
|
|
}
|