2019-08-04 13:05:59 +02:00
|
|
|
{ stdenv, lib, fetchurl, fetchFromGitHub
|
|
|
|
, jre, makeWrapper, bash, gnused }:
|
2018-08-01 21:35:42 +02:00
|
|
|
|
2019-05-24 03:17:49 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "confluent-platform";
|
2019-08-04 01:49:22 +02:00
|
|
|
version = "5.3.0";
|
2019-08-04 13:05:59 +02:00
|
|
|
scalaVersion = "2.12";
|
2018-08-01 21:35:42 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-05-24 03:17:49 +02:00
|
|
|
url = "http://packages.confluent.io/archive/${lib.versions.majorMinor version}/confluent-${version}-${scalaVersion}.tar.gz";
|
2019-08-04 01:49:22 +02:00
|
|
|
sha256 = "14cilq63fib5yvj40504aj6wssi7xw4f7c2jadlzdmdxzh4ixqmp";
|
2018-08-01 21:35:42 +02:00
|
|
|
};
|
|
|
|
|
2019-08-04 13:05:59 +02:00
|
|
|
confluentCli = fetchFromGitHub {
|
|
|
|
owner = "confluentinc";
|
|
|
|
repo = "confluent-cli";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "18yvp56b8l074qfkgr4afirgd43g8b023n9ija6dnk6p6dib1f4j";
|
|
|
|
};
|
|
|
|
|
2018-08-01 21:35:42 +02:00
|
|
|
buildInputs = [ jre makeWrapper bash ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2019-08-04 13:05:59 +02:00
|
|
|
cp -R $confluentCli confluent-cli
|
|
|
|
chmod -R +w confluent-cli
|
|
|
|
|
|
|
|
(
|
|
|
|
export CONFLUENT_HOME=$PWD
|
|
|
|
cd confluent-cli
|
|
|
|
make install
|
|
|
|
)
|
|
|
|
|
2018-08-01 21:35:42 +02:00
|
|
|
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" \
|
2019-08-04 13:05:30 +02:00
|
|
|
--prefix PATH : "${jre}/bin:${bash}/bin:${gnused}/bin"
|
2018-08-01 21:35:42 +02:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://www.confluent.io/;
|
2019-05-24 03:17:49 +02:00
|
|
|
description = "Confluent event streaming platform based on Apache Kafka";
|
2018-08-01 21:35:42 +02:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.offline ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|