push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
{
"version": "3.0.31",
"sha256": "sha256-NKElcojNVjAXusDXGlPeFYOzSrS01hZnk0U+1va4EuQ="
}

View File

@@ -0,0 +1,8 @@
{ callPackage, lib, ... }@args:
callPackage ./generic.nix (
args
// lib.importJSON ./3.0.json
// {
generation = "3_0";
}
)

View File

@@ -0,0 +1,4 @@
{
"version": "3.11.18",
"sha256": "sha256-eb9+d1nVQ1mMKY9+O0f1gIIlpxQ8FYQeAU4/Msad5Ro="
}

View File

@@ -0,0 +1,8 @@
{ callPackage, lib, ... }@args:
callPackage ./generic.nix (
args
// lib.importJSON ./3.11.json
// {
generation = "3_11";
}
)

View File

@@ -0,0 +1,4 @@
{
"version": "4.1.8",
"sha256": "sha256-jsMCNuHxTzPki3lYQ5QiRw+Y8JtVJ+8FyAfeQpf4lyE="
}

View File

@@ -0,0 +1,9 @@
# GENERATED BY update.sh
{ callPackage, lib, ... }@args:
callPackage ./generic.nix (
args
// lib.importJSON ./4.json
// {
generation = "4";
}
)

View File

@@ -0,0 +1,146 @@
{
lib,
stdenv,
fetchurl,
python311Packages,
makeWrapper,
gawk,
bash,
getopt,
procps,
which,
jre,
nixosTests,
# generation is the attribute version suffix such as 4 in pkgs.cassandra_4
generation,
version,
sha256,
extraMeta ? { },
callPackage,
...
}:
let
libPath = lib.makeLibraryPath [ stdenv.cc.cc ];
binPath = lib.makeBinPath [
bash
getopt
gawk
which
jre
procps
];
in
stdenv.mkDerivation rec {
pname = "cassandra";
inherit version;
src = fetchurl {
inherit sha256;
url = "mirror://apache/cassandra/${version}/apache-cassandra-${version}-bin.tar.gz";
};
pythonPath = with python311Packages; [ cassandra-driver ];
nativeBuildInputs = [ python311Packages.wrapPython ];
buildInputs = [ python311Packages.python ] ++ pythonPath;
installPhase = ''
runHook preInstall
mkdir $out
mv * $out
# Clean up documentation.
mkdir -p $out/share/doc/${pname}-${version}
mv $out/CHANGES.txt \
$out/LICENSE.txt \
$out/NEWS.txt \
$out/NOTICE.txt \
$out/share/doc/${pname}-${version}
if [[ -d $out/doc ]]; then
mv "$out/doc/"* $out/share/doc/${pname}-${version}
rmdir $out/doc
fi
for cmd in bin/cassandra \
bin/nodetool \
bin/sstablekeys \
bin/sstableloader \
bin/sstablescrub \
bin/sstableupgrade \
bin/sstableutil \
bin/sstableverify; do
# Check if file exists because some don't exist across all versions
if [ -f $out/$cmd ]; then
wrapProgram $out/bin/$(basename "$cmd") \
--suffix-each LD_LIBRARY_PATH : ${libPath} \
--prefix PATH : ${binPath} \
--set JAVA_HOME ${jre}
fi
done
for cmd in tools/bin/cassandra-stress \
tools/bin/cassandra-stressd \
tools/bin/sstabledump \
tools/bin/sstableexpiredblockers \
tools/bin/sstablelevelreset \
tools/bin/sstablemetadata \
tools/bin/sstableofflinerelevel \
tools/bin/sstablerepairedset \
tools/bin/sstablesplit \
tools/bin/token-generator; do
# Check if file exists because some don't exist across all versions
if [ -f $out/$cmd ]; then
makeWrapper $out/$cmd $out/bin/$(basename "$cmd") \
--suffix-each LD_LIBRARY_PATH : ${libPath} \
--prefix PATH : ${binPath} \
--set JAVA_HOME ${jre}
fi
done
runHook postInstall
'';
postFixup = ''
# Remove cassandra bash script wrapper.
# The wrapper searches for a suitable python version and is not necessary with Nix.
rm $out/bin/cqlsh
# Make "cqlsh.py" accessible by invoking "cqlsh"
ln -s $out/bin/cqlsh.py $out/bin/cqlsh
wrapPythonPrograms
'';
passthru = {
tests =
let
test = nixosTests."cassandra_${generation}";
in
{
nixos =
assert test.testPackage.version == version;
test;
};
updateScript = callPackage ./update-script.nix { inherit generation; };
};
meta =
with lib;
{
homepage = "https://cassandra.apache.org/";
description = "Massively scalable open source NoSQL database";
platforms = platforms.unix;
license = licenses.asl20;
sourceProvenance = with sourceTypes; [
binaryBytecode
binaryNativeCode # bundled dependency libsigar
];
maintainers = [ maintainers.roberth ];
}
// extraMeta;
}

View File

@@ -0,0 +1,61 @@
{
git,
lib,
runtimeShell,
writeScript,
generation,
gnupg,
}:
let
inherit (lib) makeBinPath;
filename = lib.strings.replaceStrings [ "_" ] [ "." ] generation + ".json";
regex = lib.strings.replaceStrings [ "_" ] [ "[.]" ] generation;
in
writeScript "update-cassandra_${generation}" ''
#!${runtimeShell}
set -eux -o pipefail
test -d pkgs -a -d nixos -a -d lib || {
echo >&2 "$0 expects to be run in a nixpkgs checkout"
exit 1
}
cd pkgs/servers/nosql/cassandra
PATH="${
makeBinPath [
git
gnupg
]
}:$PATH"
tmp="$(mktemp -d)"
cleanup() {
rm -rf "$tmp"
}
trap cleanup EXIT
# get numeric-only versions, sort them latest first
git ls-remote --tags https://github.com/apache/cassandra \
| awk '{ if (match($0, /refs.tags.cassandra-([0-9.]*)$/, m)) print m[1] }' \
| sort -V \
| tac >$tmp/versions
version="$(grep -E '^${regex}' <$tmp/versions | head -n 1)"
path="cassandra/$version/apache-cassandra-$version-bin.tar.gz"
curl "https://downloads.apache.org/$path" >$tmp/src.tar.gz
curl "https://downloads.apache.org/$path.asc" >$tmp/src.tar.gz.asc
# See https://downloads.apache.org/cassandra/KEYS
# Make sure that any new key corresponds to someone on the project
for key in A4C465FEA0C552561A392A61E91335D77E3E87CB; do
gpg --trustdb-name "$tmp/trust.db" --batch --recv-keys "$key"
echo "$key:5:" | gpg --trustdb-name "$tmp/trust.db" --batch --import-ownertrust
done
gpg --trustdb-name "$tmp/trust.db" --batch --verify --trust-model direct $tmp/src.tar.gz.asc $tmp/src.tar.gz
hash="$(nix-prefetch-url "file://$tmp/src.tar.gz")"
cat >${filename} <<EOF
{
"version": "$version",
"sha256": "$hash"
}
EOF
''