4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
55 lines
1.3 KiB
Nix
55 lines
1.3 KiB
Nix
{ lib, stdenv, fetchurl, makeWrapper, jre
|
|
, version ? "1.6" }:
|
|
|
|
let
|
|
versionMap = {
|
|
"1.5" = {
|
|
flinkVersion = "1.5.5";
|
|
sha256 = "18wqcqi3gyqd40nspih99gq7ylfs20b35f4dcrspffagwkfp2l4z";
|
|
};
|
|
"1.6" = {
|
|
flinkVersion = "1.11.1";
|
|
sha256 = "0338bg2sb427c1rrf2cmsz63sz0yk6gclpli2lskq0mpx72wxpl0";
|
|
};
|
|
};
|
|
in
|
|
|
|
with versionMap.${version};
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "flink-${flinkVersion}";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://apache/flink/${name}/${name}-bin-scala_2.11.tgz";
|
|
inherit sha256;
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
|
|
|
installPhase = ''
|
|
rm bin/*.bat || true
|
|
|
|
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 lib; {
|
|
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";
|
|
};
|
|
}
|