2016-05-28 18:46:46 +01:00
|
|
|
{ stdenv, fetchurl, jre, makeWrapper, bash,
|
|
|
|
majorVersion ? "0.9" }:
|
2015-01-28 22:06:28 +00:00
|
|
|
|
|
|
|
let
|
2016-05-28 18:46:46 +01:00
|
|
|
versionMap = {
|
2017-11-02 17:37:24 +00:00
|
|
|
"0.8" = {
|
|
|
|
kafkaVersion = "0.8.2.2";
|
|
|
|
scalaVersion = "2.10";
|
|
|
|
sha256 = "1azccf1k0nr8y1sfpjgqf9swyp87ypvgva68ci4kczwcx1z9d89v";
|
|
|
|
};
|
|
|
|
"0.9" = {
|
|
|
|
kafkaVersion = "0.9.0.1";
|
|
|
|
scalaVersion = "2.11";
|
|
|
|
sha256 = "0ykcjv5dz9i5bws9my2d60pww1g9v2p2nqr67h0i2xrjm7az8a6v";
|
|
|
|
};
|
|
|
|
"0.10" = {
|
|
|
|
kafkaVersion = "0.10.2.0";
|
|
|
|
scalaVersion = "2.12";
|
|
|
|
sha256 = "0py43s6zv8z7wr2lk8403k07xxckl11gla3vs4gr99lixc4whis1";
|
|
|
|
};
|
|
|
|
"0.11" = {
|
|
|
|
kafkaVersion = "0.11.0.1";
|
|
|
|
scalaVersion = "2.12";
|
|
|
|
sha256 = "1wj639h95aq5n132fq1rbyzqh5rsa4mlhbg3c5mszqglnzdz4xn7";
|
|
|
|
};
|
2017-11-02 17:46:07 +00:00
|
|
|
"1.0" = {
|
|
|
|
kafkaVersion = "1.0.0";
|
|
|
|
scalaVersion = "2.12";
|
|
|
|
sha256 = "1cs4nmp39m99gqjpy5klsffqksc0h9pz514jkq99qb95a83x1cfm";
|
|
|
|
};
|
2016-05-28 18:46:46 +01:00
|
|
|
};
|
2015-01-28 22:06:28 +00:00
|
|
|
in
|
|
|
|
|
2016-05-28 18:46:46 +01:00
|
|
|
with versionMap.${majorVersion};
|
|
|
|
|
2015-01-28 22:06:28 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "${scalaVersion}-${kafkaVersion}";
|
|
|
|
name = "apache-kafka-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://apache/kafka/${kafkaVersion}/kafka_${version}.tgz";
|
2016-05-28 18:46:46 +01:00
|
|
|
inherit sha256;
|
2015-01-28 22:06:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ jre makeWrapper bash ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R config libs $out
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/kafka* $out/bin
|
|
|
|
|
|
|
|
# allow us the specify logging directory using env
|
|
|
|
substituteInPlace $out/bin/kafka-run-class.sh \
|
2015-04-27 03:58:12 +01:00
|
|
|
--replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
|
2015-01-28 22:06:28 +00:00
|
|
|
|
|
|
|
for p in $out/bin\/*.sh; do
|
|
|
|
wrapProgram $p \
|
|
|
|
--set JAVA_HOME "${jre}" \
|
|
|
|
--set KAFKA_LOG_DIR "/tmp/apache-kafka-logs" \
|
|
|
|
--prefix PATH : "${bash}/bin"
|
|
|
|
done
|
|
|
|
chmod +x $out/bin\/*
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://kafka.apache.org;
|
2015-01-28 22:06:28 +00:00
|
|
|
description = "A high-throughput distributed messaging system";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.ragge ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|