nixpkgs/pkgs/applications/networking/cluster/flink/default.nix

55 lines
1.3 KiB
Nix
Raw Normal View History

2017-11-28 18:21:45 -08:00
{ stdenv, fetchurl, makeWrapper, jre
2018-09-14 09:35:06 -07:00
, version ? "1.6" }:
2017-11-25 11:25:06 -08:00
let
versionMap = {
2018-07-11 11:37:06 -07:00
"1.5" = {
2018-11-18 06:29:21 -08:00
flinkVersion = "1.5.5";
sha256 = "18wqcqi3gyqd40nspih99gq7ylfs20b35f4dcrspffagwkfp2l4z";
2018-07-11 11:37:06 -07:00
};
2018-09-14 09:35:06 -07:00
"1.6" = {
2018-11-18 06:25:45 -08:00
flinkVersion = "1.6.2";
sha256 = "17fsr6yv1ayr7fw0r4pjlbpkn9ypzjs4brqndzr3gbzwrdc44arw";
2018-09-14 09:35:06 -07:00
};
2017-11-25 11:25:06 -08:00
};
in
with versionMap.${version};
stdenv.mkDerivation rec {
name = "flink-${flinkVersion}";
2017-11-28 18:21:45 -08:00
src = fetchurl {
url = "mirror://apache/flink/${name}/${name}-bin-scala_2.11.tgz";
2017-11-25 11:25:06 -08:00
inherit sha256;
};
2017-11-28 18:21:45 -08:00
nativeBuildInputs = [ makeWrapper ];
2017-11-25 11:25:06 -08:00
buildInputs = [ jre ];
installPhase = ''
2017-11-28 18:21:45 -08:00
rm bin/*.bat
mkdir -p $out/bin $out/opt/flink
mv * $out/opt/flink/
makeWrapper $out/opt/flink/bin/flink $out/bin/flink \
--prefix PATH : ${jre}/bin
2017-11-25 11:25:06 -08:00
2017-11-28 18:21:45 -08:00
cat <<EOF >> $out/opt/flink/conf/flink-conf.yaml
2017-11-25 11:25:06 -08:00
env.java.home: ${jre}"
env.log.dir: /tmp/flink-logs
EOF
'';
meta = with stdenv.lib; {
2017-11-28 18:21:45 -08:00
description = "A distributed stream processing framework";
homepage = https://flink.apache.org;
downloadPage = https://flink.apache.org/downloads.html;
license = licenses.asl20;
platforms = platforms.all;
maintainers = with maintainers; [ mbode ];
2017-11-25 11:25:06 -08:00
repositories.git = git://git.apache.org/flink.git;
};
}