2021-12-06 16:07:01 +00:00
|
|
|
{ lib, stdenv, fetchurl, jdk11_headless, makeWrapper, nixosTests, bash, coreutils }:
|
|
|
|
let
|
2024-04-21 15:54:59 +00:00
|
|
|
# Latest supported LTS JDK for Zookeeper 3.9:
|
|
|
|
# https://zookeeper.apache.org/doc/r3.9.2/zookeeperAdmin.html#sc_requiredSoftware
|
2021-12-06 16:07:01 +00:00
|
|
|
jre = jdk11_headless;
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "zookeeper";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "3.9.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-12-25 13:55:36 +00:00
|
|
|
url = "mirror://apache/zookeeper/${pname}-${version}/apache-${pname}-${version}-bin.tar.gz";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha512-K1rgLWGKJ8qM1UkkhV1TRCY7fZ3udgGB+dZrr6kjAyTSrTF4aJXwZUyWncONSj0Ad/dMw3a1i1+i+5S+satEXw==";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-26 19:14:03 +00:00
|
|
|
runHook preInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out
|
2020-12-25 13:55:36 +00:00
|
|
|
cp -R conf docs lib $out
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/bin
|
2020-12-25 13:55:36 +00:00
|
|
|
cp -R bin/{zkCli,zkCleanup,zkEnv,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh $out/bin
|
2020-04-24 23:36:52 +00:00
|
|
|
patchShebangs $out/bin
|
|
|
|
substituteInPlace $out/bin/zkServer.sh \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail /bin/echo ${coreutils}/bin/echo
|
2020-12-25 13:55:36 +00:00
|
|
|
for i in $out/bin/{zkCli,zkCleanup,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh; do
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $i \
|
|
|
|
--set JAVA_HOME "${jre}" \
|
|
|
|
--prefix PATH : "${bash}/bin"
|
|
|
|
done
|
|
|
|
chmod -x $out/bin/zkEnv.sh
|
2021-04-26 19:14:03 +00:00
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
nixos = nixosTests.zookeeper;
|
|
|
|
};
|
|
|
|
inherit jre;
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-12-25 13:55:36 +00:00
|
|
|
homepage = "https://zookeeper.apache.org";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Apache Zookeeper";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://zookeeper.apache.org/doc/r${version}/releasenotes.html";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ nathan-gs pradeepchhetri ztzg ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2024-04-21 15:54:59 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryBytecode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|