1{
2 lib,
3 stdenv,
4 fetchurl,
5 makeWrapper,
6 jdk11_headless,
7 nixosTests,
8}:
9
10let
11 common =
12 {
13 version,
14 hash,
15 jdk ? jdk11_headless,
16 tests,
17 }:
18 stdenv.mkDerivation rec {
19 pname = "hbase";
20 inherit version;
21
22 src = fetchurl {
23 url = "mirror://apache/hbase/${version}/hbase-${version}-bin.tar.gz";
24 inherit hash;
25 };
26
27 nativeBuildInputs = [ makeWrapper ];
28 installPhase = ''
29 mkdir -p $out
30 cp -R * $out
31 wrapProgram $out/bin/hbase --set-default JAVA_HOME ${jdk.home} \
32 --run "test -d /etc/hadoop-conf && export HBASE_CONF_DIR=\''${HBASE_CONF_DIR-'/etc/hadoop-conf/'}" \
33 --set-default HBASE_CONF_DIR "$out/conf/"
34 '';
35
36 passthru = { inherit tests; };
37
38 meta = with lib; {
39 description = "Distributed, scalable, big data store";
40 homepage = "https://hbase.apache.org";
41 license = licenses.asl20;
42 maintainers = with lib.maintainers; [ illustris ];
43 platforms = lib.platforms.linux;
44 };
45 };
46in
47{
48 hbase_2_4 = common {
49 version = "2.4.18";
50 hash = "sha256-zYrHAxzlPRrRchHGVp3fhQT0BD0+wavZ4cAWncrv+MQ=";
51 tests.standalone = nixosTests.hbase_2_4;
52 };
53 hbase_2_5 = common {
54 version = "2.5.11";
55 hash = "sha256-W3o8J+aY2bQoiu1Lr1n5EQWDVoS1OwWTNIUAU03a5Es=";
56 tests.standalone = nixosTests.hbase_2_5;
57 };
58 hbase_2_6 = common {
59 version = "2.6.2";
60 hash = "sha256-X/mjmTAx9anh2U/Xlfuf+O4AO5BXDkdsY69tPddEpYM=";
61 tests.standalone = nixosTests.hbase2;
62 };
63 hbase_3_0 = common {
64 version = "3.0.0-beta-1";
65 hash = "sha256-lmeaH2gDP6sBwZpzROKhR2Je7dcrwnq7qlMUh0B5fZs=";
66 tests.standalone = nixosTests.hbase3;
67 };
68}