cassandra: refactor versioning

This change:
- refactors the packages so it is easier to create and update new versions of
  cassandra.
- fixes a bug where Cassandra will not connect to another member unless
  LD_PRELOADing libstdc++.so. Without that change, it generates a stack trace
  and dies with exceptions regarding org.xerial.snappy.
- restricts platform to linux as procps is also linux only.
This commit is contained in:
Casey Ransom 2016-07-22 15:34:43 -04:00
parent 4ab5728ec9
commit 6ce28ca5c0
5 changed files with 61 additions and 193 deletions

View File

@ -1,52 +1,6 @@
{ stdenv
, fetchurl
, jre
, python
, makeWrapper
, gawk
, bash
, getopt
, procps
}:
let
{ callPackage, ... } @ args:
callPackage ./generic.nix (args // {
version = "1.2.19";
sha256 = "0zkq3ggpk8ra2siar43vmrn6lmvn902p1g2lrgb46ak1vii6w30w";
in
stdenv.mkDerivation rec {
name = "cassandra-${version}";
src = fetchurl {
inherit sha256;
url = "mirror://apache/cassandra/${version}/apache-${name}-bin.tar.gz";
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir $out
mv * $out
for cmd in cassandra nodetool sstablekeys sstableloader sstableupgrade
do wrapProgram $out/bin/$cmd \
--set JAVA_HOME ${jre} \
--prefix PATH : ${bash}/bin \
--prefix PATH : ${getopt}/bin \
--prefix PATH : ${gawk}/bin \
--prefix PATH : ${procps}/bin
done
wrapProgram $out/bin/cqlsh --prefix PATH : ${python}/bin
'';
meta = with stdenv.lib; {
homepage = http://cassandra.apache.org/;
description = "A massively scalable open source NoSQL database";
platforms = platforms.all;
license = licenses.asl20;
maintainers = with maintainers; [ bcarrell ];
};
}
})

View File

@ -1,52 +1,6 @@
{ stdenv
, fetchurl
, jre
, python
, makeWrapper
, gawk
, bash
, getopt
, procps
}:
let
{ callPackage, ... } @ args:
callPackage ./generic.nix (args // {
version = "2.0.16";
sha256 = "1fpvgmakmxy1lnygccpc32q53pa36bwy0lqdvb6hsifkxymdw8y5";
in
stdenv.mkDerivation rec {
name = "cassandra-${version}";
src = fetchurl {
inherit sha256;
url = "mirror://apache/cassandra/${version}/apache-${name}-bin.tar.gz";
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir $out
mv * $out
for cmd in cassandra nodetool sstablekeys sstableloader sstableupgrade
do wrapProgram $out/bin/$cmd \
--set JAVA_HOME ${jre} \
--prefix PATH : ${bash}/bin \
--prefix PATH : ${getopt}/bin \
--prefix PATH : ${gawk}/bin \
--prefix PATH : ${procps}/bin
done
wrapProgram $out/bin/cqlsh --prefix PATH : ${python}/bin
'';
meta = with stdenv.lib; {
homepage = http://cassandra.apache.org/;
description = "A massively scalable open source NoSQL database";
platforms = platforms.all;
license = licenses.asl20;
maintainers = with maintainers; [ nckx rushmorem ];
};
}
})

View File

@ -1,52 +1,6 @@
{ stdenv
, fetchurl
, jre
, python
, makeWrapper
, gawk
, bash
, getopt
, procps
}:
let
{ callPackage, ... } @ args:
callPackage ./generic.nix (args // {
version = "2.1.15";
sha256 = "1yc6r4gmxz9c4zghzn6bz5wswz7dz61w7p4x9s5gqnixfp2mlapp";
in
stdenv.mkDerivation rec {
name = "cassandra-${version}";
src = fetchurl {
inherit sha256;
url = "mirror://apache/cassandra/${version}/apache-${name}-bin.tar.gz";
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir $out
mv * $out
for cmd in cassandra nodetool sstablekeys sstableloader sstableupgrade
do wrapProgram $out/bin/$cmd \
--set JAVA_HOME ${jre} \
--prefix PATH : ${bash}/bin \
--prefix PATH : ${getopt}/bin \
--prefix PATH : ${gawk}/bin \
--prefix PATH : ${procps}/bin
done
wrapProgram $out/bin/cqlsh --prefix PATH : ${python}/bin
'';
meta = with stdenv.lib; {
homepage = http://cassandra.apache.org/;
description = "A massively scalable open source NoSQL database";
platforms = platforms.all;
license = licenses.asl20;
maintainers = with maintainers; [ nckx rushmorem ];
};
}
})

View File

@ -1,49 +1,6 @@
{ stdenv
, fetchurl
, jre
, python
, makeWrapper
, gawk
, bash
, getopt
, procps
}:
let
{ callPackage, ... } @ args:
callPackage ./generic.nix (args // {
version = "3.0.8";
sha256 = "02chk8q3pbl0y6rijfk2gbd0p1ani8daypsx9m9ingqkdx8ajljq";
in
stdenv.mkDerivation rec {
name = "cassandra-${version}";
src = fetchurl {
inherit sha256;
url = "mirror://apache/cassandra/${version}/apache-${name}-bin.tar.gz";
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir $out
mv * $out
for cmd in cassandra nodetool sstableloader sstableupgrade
do wrapProgram $out/bin/$cmd \
--set JAVA_HOME ${jre} \
--prefix PATH : ${stdenv.lib.makeBinPath [ bash getopt gawk procps ]}
done
wrapProgram $out/bin/cqlsh --prefix PATH : ${python}/bin
'';
meta = with stdenv.lib; {
homepage = http://cassandra.apache.org/;
description = "A massively scalable open source NoSQL database";
platforms = platforms.all;
license = licenses.asl20;
maintainers = with maintainers; [ nckx rushmorem ];
};
}
})

View File

@ -0,0 +1,49 @@
{ stdenv, fetchurl, python, makeWrapper, gawk, bash, getopt, procps
, which, jre, version, sha256, ...
}:
let
libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc ];
binPath = stdenv.lib.makeBinPath [ bash getopt gawk procps which jre ];
in
stdenv.mkDerivation rec {
name = "cassandra-${version}";
src = fetchurl {
inherit sha256;
url = "mirror://apache/cassandra/${version}/apache-${name}-bin.tar.gz";
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir $out
mv * $out
for cmd in bin/cassandra bin/nodetool bin/sstablekeys \
bin/sstableloader bin/sstableupgrade \
tools/bin/cassandra-stress tools/bin/cassandra-stressd \
tools/bin/sstablemetadata tools/bin/sstableofflinerelevel \
tools/bin/token-generator tools/bin/sstablelevelreset; do
# check if file exists because some bin tools don't exist across all
# cassandra versions
if [ -f $out/$cmd ]; then
wrapProgram $out/$cmd \
--suffix-each LD_LIBRARY_PATH : ${libPath} \
--prefix PATH : ${binPath} \
--set JAVA_HOME ${jre}
fi
done
wrapProgram $out/bin/cqlsh --prefix PATH : ${python}/bin
'';
meta = with stdenv.lib; {
homepage = http://cassandra.apache.org/;
description = "A massively scalable open source NoSQL database";
platforms = platforms.linux;
license = licenses.asl20;
maintainers = with maintainers; [ nckx rushmorem cransom ];
};
}