2021-11-17 16:11:08 +01:00
|
|
|
{ lib, stdenv, fetchurl, jdk11_headless, makeWrapper, nixosTests, bash, coreutils }:
|
2021-11-17 13:56:20 +01:00
|
|
|
let
|
|
|
|
# Latest supported LTS JDK for Zookeeper 3.6:
|
|
|
|
# https://zookeeper.apache.org/doc/r3.6.3/zookeeperAdmin.html#sc_requiredSoftware
|
|
|
|
jre = jdk11_headless;
|
|
|
|
in
|
2014-08-24 17:43:45 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "zookeeper";
|
2021-04-24 12:07:34 +02:00
|
|
|
version = "3.6.3";
|
2014-08-24 17:43:45 +02:00
|
|
|
|
2016-04-28 02:17:01 +02:00
|
|
|
src = fetchurl {
|
2020-11-23 13:25:45 +01:00
|
|
|
url = "mirror://apache/zookeeper/${pname}-${version}/apache-${pname}-${version}-bin.tar.gz";
|
2021-04-24 12:07:34 +02:00
|
|
|
sha512 = "3f7b1b7d9cf5647d52ad0076c922e108fa956e986b5624667c493cf6d8ff09d3ca88f623c79a799fe49c72e868cb3c9d0f77cb69608de74a183b2cbad10bc827";
|
2016-04-28 02:17:01 +02:00
|
|
|
};
|
2014-08-24 17:43:45 +02:00
|
|
|
|
2021-02-07 10:17:39 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
2014-08-24 17:43:45 +02:00
|
|
|
|
2016-04-28 02:17:01 +02:00
|
|
|
installPhase = ''
|
2021-04-24 12:07:34 +02:00
|
|
|
runHook preInstall
|
2016-04-28 02:17:01 +02:00
|
|
|
mkdir -p $out
|
2020-11-23 13:25:45 +01:00
|
|
|
cp -R conf docs lib $out
|
|
|
|
# Without this, zkCli.sh tries creating a log file in the Nix store.
|
|
|
|
substituteInPlace $out/conf/log4j.properties \
|
|
|
|
--replace 'INFO, RFAAUDIT' 'INFO, CONSOLE'
|
2016-04-28 02:17:01 +02:00
|
|
|
mkdir -p $out/bin
|
2020-11-23 13:25:45 +01:00
|
|
|
cp -R bin/{zkCli,zkCleanup,zkEnv,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh $out/bin
|
2018-07-07 11:33:04 +02:00
|
|
|
patchShebangs $out/bin
|
2019-10-03 11:29:57 +02:00
|
|
|
substituteInPlace $out/bin/zkServer.sh \
|
|
|
|
--replace /bin/echo ${coreutils}/bin/echo
|
2020-11-23 13:25:45 +01:00
|
|
|
for i in $out/bin/{zkCli,zkCleanup,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh; do
|
2016-04-28 02:17:01 +02:00
|
|
|
wrapProgram $i \
|
|
|
|
--set JAVA_HOME "${jre}" \
|
|
|
|
--prefix PATH : "${bash}/bin"
|
|
|
|
done
|
|
|
|
chmod -x $out/bin/zkEnv.sh
|
2021-04-24 12:07:34 +02:00
|
|
|
runHook postInstall
|
2016-04-28 02:17:01 +02:00
|
|
|
'';
|
2014-08-24 17:43:45 +02:00
|
|
|
|
2021-11-17 16:11:08 +01:00
|
|
|
passthru.tests = {
|
|
|
|
nixos = nixosTests.zookeeper;
|
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-11-23 13:25:45 +01:00
|
|
|
homepage = "https://zookeeper.apache.org";
|
2016-04-28 02:17:01 +02:00
|
|
|
description = "Apache Zookeeper";
|
|
|
|
license = licenses.asl20;
|
2020-11-23 13:25:45 +01:00
|
|
|
maintainers = with maintainers; [ nathan-gs cstrahan pradeepchhetri ztzg ];
|
2016-04-28 02:17:01 +02:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2014-08-24 17:43:45 +02:00
|
|
|
}
|