2024-04-21 15:54:59 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchzip
|
|
|
|
, dpkg
|
|
|
|
, makeWrapper
|
|
|
|
, callPackage
|
2024-07-31 10:19:44 +00:00
|
|
|
, addDriverRunpath
|
2024-04-21 15:54:59 +00:00
|
|
|
, electron
|
2024-05-15 15:35:15 +00:00
|
|
|
, withTetrioPlus ? false
|
2024-04-21 15:54:59 +00:00
|
|
|
, tetrio-plus ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "tetrio-desktop";
|
|
|
|
version = "9.0.0";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://tetr.io/about/desktop/builds/${lib.versions.major finalAttrs.version}/TETR.IO%20Setup.deb";
|
|
|
|
hash = "sha256-TgegFy+sHjv0ILaiLO1ghyUhKXoj8v43ACJOJhKyI0c=";
|
|
|
|
nativeBuildInputs = [ dpkg ];
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase =
|
|
|
|
let
|
|
|
|
tetrio-plus' =
|
|
|
|
if tetrio-plus == null
|
2024-05-15 15:35:15 +00:00
|
|
|
then
|
|
|
|
callPackage ./tetrio-plus.nix
|
|
|
|
{
|
|
|
|
tetrio-src = finalAttrs.src;
|
|
|
|
tetrio-version = finalAttrs.version;
|
|
|
|
}
|
2024-04-21 15:54:59 +00:00
|
|
|
else tetrio-plus;
|
|
|
|
|
|
|
|
asarPath =
|
|
|
|
if withTetrioPlus
|
|
|
|
then "${tetrio-plus'}/app.asar"
|
|
|
|
else "opt/TETR.IO/resources/app.asar";
|
|
|
|
in
|
|
|
|
''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out
|
|
|
|
cp -r usr/share/ $out
|
|
|
|
|
|
|
|
mkdir -p $out/share/TETR.IO/
|
|
|
|
cp ${asarPath} $out/share/TETR.IO/app.asar
|
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/TETR.IO.desktop \
|
|
|
|
--replace-fail "Exec=/opt/TETR.IO/TETR.IO" "Exec=$out/bin/tetrio"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
makeShellWrapper '${lib.getExe electron}' $out/bin/tetrio \
|
2024-07-31 10:19:44 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${addDriverRunpath.driverLink}/lib \
|
2024-04-21 15:54:59 +00:00
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
|
|
|
|
--add-flags $out/share/TETR.IO/app.asar
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
changelog = "https://tetr.io/about/desktop/history/";
|
|
|
|
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 huantian ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
sourceProvenance = [ lib.sourceTypes.binaryBytecode ];
|
|
|
|
};
|
|
|
|
})
|