Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv, lib, fetchurl, fetchFromGitHub
2, jre, makeWrapper, bash, gnused }:
3
4stdenv.mkDerivation rec {
5 pname = "confluent-platform";
6 version = "7.3.0";
7
8 src = fetchurl {
9 url = "https://packages.confluent.io/archive/${lib.versions.majorMinor version}/confluent-${version}.tar.gz";
10 sha256 = "sha256-j120gSIky0CHNgzaVnodMAniecRX0RpU6+il86nxdrQ=";
11 };
12
13 nativeBuildInputs = [ makeWrapper ];
14 buildInputs = [ jre bash ];
15
16 installPhase = ''
17 mkdir -p $out
18 cp -R bin etc share src $out
19 rm -rf $out/bin/windows
20
21 patchShebangs $out/bin
22
23 # allow us the specify logging directory using env
24 substituteInPlace $out/bin/kafka-run-class \
25 --replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
26
27 substituteInPlace $out/bin/ksql-run-class \
28 --replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
29
30 for p in $out/bin\/*; do
31 wrapProgram $p \
32 --set JAVA_HOME "${jre}" \
33 --set KAFKA_LOG_DIR "/tmp/apache-kafka-logs" \
34 --prefix PATH : "${jre}/bin:${bash}/bin:${gnused}/bin"
35 done
36 '';
37
38 meta = with lib; {
39 homepage = "https://www.confluent.io/";
40 description = "Confluent event streaming platform based on Apache Kafka";
41 license = licenses.asl20;
42 maintainers = with maintainers; [ zoedsoupe ];
43 platforms = platforms.unix;
44 };
45}