2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocamlPackages, CoreServices }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "flow";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.238.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-08-08 23:34:03 +00:00
|
|
|
owner = "facebook";
|
|
|
|
repo = "flow";
|
|
|
|
rev = "v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-WlHta/wXTULehopXeIUdNAQb12Lf0SJnm1HIVHTDshA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/services/inference/check_cache.ml --replace 'Core_kernel' 'Core'
|
|
|
|
'';
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
makeFlags = [ "FLOW_RELEASE=1" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 bin/flow $out/bin/flow
|
|
|
|
install -Dm644 resources/shell/bash-completion $out/share/bash-completion/completions/flow
|
|
|
|
'';
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
nativeBuildInputs = with ocamlPackages; [ ocaml dune_3 findlib ocamlbuild ];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices ]
|
|
|
|
++ (with ocamlPackages; [ core_kernel dtoa fileutils lwt_log lwt_ppx ocaml_lwt ppx_deriving ppx_gen_rec ppx_let sedlex visitors wtf8 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ inotify ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Static type checker for JavaScript";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "flow";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://flow.org/";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/facebook/flow/blob/v${version}/Changelog.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = ocamlPackages.ocaml.meta.platforms;
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = with maintainers; [ puffnfresh ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|