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

65 lines
1.6 KiB
Nix
Raw Normal View History

2017-11-29 02:21:45 +00:00
{ stdenv, fetchurl, makeWrapper, jre
2018-07-11 18:37:06 +00:00
, version ? "1.5" }:
2017-11-25 19:25:06 +00:00
let
versionMap = {
"1.3" = {
2018-07-11 18:42:31 +00:00
flinkVersion = "1.3.3";
2017-11-25 19:25:06 +00:00
scalaVersion = "2.11";
2018-07-11 18:42:31 +00:00
sha256 = "0gfm48k5adr14gnhqri9cd01i9dprd0nwmnnz3yrpd20nq4ap4qy";
hadoopBundle = "-hadoop27";
};
"1.4" = {
flinkVersion = "1.4.2";
scalaVersion = "2.11";
sha256 = "0x3cikys5brin0kx9zr69xfp8k5w6g8141yrrr26ks7gpss2x636";
hadoopBundle = "";
2017-11-25 19:25:06 +00:00
};
2018-07-11 18:37:06 +00:00
"1.5" = {
flinkVersion = "1.5.0";
scalaVersion = "2.11";
sha256 = "0n5023dj8ivmbhqxmb3abmfh3ahb9vmcywq5i0ll5p7xxcw2c1cv";
hadoopBundle = "";
};
2017-11-25 19:25:06 +00:00
};
in
with versionMap.${version};
stdenv.mkDerivation rec {
name = "flink-${flinkVersion}";
2017-11-29 02:21:45 +00:00
src = fetchurl {
2018-07-11 18:42:31 +00:00
url = "mirror://apache/flink/${name}/${name}-bin${hadoopBundle}-scala_${scalaVersion}.tgz";
2017-11-25 19:25:06 +00:00
inherit sha256;
};
2017-11-29 02:21:45 +00:00
nativeBuildInputs = [ makeWrapper ];
2017-11-25 19:25:06 +00:00
buildInputs = [ jre ];
installPhase = ''
2017-11-29 02:21:45 +00: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 19:25:06 +00:00
2017-11-29 02:21:45 +00:00
cat <<EOF >> $out/opt/flink/conf/flink-conf.yaml
2017-11-25 19:25:06 +00:00
env.java.home: ${jre}"
env.log.dir: /tmp/flink-logs
EOF
'';
meta = with stdenv.lib; {
2017-11-29 02:21:45 +00: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 19:25:06 +00:00
repositories.git = git://git.apache.org/flink.git;
};
}