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

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

38 lines
1008 B
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, ctypes, libsodium }:
2019-11-18 21:00:36 +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";
};
patches = [
# ctypes.stubs no longer pulls in bigarray automatically
./lib-gen-link-bigarray.patch
];
nativeBuildInputs = [ ocaml findlib ocamlbuild ];
2019-11-18 21:00:36 +00:00
propagatedBuildInputs = [ ctypes libsodium ];
strictDeps = true;
2019-11-18 21:00:36 +00:00
createFindlibDestdir = true;
hardeningDisable = lib.optional stdenv.isDarwin "strictoverflow";
2019-11-18 21:00:36 +00:00
meta = with lib; {
homepage = "https://github.com/dsheets/ocaml-sodium";
2019-11-18 21:00:36 +00:00
description = "Binding to libsodium 1.0.9+";
inherit (ocaml.meta) platforms;
2019-11-18 21:00:36 +00:00
maintainers = [ maintainers.rixed ];
};
}