summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/ppx_blob/default.nix
blob: 72e0e5e121ad7ee6cb607892eb16e12aa8885074 (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
{ stdenv, fetchurl, ocaml, findlib, dune, alcotest
, ocaml-migrate-parsetree
}:

stdenv.mkDerivation rec {
  name = "ocaml${ocaml.version}-ppx_blob-${version}";
  version = "0.4.0";

  src = fetchurl {
    url = "https://github.com/johnwhitington/ppx_blob/releases/download/${version}/ppx_blob-${version}.tbz";
    sha256 = "1xmslk1mwdzhy1bydgsjlcb7h544c39hvxa8lywp8w72gaggjl16";
  };

  unpackCmd = "tar xjf $curSrc";

  buildInputs = [ ocaml findlib dune alcotest ocaml-migrate-parsetree ];

  buildPhase = "dune build -p ppx_blob";

  doCheck = true;
  checkPhase = "dune runtest -p ppx_blob";

  inherit (dune) installPhase;

  meta = with stdenv.lib; {
    homepage = https://github.com/johnwhitington/ppx_blob;
    description = "OCaml ppx to include binary data from a file as a string";
    license = licenses.unlicense;
  };
}