2017-11-29 02:21:45 +00:00
|
|
|
{ stdenv, fetchurl, makeWrapper, jre
|
2018-09-14 17:35:06 +01:00
|
|
|
, version ? "1.6" }:
|
2017-11-25 19:25:06 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
versionMap = {
|
2018-07-11 19:37:06 +01:00
|
|
|
"1.5" = {
|
2018-09-14 17:35:39 +01:00
|
|
|
flinkVersion = "1.5.3";
|
|
|
|
sha256 = "1fq7pd5qpchkkwhh30h3l9rhf298jfcfv2dc50z39qmwwijdjajk";
|
2018-07-11 19:37:06 +01:00
|
|
|
};
|
2018-09-14 17:35:06 +01:00
|
|
|
"1.6" = {
|
2018-10-01 18:51:54 +01:00
|
|
|
flinkVersion = "1.6.1";
|
|
|
|
sha256 = "1z4795va15qnnhk2qx3gzimzgfd9nqchfgn759fnqfmcxh6n9vw3";
|
2018-09-14 17:35:06 +01:00
|
|
|
};
|
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-09-15 08:38:30 +01:00
|
|
|
url = "mirror://apache/flink/${name}/${name}-bin-scala_2.11.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;
|
|
|
|
};
|
|
|
|
}
|