2017-11-29 03:21:45 +01:00
|
|
|
{ stdenv, fetchurl, makeWrapper, jre
|
|
|
|
, version ? "1.3" }:
|
2017-11-25 20:25:06 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
versionMap = {
|
|
|
|
"1.3" = {
|
|
|
|
flinkVersion = "1.3.2";
|
|
|
|
scalaVersion = "2.11";
|
2017-11-29 03:21:45 +01:00
|
|
|
sha256 = "0mf4qz0963bflzidgslvwpdlvj9za9sj20dfybplw9lhd4sf52rp";
|
2017-11-25 20:25:06 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
with versionMap.${version};
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "flink-${flinkVersion}";
|
|
|
|
|
2017-11-29 03:21:45 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://apache/flink/${name}/${name}-bin-hadoop27-scala_${scalaVersion}.tgz";
|
2017-11-25 20:25:06 +01:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2017-11-29 03:21:45 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2017-11-25 20:25:06 +01:00
|
|
|
buildInputs = [ jre ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2017-11-29 03:21:45 +01: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 20:25:06 +01:00
|
|
|
|
2017-11-29 03:21:45 +01:00
|
|
|
cat <<EOF >> $out/opt/flink/conf/flink-conf.yaml
|
2017-11-25 20:25:06 +01:00
|
|
|
env.java.home: ${jre}"
|
|
|
|
env.log.dir: /tmp/flink-logs
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-11-29 03:21:45 +01: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 20:25:06 +01:00
|
|
|
repositories.git = git://git.apache.org/flink.git;
|
|
|
|
};
|
|
|
|
}
|