nixpkgs/pkgs/servers/zookeeper/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.6 KiB
Nix
Raw Normal View History

2021-11-17 15:11:08 +00:00
{ lib, stdenv, fetchurl, jdk11_headless, makeWrapper, nixosTests, bash, coreutils }:
let
# Latest supported LTS JDK for Zookeeper 3.9:
# https://zookeeper.apache.org/doc/r3.9.2/zookeeperAdmin.html#sc_requiredSoftware
jre = jdk11_headless;
in
2014-08-24 15:43:45 +00:00
stdenv.mkDerivation rec {
pname = "zookeeper";
version = "3.9.2";
2014-08-24 15:43:45 +00:00
2016-04-28 00:17:01 +00:00
src = fetchurl {
url = "mirror://apache/zookeeper/${pname}-${version}/apache-${pname}-${version}-bin.tar.gz";
hash = "sha512-K1rgLWGKJ8qM1UkkhV1TRCY7fZ3udgGB+dZrr6kjAyTSrTF4aJXwZUyWncONSj0Ad/dMw3a1i1+i+5S+satEXw==";
2016-04-28 00:17:01 +00:00
};
2014-08-24 15:43:45 +00:00
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ jre ];
2014-08-24 15:43:45 +00:00
2016-04-28 00:17:01 +00:00
installPhase = ''
runHook preInstall
2016-04-28 00:17:01 +00:00
mkdir -p $out
cp -R conf docs lib $out
2016-04-28 00:17:01 +00:00
mkdir -p $out/bin
cp -R bin/{zkCli,zkCleanup,zkEnv,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh $out/bin
patchShebangs $out/bin
substituteInPlace $out/bin/zkServer.sh \
--replace-fail /bin/echo ${coreutils}/bin/echo
for i in $out/bin/{zkCli,zkCleanup,zkServer,zkSnapShotToolkit,zkTxnLogToolkit}.sh; do
2016-04-28 00:17:01 +00:00
wrapProgram $i \
--set JAVA_HOME "${jre}" \
--prefix PATH : "${bash}/bin"
done
chmod -x $out/bin/zkEnv.sh
runHook postInstall
2016-04-28 00:17:01 +00:00
'';
2014-08-24 15:43:45 +00:00
passthru = {
tests = {
nixos = nixosTests.zookeeper;
};
inherit jre;
2021-11-17 15:11:08 +00:00
};
meta = with lib; {
homepage = "https://zookeeper.apache.org";
2016-04-28 00:17:01 +00:00
description = "Apache Zookeeper";
changelog = "https://zookeeper.apache.org/doc/r${version}/releasenotes.html";
2016-04-28 00:17:01 +00:00
license = licenses.asl20;
maintainers = with maintainers; [ nathan-gs pradeepchhetri ztzg ];
2016-04-28 00:17:01 +00:00
platforms = platforms.unix;
sourceProvenance = with sourceTypes; [ binaryBytecode ];
2016-04-28 00:17:01 +00:00
};
2014-08-24 15:43:45 +00:00
}