summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/wtf8/default.nix
blob: 4cde95c0c4cc7f049e447492744abd4218c77ee6 (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
{ stdenv, fetchurl, ocaml, findlib, jbuilder }:

assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.01";

stdenv.mkDerivation rec {
  pname = "wtf8";
  name = "ocaml-${pname}-${version}";
  version = "1.0.1";

  src = fetchurl {
    url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
    sha256 = "1msg3vycd3k8qqj61sc23qks541cxpb97vrnrvrhjnqxsqnh6ygq";
  };

  unpackCmd = "tar xjf $src";

  buildInputs = [ ocaml findlib jbuilder ];

  buildPhase = "jbuilder build -p wtf8";

  inherit (jbuilder) installPhase;

  createFindLibDestdir = true;

  meta = with stdenv.lib; {
    homepage = https://github.com/flowtype/ocaml-wtf8;
    description = "WTF-8 is a superset of UTF-8 that allows unpaired surrogates.";
    license = licenses.mit;
    platforms = ocaml.meta.platforms or [];
    maintainers = [ maintainers.eqyiel ];
  };
}