1 { lib, stdenv, fetchurl, jdk11_headless, makeWrapper, nixosTests, bash, coreutils }:
3 # Latest supported LTS JDK for Zookeeper 3.9:
4 # https://zookeeper.apache.org/doc/r3.9.2/zookeeperAdmin.html#sc_requiredSoftware
7 stdenv.mkDerivation rec {
12 url = "mirror://apache/zookeeper/${pname}-${version}/apache-${pname}-${version}-bin.tar.gz";
13 hash = "sha512-K1rgLWGKJ8qM1UkkhV1TRCY7fZ3udgGB+dZrr6kjAyTSrTF4aJXwZUyWncONSj0Ad/dMw3a1i1+i+5S+satEXw==";
16 nativeBuildInputs = [ makeWrapper ];
17 buildInputs = [ jre ];
22 cp -R conf docs lib $out
24 cp -R bin/{zkCli,zkCleanup,zkEnv,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh $out/bin
25 patchShebangs $out/bin
26 substituteInPlace $out/bin/zkServer.sh \
27 --replace-fail /bin/echo ${coreutils}/bin/echo
28 for i in $out/bin/{zkCli,zkCleanup,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh; do
30 --set JAVA_HOME "${jre}" \
31 --prefix PATH : "${bash}/bin"
33 chmod -x $out/bin/zkEnv.sh
39 nixos = nixosTests.zookeeper;
45 homepage = "https://zookeeper.apache.org";
46 description = "Apache Zookeeper";
47 changelog = "https://zookeeper.apache.org/doc/r${version}/releasenotes.html";
48 license = licenses.asl20;
49 maintainers = with maintainers; [ nathan-gs pradeepchhetri ztzg ];
50 platforms = platforms.unix;
51 sourceProvenance = with sourceTypes; [ binaryBytecode ];