bombsquad: use the wayback machine for stable links

This commit is contained in:
Peter Hoeg
2024-12-04 09:09:05 +01:00
parent 56d2a40058
commit cbba67d309
+29 -23
View File
@@ -9,7 +9,7 @@
curl,
gnugrep,
libgcc,
makeWrapper,
makeBinaryWrapper,
makeDesktopItem,
autoPatchelfHook,
copyDesktopItems,
@@ -22,38 +22,44 @@ let
{
x86_64-linux = {
name = "BombSquad_Linux_x86_64";
hash = "sha256-aujLYzFcKaW0ff7sRdyJ6SvSQowafWVbmwycQfDQUYY=";
hash = "sha256-ICjaNZSCUbslB5pELbI4e+1zXWrZzkCkv69jLRx4dr0=";
};
aarch-64-linux = {
name = "BombSquad_Linux_Arm64";
hash = "sha256-pPP7QZzToTOQtSxzF7Q3ZzlDjUjQWMBM/y79d6Yf38I=";
hash = "sha256-/m0SOQbHssk0CqZJPRLK9YKphup3dtMqkbWGzqcF0+g=";
};
}
.${stdenv.targetPlatform.system} or (throw "${stdenv.targetPlatform.system} is unsupported.");
in
stdenv.mkDerivation (finalAttrs: {
pname = "bombsquad";
version = "1.7.37";
sourceRoot = ".";
src = fetchurl {
url = "https://files.ballistica.net/bombsquad/builds/${archive.name}_${finalAttrs.version}.tar.gz";
inherit (archive) hash;
};
bombsquadIcon = fetchurl {
url = "https://files.ballistica.net/bombsquad/promo/BombSquadIcon.png";
hash = "sha256-MfOvjVmjhLejrJmdLo/goAM9DTGubnYGhlN6uF2GugA=";
};
nativeBuildInputs = [
python312
in
stdenv.mkDerivation (finalAttrs: {
pname = "bombsquad";
version = "1.7.37";
src = fetchurl {
url = "https://web.archive.org/web/20240825230506if_/https://files.ballistica.net/bombsquad/builds/${archive.name}_${finalAttrs.version}.tar.gz";
inherit (archive) hash;
};
sourceRoot = "${archive.name}_${finalAttrs.version}";
buildInputs = [
SDL2
libgcc
libvorbis
openal
libgcc
makeWrapper
python312
];
nativeBuildInputs = [
autoPatchelfHook
copyDesktopItems
makeBinaryWrapper
];
desktopItems = [
@@ -61,6 +67,7 @@ stdenv.mkDerivation (finalAttrs: {
name = "bombsquad";
genericName = "bombsquad";
desktopName = "BombSquad";
icon = "bombsquad";
exec = "bombsquad";
comment = "An explosive arcade-style party game.";
@@ -71,17 +78,16 @@ stdenv.mkDerivation (finalAttrs: {
installPhase = ''
runHook preInstall
base=${archive.name}_${finalAttrs.version}
mkdir -p $out/bin $out/libexec $out/share/bombsquad/ba_data
install -m755 -D $base/bombsquad $out/bin/bombsquad
install -dm755 $base/ba_data $out/usr/share/bombsquad/ba_data
cp -r $base/ba_data $out/usr/share/bombsquad/
install -Dm555 -t $out/libexec ${finalAttrs.meta.mainProgram}
cp -r ba_data $out/share/bombsquad
wrapProgram "$out/bin/bombsquad" \
makeWrapper "$out/libexec/${finalAttrs.meta.mainProgram}" "$out/bin/${finalAttrs.meta.mainProgram}" \
--add-flags ${lib.escapeShellArg commandLineArgs} \
--add-flags "-d $out/usr/share/bombsquad"
--add-flags "-d $out/share/bombsquad"
install -Dm755 ${finalAttrs.bombsquadIcon} $out/usr/share/icons/hicolor/32x32/apps/bombsquad.png
install -Dm755 ${bombsquadIcon} $out/share/icons/hicolor/1024x1024/apps/bombsquad.png
runHook postInstall
'';