13 # generation is the attribute version suffix such as 3_11 in pkgs.cassandra_3_11
23 libPath = lib.makeLibraryPath [ stdenv.cc.cc ];
24 binPath = lib.makeBinPath [
34 stdenv.mkDerivation rec {
40 url = "mirror://apache/cassandra/${version}/apache-cassandra-${version}-bin.tar.gz";
43 nativeBuildInputs = [ makeWrapper ];
51 # Clean up documentation.
52 mkdir -p $out/share/doc/${pname}-${version}
57 $out/share/doc/${pname}-${version}
59 if [[ -d $out/doc ]]; then
60 mv "$out/doc/"* $out/share/doc/${pname}-${version}
65 for cmd in bin/cassandra \
73 # Check if file exists because some don't exist across all versions
74 if [ -f $out/$cmd ]; then
75 wrapProgram $out/bin/$(basename "$cmd") \
76 --suffix-each LD_LIBRARY_PATH : ${libPath} \
77 --prefix PATH : ${binPath} \
78 --set JAVA_HOME ${jre}
82 for cmd in tools/bin/cassandra-stress \
83 tools/bin/cassandra-stressd \
84 tools/bin/sstabledump \
85 tools/bin/sstableexpiredblockers \
86 tools/bin/sstablelevelreset \
87 tools/bin/sstablemetadata \
88 tools/bin/sstableofflinerelevel \
89 tools/bin/sstablerepairedset \
90 tools/bin/sstablesplit \
91 tools/bin/token-generator; do
92 # Check if file exists because some don't exist across all versions
93 if [ -f $out/$cmd ]; then
94 makeWrapper $out/$cmd $out/bin/$(basename "$cmd") \
95 --suffix-each LD_LIBRARY_PATH : ${libPath} \
96 --prefix PATH : ${binPath} \
97 --set JAVA_HOME ${jre}
101 wrapProgram $out/bin/cqlsh --prefix PATH : ${python}/bin
109 test = nixosTests."cassandra_${generation}";
113 assert test.testPackage.version == version;
117 updateScript = callPackage ./update-script.nix { inherit generation; };
121 homepage = "https://cassandra.apache.org/";
122 description = "A massively scalable open source NoSQL database";
123 platforms = platforms.unix;
124 license = licenses.asl20;
125 maintainers = [ maintainers.roberth ];