Merge pull request #78005 from marsam/update-flow

flow: 0.114.0 -> 0.116.1
This commit is contained in:
Mario Rodas 2020-01-20 21:27:06 -05:00 committed by GitHub
commit f164e688a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 77 additions and 6 deletions

@ -0,0 +1,69 @@
{ stdenv
, fetchFromGitHub
, fetchurl
, ocaml
, dune
, findlib
, gen
, ppx_tools_versioned
, ocaml-migrate-parsetree
, uchar
}:
if stdenv.lib.versionOlder ocaml.version "4.02.3"
then throw "sedlex is not available for OCaml ${ocaml.version}"
else
let
DerivedCoreProperties = fetchurl {
url = "https://www.unicode.org/Public/12.1.0/ucd/DerivedCoreProperties.txt";
sha256 = "0s6sn1yr9qmb2i6gf8dir2zpsbjv1frdfzy3i2yjylzvf637msx6";
};
DerivedGeneralCategory = fetchurl {
url = "https://www.unicode.org/Public/12.1.0/ucd/extracted/DerivedGeneralCategory.txt";
sha256 = "1rifzq9ba6c58dn0lrmcb5l5k4ksx3zsdkira3m5p6h4i2wriy3q";
};
PropList = fetchurl {
url = "https://www.unicode.org/Public/12.1.0/ucd/PropList.txt";
sha256 = "0gsb1jpj3mnqbjgbavi4l95gl6g4agq58j82km22fdfg63j3w3fk";
};
in
stdenv.mkDerivation rec {
name = "ocaml${ocaml.version}-sedlex-${version}";
version = "2.1";
src = fetchFromGitHub {
owner = "ocaml-community";
repo = "sedlex";
rev = "v${version}";
sha256 = "05f6qa8x3vhpdz1fcnpqk37fpnyyq13icqsk2gww5idjnh6kng26";
};
buildInputs = [ ocaml findlib dune ppx_tools_versioned ocaml-migrate-parsetree ];
propagatedBuildInputs = [ gen uchar ];
preBuild = ''
ln -s ${DerivedCoreProperties} src/generator/data/DerivedCoreProperties.txt
ln -s ${DerivedGeneralCategory} src/generator/data/DerivedGeneralCategory.txt
ln -s ${PropList} src/generator/data/PropList.txt
'';
buildFlags = [ "build" ];
installPhase = ''
make INSTALL_ARGS="--prefix=$out --libdir=$OCAMLFIND_DESTDIR" install
'';
createFindlibDestdir = true;
dontStrip = true;
meta = {
homepage = https://github.com/ocaml-community/sedlex;
description = "An OCaml lexer generator for Unicode";
license = stdenv.lib.licenses.mit;
inherit (ocaml.meta) platforms;
maintainers = [ stdenv.lib.maintainers.marsam ];
};
}

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "flow";
version = "0.114.0";
version = "0.116.1";
src = fetchFromGitHub {
owner = "facebook";
repo = "flow";
rev = "refs/tags/v${version}";
sha256 = "1dkp3v898b5vd0a9fl5xknwbbqv23v0icqml8ypyhzrv6wz5qiy3";
sha256 = "19j2zw8ajky04d2ayfzj99yz805igip1ql3i4v7bblamc8sk38cn";
};
installPhase = ''
@ -16,14 +16,14 @@ stdenv.mkDerivation rec {
install -Dm644 resources/shell/bash-completion $out/share/bash-completion/completions/flow
'';
buildInputs = (with ocamlPackages; [ ocaml findlib ocamlbuild dtoa core_kernel sedlex ocaml_lwt lwt_log lwt_ppx ppx_deriving ppx_gen_rec ppx_tools_versioned visitors wtf8 ocaml-migrate-parsetree ])
buildInputs = (with ocamlPackages; [ ocaml findlib ocamlbuild dtoa core_kernel sedlex_2 ocaml_lwt lwt_log lwt_ppx ppx_deriving ppx_gen_rec ppx_tools_versioned visitors wtf8 ocaml-migrate-parsetree ])
++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices ];
patches = [
# Fix List.compare labeled argument. Remove when https://github.com/facebook/flow/pull/8191 is merged
# Fix List.compare labeled argument. Remove with the next release
(fetchpatch {
url = "https://github.com/facebook/flow/commit/1625664ec7290d4128587d96cb878571751f8881.patch";
sha256 = "18fan0d2xa6z4ilbr7ha3vhnfqlr2s6mb02sgpv8ala99b0mcgmn";
url = "https://github.com/facebook/flow/commit/d061b38042327d8241fb6dec7c8307c86b2f23d6.patch";
sha256 = "1rmkb1zldgm2y2n32nm2xd8c7wk3hccsbljjz6bm6a0yixa6w77l";
})
];

@ -839,6 +839,8 @@ let
sedlex = callPackage ../development/ocaml-modules/sedlex { };
sedlex_2 = callPackage ../development/ocaml-modules/sedlex/2.nix { };
sodium = callPackage ../development/ocaml-modules/sodium { };
spelll = callPackage ../development/ocaml-modules/spelll { };