From ea37640791bd87270aea53c1faa5a64e667be283 Mon Sep 17 00:00:00 2001 From: Maximilian Bode Date: Sat, 25 Nov 2017 20:25:06 +0100 Subject: [PATCH 1/2] flink: init at 1.3.2 --- lib/maintainers.nix | 1 + .../networking/cluster/flink/default.nix | 47 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 3 ++ 3 files changed, 51 insertions(+) create mode 100644 pkgs/applications/networking/cluster/flink/default.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 02ea550e84bc..1b1b28f0ed6a 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -400,6 +400,7 @@ mbakke = "Marius Bakke "; mbbx6spp = "Susan Potter "; mbe = "Brandon Edens "; + mbode = "Maximilian Bode "; mboes = "Mathieu Boespflug "; mbrgm = "Marius Bergmann "; mcmtroffaes = "Matthias C. M. Troffaes "; diff --git a/pkgs/applications/networking/cluster/flink/default.nix b/pkgs/applications/networking/cluster/flink/default.nix new file mode 100644 index 000000000000..1cde0df03594 --- /dev/null +++ b/pkgs/applications/networking/cluster/flink/default.nix @@ -0,0 +1,47 @@ +{ stdenv, fetchzip, jre, + version ? "1.3" }: + +let + versionMap = { + "1.3" = { + flinkVersion = "1.3.2"; + scalaVersion = "2.11"; + sha256 = "0dr8c1z4ncza6qp2zcklbmn0gj0l1rics3c8fiminkp8bl454ijg"; + }; + }; +in + +with versionMap.${version}; + +stdenv.mkDerivation rec { + name = "flink-${flinkVersion}"; + + src = fetchzip { + url = "mirror://apache/flink/${name}/${name}-bin-hadoop27-scala_${scalaVersion}.tgz"; + inherit sha256; + }; + + buildInputs = [ jre ]; + + installPhase = '' + mkdir -p $out + cp -R bin conf examples lib opt resources $out + rm $out/bin/*.bat + chmod +x $out/bin\/* + + cat <> $out/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 ]; + repositories.git = git://git.apache.org/flink.git; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 75eda2045602..5b186472c172 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14658,6 +14658,9 @@ with pkgs; fldigi = callPackage ../applications/audio/fldigi { }; + flink = flink_1_3; + flink_1_3 = callPackage ../applications/networking/cluster/flink { version = "1.3"; }; + fluidsynth = callPackage ../applications/audio/fluidsynth { inherit (darwin.apple_sdk.frameworks) CoreServices CoreAudio AudioUnit; }; From dcd9d9f6188d3adb6f2092f04edfcd0b2b640225 Mon Sep 17 00:00:00 2001 From: Orivej Desh Date: Wed, 29 Nov 2017 02:21:45 +0000 Subject: [PATCH 2/2] flink: refactor --- .../networking/cluster/flink/default.nix | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/pkgs/applications/networking/cluster/flink/default.nix b/pkgs/applications/networking/cluster/flink/default.nix index 1cde0df03594..bc8684da7679 100644 --- a/pkgs/applications/networking/cluster/flink/default.nix +++ b/pkgs/applications/networking/cluster/flink/default.nix @@ -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 <> $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 <> $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; }; }