1{
2 bash,
3 fetchurl,
4 gnused,
5 jre,
6 lib,
7 makeBinaryWrapper,
8 stdenv,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "confluent-platform";
13 version = "7.7.0";
14
15 src = fetchurl {
16 url = "https://packages.confluent.io/archive/${lib.versions.majorMinor finalAttrs.version}/confluent-${finalAttrs.version}.tar.gz";
17 hash = "sha256-w5dazjSZTv/zqNcOcmyUUu8z5wftsJtBeU3bO1WhQ6k=";
18 };
19
20 nativeBuildInputs = [
21 makeBinaryWrapper
22 ];
23
24 buildInputs = [
25 bash
26 jre
27 ];
28
29 installPhase = ''
30 runHook preInstall
31
32 mkdir -p $out
33 cp -R bin etc share src $out
34 rm -rf $out/bin/windows
35
36 patchShebangs $out/bin
37
38 # allow us the specify logging directory using env
39 substituteInPlace $out/bin/kafka-run-class \
40 --replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
41
42 substituteInPlace $out/bin/ksql-run-class \
43 --replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
44
45 for p in $out/bin\/*; do
46 wrapProgram $p \
47 --set JAVA_HOME "${jre}" \
48 --set KAFKA_LOG_DIR "/tmp/apache-kafka-logs" \
49 --prefix PATH : "${jre}/bin:${bash}/bin:${gnused}/bin"
50 done
51
52 runHook postInstall
53 '';
54
55 meta = {
56 description = "Confluent event streaming platform based on Apache Kafka";
57 homepage = "https://www.confluent.io/";
58 license = lib.licenses.asl20;
59 maintainers = with lib.maintainers; [
60 zoedsoupe
61 autophagy
62 ];
63 platforms = lib.platforms.unix;
64 };
65})