1{ stdenv, fetchFromGitHub, lib, ocaml, libelf, cf-private, CoreServices }:
2
3with lib;
4
5stdenv.mkDerivation rec {
6 version = "0.18.1";
7 name = "flow-${version}";
8 src = fetchFromGitHub {
9 owner = "facebook";
10 repo = "flow";
11 rev = "v${version}";
12 sha256 = "00pmrk577p6ngqif4rvhwybb4gyw70vsgxcxxwj995dg4hf196s1";
13 };
14
15 installPhase = ''
16 mkdir -p $out/bin
17 cp bin/flow $out/bin/
18 '';
19
20 buildInputs = [ ocaml libelf ]
21 ++ optionals stdenv.isDarwin [ cf-private CoreServices ];
22
23 meta = with stdenv.lib; {
24 description = "A static type checker for JavaScript";
25 homepage = http://flowtype.org;
26 license = licenses.bsd3;
27 platforms = platforms.unix;
28 maintainers = with maintainers; [ puffnfresh globin ];
29 };
30}