2022-01-22 01:22:15 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
2023-03-24 00:07:29 +00:00
|
|
|
, dpkg
|
2022-01-22 01:22:15 +00:00
|
|
|
, autoPatchelfHook
|
2022-11-21 17:40:18 +00:00
|
|
|
, wrapGAppsHook
|
2022-01-22 01:22:15 +00:00
|
|
|
, alsa-lib
|
|
|
|
, cups
|
2024-01-02 11:29:13 +00:00
|
|
|
, libGL
|
2022-01-22 01:22:15 +00:00
|
|
|
, libX11
|
|
|
|
, libXScrnSaver
|
|
|
|
, libXtst
|
|
|
|
, mesa
|
|
|
|
, nss
|
2022-11-21 17:40:18 +00:00
|
|
|
, gtk3
|
|
|
|
, libpulseaudio
|
2022-01-22 01:22:15 +00:00
|
|
|
, systemd
|
2022-11-21 17:40:18 +00:00
|
|
|
, callPackage
|
|
|
|
, withTetrioPlus ? false
|
|
|
|
, tetrio-plus ? callPackage ./tetrio-plus.nix { }
|
2022-01-22 01:22:15 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tetrio-desktop";
|
|
|
|
version = "8.0.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2022-02-20 05:27:41 +00:00
|
|
|
url = "https://web.archive.org/web/20211228025517if_/https://tetr.io/about/desktop/builds/TETR.IO%20Setup.deb";
|
2022-01-22 01:22:15 +00:00
|
|
|
name = "tetrio-desktop.deb";
|
|
|
|
sha256 = "1nlblfhrph4cw8rpic9icrs78mzrxyskl7ggyy2i8bk9i07i21xf";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-03-24 00:07:29 +00:00
|
|
|
dpkg
|
2022-01-22 01:22:15 +00:00
|
|
|
autoPatchelfHook
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
dontWrapGApps = true;
|
|
|
|
|
2022-01-22 01:22:15 +00:00
|
|
|
buildInputs = [
|
|
|
|
alsa-lib
|
|
|
|
cups
|
|
|
|
libX11
|
|
|
|
libXScrnSaver
|
|
|
|
libXtst
|
|
|
|
mesa
|
|
|
|
nss
|
2022-11-21 17:40:18 +00:00
|
|
|
gtk3
|
2022-01-22 01:22:15 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
libPath = lib.makeLibraryPath [
|
2024-01-02 11:29:13 +00:00
|
|
|
libGL
|
2022-02-20 05:27:41 +00:00
|
|
|
libpulseaudio
|
2022-01-22 01:22:15 +00:00
|
|
|
systemd
|
|
|
|
];
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
unpackCmd = "dpkg -x $curSrc src";
|
2022-01-22 01:22:15 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2022-11-21 17:40:18 +00:00
|
|
|
runHook preInstall
|
2022-01-22 01:22:15 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
mkdir $out
|
|
|
|
cp -r opt/ usr/share/ $out
|
|
|
|
|
|
|
|
mkdir $out/bin
|
2022-01-22 01:22:15 +00:00
|
|
|
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\""
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = lib.strings.optionalString withTetrioPlus ''
|
2023-03-24 00:07:29 +00:00
|
|
|
cp ${tetrio-plus} $out/opt/TETR.IO/resources/app.asar
|
|
|
|
'';
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/opt/TETR.IO/tetrio-desktop \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/TETR.IO \
|
|
|
|
''${gappsWrapperArgs[@]}
|
2022-01-22 01:22:15 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|