flink: refactor

This commit is contained in:
Orivej Desh 2017-11-29 02:21:45 +00:00
parent ea37640791
commit dcd9d9f618

View file

@ -1,12 +1,12 @@
{ stdenv, fetchzip, jre,
version ? "1.3" }:
{ stdenv, fetchurl, makeWrapper, jre
, version ? "1.3" }:
let
versionMap = {
"1.3" = {
flinkVersion = "1.3.2";
scalaVersion = "2.11";
sha256 = "0dr8c1z4ncza6qp2zcklbmn0gj0l1rics3c8fiminkp8bl454ijg";
sha256 = "0mf4qz0963bflzidgslvwpdlvj9za9sj20dfybplw9lhd4sf52rp";
};
};
in
@ -16,32 +16,36 @@ with versionMap.${version};
stdenv.mkDerivation rec {
name = "flink-${flinkVersion}";
src = fetchzip {
url = "mirror://apache/flink/${name}/${name}-bin-hadoop27-scala_${scalaVersion}.tgz";
src = fetchurl {
url = "mirror://apache/flink/${name}/${name}-bin-hadoop27-scala_${scalaVersion}.tgz";
inherit sha256;
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
installPhase = ''
mkdir -p $out
cp -R bin conf examples lib opt resources $out
rm $out/bin/*.bat
chmod +x $out/bin\/*
rm bin/*.bat
cat <<EOF >> $out/conf/flink-conf.yaml
mkdir -p $out/bin $out/opt/flink
mv * $out/opt/flink/
makeWrapper $out/opt/flink/bin/flink $out/bin/flink \
--prefix PATH : ${jre}/bin
cat <<EOF >> $out/opt/flink/conf/flink-conf.yaml
env.java.home: ${jre}"
env.log.dir: /tmp/flink-logs
EOF
'';
meta = with stdenv.lib; {
description = "An open-source stream processing framework for distributed, high-performing, always-available, and accurate data streaming applications.";
homepage = "https://flink.apache.org";
downloadPage = "https://flink.apache.org/downloads.html";
license = stdenv.lib.licenses.asl20;
platforms = stdenv.lib.platforms.all;
maintainers = with maintainers; [ mbode ];
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 ];
repositories.git = git://git.apache.org/flink.git;
};
}