2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl, jre, makeWrapper, bash, coreutils, runtimeShell }:
|
2014-08-24 16:43:45 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "zookeeper";
|
2020-11-23 12:25:45 +00:00
|
|
|
version = "3.6.2";
|
2014-08-24 16:43:45 +01:00
|
|
|
|
2016-04-28 01:17:01 +01:00
|
|
|
src = fetchurl {
|
2020-11-23 12:25:45 +00:00
|
|
|
url = "mirror://apache/zookeeper/${pname}-${version}/apache-${pname}-${version}-bin.tar.gz";
|
|
|
|
sha512 = "caff5111bb6876b7124760bc006e6fa2523efa54b99321a3c9cd8192ea0d5596abc7d70a054b1aac9b20a411407dae7611c7aba870c23bff28eb1643ba499199";
|
2016-04-28 01:17:01 +01:00
|
|
|
};
|
2014-08-24 16:43:45 +01:00
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ jre ];
|
2014-08-24 16:43:45 +01:00
|
|
|
|
2016-04-28 01:17:01 +01:00
|
|
|
phases = ["unpackPhase" "installPhase"];
|
2014-08-24 16:43:45 +01:00
|
|
|
|
2016-04-28 01:17:01 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
2020-11-23 12:25:45 +00: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 01:17:01 +01:00
|
|
|
mkdir -p $out/bin
|
2020-11-23 12:25:45 +00:00
|
|
|
cp -R bin/{zkCli,zkCleanup,zkEnv,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh $out/bin
|
2018-07-07 10:33:04 +01:00
|
|
|
patchShebangs $out/bin
|
2019-10-03 10:29:57 +01:00
|
|
|
substituteInPlace $out/bin/zkServer.sh \
|
|
|
|
--replace /bin/echo ${coreutils}/bin/echo
|
2020-11-23 12:25:45 +00:00
|
|
|
for i in $out/bin/{zkCli,zkCleanup,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh; do
|
2016-04-28 01:17:01 +01:00
|
|
|
wrapProgram $i \
|
|
|
|
--set JAVA_HOME "${jre}" \
|
|
|
|
--prefix PATH : "${bash}/bin"
|
|
|
|
done
|
|
|
|
chmod -x $out/bin/zkEnv.sh
|
|
|
|
'';
|
2014-08-24 16:43:45 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-11-23 12:25:45 +00:00
|
|
|
homepage = "https://zookeeper.apache.org";
|
2016-04-28 01:17:01 +01:00
|
|
|
description = "Apache Zookeeper";
|
|
|
|
license = licenses.asl20;
|
2020-11-23 12:25:45 +00:00
|
|
|
maintainers = with maintainers; [ nathan-gs cstrahan pradeepchhetri ztzg ];
|
2016-04-28 01:17:01 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2014-08-24 16:43:45 +01:00
|
|
|
}
|