Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, ctypes, libsodium }:
2
3stdenv.mkDerivation rec {
4 pname = "ocaml${ocaml.version}-sodium";
5 version = "0.6.0";
6
7 src = fetchFromGitHub {
8 owner = "dsheets";
9 repo = "ocaml-sodium";
10 rev = version;
11 sha256 = "124gpi1jhac46x05gp5viykyrafnlp03v1cmkl13c6pgcs8w04pv";
12 };
13
14 patches = [
15 # ctypes.stubs no longer pulls in bigarray automatically
16 ./lib-gen-link-bigarray.patch
17 ];
18
19 nativeBuildInputs = [ ocaml findlib ocamlbuild ];
20 propagatedBuildInputs = [ ctypes libsodium ];
21
22 strictDeps = true;
23
24 createFindlibDestdir = true;
25
26 hardeningDisable = lib.optional stdenv.isDarwin "strictoverflow";
27
28 meta = with lib; {
29 homepage = "https://github.com/dsheets/ocaml-sodium";
30 description = "Binding to libsodium 1.0.9+";
31 inherit (ocaml.meta) platforms;
32 maintainers = [ maintainers.rixed ];
33 };
34}