about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/ocaml-modules/erm_xmpp/default.nix
blob: 9eaad7575ec309dfb2f720a2b33204a8a423adca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ stdenv, lib, fetchFromGitHub, ocaml, findlib, camlp4, ocamlbuild
, erm_xml, mirage-crypto, mirage-crypto-rng, base64
}:

stdenv.mkDerivation rec {
  version = "0.3+20200317";
  name = "ocaml${ocaml.version}-erm_xmpp-${version}";

  src = fetchFromGitHub {
    owner  = "hannesm";
    repo   = "xmpp";
    rev    = "7fa5bea252671fd88625c6af109998b879ca564f";
    sha256 = "0spzyd9kbyizzwl8y3mq8z19zlkzxnkh2fppry4lyc7vaw7bqrwq";
  };

  buildInputs = [ ocaml findlib ocamlbuild camlp4 ];
  propagatedBuildInputs = [ erm_xml mirage-crypto mirage-crypto-rng base64 ];

  configurePhase = ''
    runHook preConfigure
    ocaml setup.ml -configure --prefix $out
    runHook postConfigure
  '';
  buildPhase = ''
    runHook preBuild
    ocaml setup.ml -build
    runHook postBuild
  '';
  installPhase = ''
    runHook preInstall
    ocaml setup.ml -install
    runHook postInstall
  '';

  createFindlibDestdir = true;

  meta = {
    homepage = "https://github.com/hannesm/xmpp";
    description = "OCaml based XMPP implementation (fork)";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ sternenseemann ];
    inherit (ocaml.meta) platforms;
  };
}