Merge pull request #296454 from Kropatz/update-tetrio-desktop

tetrio-desktop: 8.0.0 -> 9.0.0
This commit is contained in:
Pol Dellaiera 2024-03-26 21:40:39 +01:00 committed by GitHub
commit ab14a429cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 94 additions and 126 deletions

View File

@ -0,0 +1,94 @@
{ stdenv
, lib
, fetchurl
, dpkg
, autoPatchelfHook
, wrapGAppsHook
, alsa-lib
, cups
, libGL
, libX11
, libXScrnSaver
, libXtst
, mesa
, nss
, gtk3
, libpulseaudio
, systemd
, withTetrioPlus ? false # For backwards compatibility. At the time of writing, the latest released tetrio plus version is not compatible with tetrio desktop.
, tetrio-plus ? false # For backwards compatibility. At the time of writing, the latest released tetrio plus version is not compatible with tetrio desktop.
}:
lib.warnIf (withTetrioPlus != false) "withTetrioPlus: Currently unsupported with tetrio-desktop 9.0.0. Please remove this attribute."
lib.warnIf (tetrio-plus != false) "tetrio-plus: Currently unsupported with tetrio-desktop 9.0.0. Please remove this attribute."
(let
libPath = lib.makeLibraryPath [
libGL
libpulseaudio
systemd
];
in
stdenv.mkDerivation (finalAttrs: {
pname = "tetrio-desktop";
version = "9.0.0";
src = fetchurl {
url = "https://tetr.io/about/desktop/builds/${lib.versions.major finalAttrs.version}/TETR.IO%20Setup.deb";
hash = "sha256-UriLwMB8D+/T32H4rPbkJAy/F/FFhNpd++0AR1lwEfs=";
};
nativeBuildInputs = [
dpkg
autoPatchelfHook
wrapGAppsHook
];
dontWrapGApps = true;
buildInputs = [
alsa-lib
cups
libX11
libXScrnSaver
libXtst
mesa
nss
gtk3
];
unpackCmd = "dpkg -x $curSrc src";
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r opt/ usr/share/ $out
ln -s $out/opt/TETR.IO/TETR.IO $out/bin/tetrio
substituteInPlace $out/share/applications/TETR.IO.desktop \
--replace-fail "Exec=/opt/TETR.IO/TETR.IO" "Exec=$out/bin/tetrio"
runHook postInstall
'';
postFixup = ''
wrapProgram $out/opt/TETR.IO/TETR.IO \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/TETR.IO \
''${gappsWrapperArgs[@]}
'';
meta = {
description = "TETR.IO desktop client";
downloadPage = "https://tetr.io/about/desktop/";
homepage = "https://tetr.io";
license = lib.licenses.unfree;
longDescription = ''
TETR.IO is a modern yet familiar online stacker.
Play against friends and foes all over the world, or claim a spot on the leaderboards - the stacker future is yours!
'';
mainProgram = "tetrio";
maintainers = with lib.maintainers; [ wackbyte ];
platforms = [ "x86_64-linux" ];
};
}))

View File

@ -1,97 +0,0 @@
{ stdenv
, lib
, fetchurl
, dpkg
, autoPatchelfHook
, wrapGAppsHook
, alsa-lib
, cups
, libGL
, libX11
, libXScrnSaver
, libXtst
, mesa
, nss
, gtk3
, libpulseaudio
, systemd
, callPackage
, withTetrioPlus ? false
, tetrio-plus ? callPackage ./tetrio-plus.nix { }
}:
stdenv.mkDerivation rec {
pname = "tetrio-desktop";
version = "8.0.0";
src = fetchurl {
url = "https://web.archive.org/web/20211228025517if_/https://tetr.io/about/desktop/builds/TETR.IO%20Setup.deb";
name = "tetrio-desktop.deb";
sha256 = "1nlblfhrph4cw8rpic9icrs78mzrxyskl7ggyy2i8bk9i07i21xf";
};
nativeBuildInputs = [
dpkg
autoPatchelfHook
wrapGAppsHook
];
dontWrapGApps = true;
buildInputs = [
alsa-lib
cups
libX11
libXScrnSaver
libXtst
mesa
nss
gtk3
];
libPath = lib.makeLibraryPath [
libGL
libpulseaudio
systemd
];
unpackCmd = "dpkg -x $curSrc src";
installPhase = ''
runHook preInstall
mkdir $out
cp -r opt/ usr/share/ $out
mkdir $out/bin
ln -s $out/opt/TETR.IO/tetrio-desktop $out/bin/
substituteInPlace $out/share/applications/tetrio-desktop.desktop \
--replace "Exec=\"/opt/TETR.IO/tetrio-desktop\"" "Exec=\"$out/opt/TETR.IO/tetrio-desktop\""
runHook postInstall
'';
postInstall = lib.strings.optionalString withTetrioPlus ''
cp ${tetrio-plus} $out/opt/TETR.IO/resources/app.asar
'';
postFixup = ''
wrapProgram $out/opt/TETR.IO/tetrio-desktop \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/TETR.IO \
''${gappsWrapperArgs[@]}
'';
meta = with lib; {
homepage = "https://tetr.io";
downloadPage = "https://tetr.io/about/desktop/";
description = "TETR.IO desktop client";
longDescription = ''
TETR.IO is a modern yet familiar online stacker.
Play against friends and foes all over the world, or claim a spot on the leaderboards - the stacker future is yours!
'';
platforms = [ "x86_64-linux" ];
license = licenses.unfree;
maintainers = with maintainers; [ wackbyte ];
};
}

View File

@ -1,27 +0,0 @@
{ lib, stdenv, fetchzip }:
stdenv.mkDerivation rec {
pname = "tetrio-plus";
version = "0.25.3";
src = fetchzip {
url = "https://gitlab.com/UniQMG/tetrio-plus/uploads/684477053451cd0819e2c84e145966eb/tetrio-plus_0.25.3_app.asar.zip";
sha256 = "sha256-GQgt4GZNeKx/uzmVsuKppW2zg8AAiGqsk2JYJIkqfVE=";
};
installPhase = ''
runHook preInstall
install app.asar $out
runHook postInstall
'';
meta = with lib; {
description = "TETR.IO customization toolkit";
homepage = "https://gitlab.com/UniQMG/tetrio-plus";
license = licenses.mit;
maintainers = with maintainers; [ huantian ];
platforms = [ "x86_64-linux" ];
};
}

View File

@ -37400,8 +37400,6 @@ with pkgs;
portmod = callPackage ../games/portmod { };
tetrio-desktop = callPackage ../games/tetrio-desktop { };
tr-patcher = callPackage ../games/tr-patcher { };
tes3cmd = callPackage ../games/tes3cmd { };