nixpkgs/pkgs/servers/confluent-platform/default.nix
Zoey de Souza Pessanha 346be02580
confluent-platform: 5.3.0 -> 7.0.1 (#165739)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2022-03-26 13:04:19 +01:00

46 lines
1.3 KiB
Nix

{ stdenv, lib, fetchurl, fetchFromGitHub
, jre, makeWrapper, bash, gnused }:
stdenv.mkDerivation rec {
pname = "confluent-platform";
version = "7.0.1";
src = fetchurl {
url = "https://packages.confluent.io/archive/${lib.versions.majorMinor version}/confluent-${version}.tar.gz";
sha256 = "Q0/A/3M2tn530/+o1RpcgNsPKFQq6YJQnhgysRlpVfU=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre bash ];
installPhase = ''
mkdir -p $out
cp -R bin etc share src $out
rm -rf $out/bin/windows
patchShebangs $out/bin
# allow us the specify logging directory using env
substituteInPlace $out/bin/kafka-run-class \
--replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
substituteInPlace $out/bin/ksql-run-class \
--replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
for p in $out/bin\/*; do
wrapProgram $p \
--set JAVA_HOME "${jre}" \
--set KAFKA_LOG_DIR "/tmp/apache-kafka-logs" \
--prefix PATH : "${jre}/bin:${bash}/bin:${gnused}/bin"
done
'';
meta = with lib; {
homepage = "https://www.confluent.io/";
description = "Confluent event streaming platform based on Apache Kafka";
license = licenses.asl20;
maintainers = with maintainers; [ zoedsoupe ];
platforms = platforms.unix;
};
}