2018-07-06 12:18:42 +00:00
|
|
|
{ stdenv, fetchurl, jre, makeWrapper, bash, coreutils, gnugrep, gnused,
|
2017-11-02 17:48:22 +00:00
|
|
|
majorVersion ? "1.0" }:
|
2015-01-28 22:06:28 +00:00
|
|
|
|
|
|
|
let
|
2016-05-28 17:46:46 +00:00
|
|
|
versionMap = {
|
2017-11-02 17:37:24 +00:00
|
|
|
"0.9" = {
|
|
|
|
kafkaVersion = "0.9.0.1";
|
|
|
|
scalaVersion = "2.11";
|
|
|
|
sha256 = "0ykcjv5dz9i5bws9my2d60pww1g9v2p2nqr67h0i2xrjm7az8a6v";
|
|
|
|
};
|
|
|
|
"0.10" = {
|
2017-11-02 17:48:01 +00:00
|
|
|
kafkaVersion = "0.10.2.1";
|
2017-11-02 17:37:24 +00:00
|
|
|
scalaVersion = "2.12";
|
2017-11-02 17:48:01 +00:00
|
|
|
sha256 = "0iszr6r0n9yjgq7kcp1hf00fg754m86gs4jzqc18542an94b88z5";
|
2017-11-02 17:37:24 +00:00
|
|
|
};
|
|
|
|
"0.11" = {
|
2018-09-15 08:50:32 +00:00
|
|
|
kafkaVersion = "0.11.0.3";
|
2017-11-02 17:37:24 +00:00
|
|
|
scalaVersion = "2.12";
|
2018-09-15 08:50:32 +00:00
|
|
|
sha256 = "0zkzp9a8lcfcpavks131119v10hpn90sc0pw4f90jc4zn2yw3rgd";
|
2017-11-02 17:37:24 +00:00
|
|
|
};
|
2017-11-02 17:46:07 +00:00
|
|
|
"1.0" = {
|
2018-09-15 08:48:35 +00:00
|
|
|
kafkaVersion = "1.0.2";
|
2017-11-02 17:46:07 +00:00
|
|
|
scalaVersion = "2.12";
|
2018-09-15 08:48:35 +00:00
|
|
|
sha256 = "0cmq8ww1lbkp3ipy9d1q8c1yz4kfwj0v4ynnhsk1i48sqlmvwybj";
|
2017-11-02 17:46:07 +00:00
|
|
|
};
|
2018-05-17 02:26:40 +00:00
|
|
|
"1.1" = {
|
2018-09-15 08:46:58 +00:00
|
|
|
kafkaVersion = "1.1.1";
|
2018-05-17 02:26:40 +00:00
|
|
|
scalaVersion = "2.12";
|
2018-09-15 08:46:58 +00:00
|
|
|
sha256 = "13vg0wm2fsd06pfw05m4bhcgbjmb2bmd4i31zfs48w0f7hjc8qf2";
|
2018-05-17 02:26:40 +00:00
|
|
|
};
|
2018-09-15 08:45:59 +00:00
|
|
|
"2.0" = {
|
|
|
|
kafkaVersion = "2.0.0";
|
|
|
|
scalaVersion = "2.12";
|
|
|
|
sha256 = "0mbrp8rafv1bra9nrdicpxy6w59ixanaj50c9pkgdrih82f57wdm";
|
|
|
|
};
|
2016-05-28 17:46:46 +00:00
|
|
|
};
|
2015-01-28 22:06:28 +00:00
|
|
|
in
|
|
|
|
|
2016-05-28 17:46:46 +00: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 17:46:46 +00:00
|
|
|
inherit sha256;
|
2015-01-28 22:06:28 +00:00
|
|
|
};
|
|
|
|
|
2018-07-06 12:18:42 +00:00
|
|
|
buildInputs = [ jre makeWrapper bash gnugrep gnused coreutils ];
|
2015-01-28 22:06:28 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cp -R config libs $out
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/kafka* $out/bin
|
2018-05-31 20:03:48 +00:00
|
|
|
cp bin/connect* $out/bin
|
2015-01-28 22:06:28 +00:00
|
|
|
|
|
|
|
# allow us the specify logging directory using env
|
|
|
|
substituteInPlace $out/bin/kafka-run-class.sh \
|
2015-04-27 02:58:12 +00: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" \
|
2018-07-06 12:18:42 +00:00
|
|
|
--prefix PATH : "${bash}/bin:${coreutils}/bin:${gnugrep}/bin:${gnused}/bin"
|
2015-01-28 22:06:28 +00:00
|
|
|
done
|
|
|
|
chmod +x $out/bin\/*
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-08-01 20:03:30 +00: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;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|