nixpkgs/pkgs/by-name/te/tetrio-desktop/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

95 lines
2.3 KiB
Nix
Raw Normal View History

2021-11-21 22:54:53 +00:00
{ stdenv
, lib
, fetchurl
, dpkg
2021-11-21 22:54:53 +00:00
, autoPatchelfHook
, wrapGAppsHook
2021-11-21 22:54:53 +00:00
, alsa-lib
, cups
, libGL
2021-11-21 22:54:53 +00:00
, libX11
, libXScrnSaver
, libXtst
, mesa
, nss
, gtk3
, libpulseaudio
2021-11-21 22:54:53 +00:00
, systemd
2024-03-26 06:50:40 +00:00
, 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.
2021-11-21 22:54:53 +00:00
}:
2024-03-26 06:50:40 +00:00
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: {
2021-11-21 22:54:53 +00:00
pname = "tetrio-desktop";
2024-03-16 15:31:03 +00:00
version = "9.0.0";
2021-11-21 22:54:53 +00:00
src = fetchurl {
2024-03-26 06:50:40 +00:00
url = "https://tetr.io/about/desktop/builds/${lib.versions.major finalAttrs.version}/TETR.IO%20Setup.deb";
hash = "sha256-UriLwMB8D+/T32H4rPbkJAy/F/FFhNpd++0AR1lwEfs=";
2021-11-21 22:54:53 +00:00
};
nativeBuildInputs = [
dpkg
2021-11-21 22:54:53 +00:00
autoPatchelfHook
wrapGAppsHook
];
dontWrapGApps = true;
2021-11-21 22:54:53 +00:00
buildInputs = [
alsa-lib
cups
libX11
libXScrnSaver
libXtst
mesa
nss
gtk3
2021-11-21 22:54:53 +00:00
];
unpackCmd = "dpkg -x $curSrc src";
2021-11-21 22:54:53 +00:00
installPhase = ''
runHook preInstall
2021-11-21 22:54:53 +00:00
2024-03-26 06:50:40 +00:00
mkdir -p $out/bin
cp -r opt/ usr/share/ $out
2024-03-26 06:50:40 +00:00
ln -s $out/opt/TETR.IO/TETR.IO $out/bin/tetrio
2021-11-21 22:54:53 +00:00
2024-03-16 15:31:03 +00:00
substituteInPlace $out/share/applications/TETR.IO.desktop \
2024-03-26 06:50:40 +00:00
--replace-fail "Exec=/opt/TETR.IO/TETR.IO" "Exec=$out/bin/tetrio"
runHook postInstall
'';
postFixup = ''
2024-03-16 15:31:03 +00:00
wrapProgram $out/opt/TETR.IO/TETR.IO \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/TETR.IO \
''${gappsWrapperArgs[@]}
2021-11-21 22:54:53 +00:00
'';
2024-03-26 06:50:40 +00:00
meta = {
2021-11-21 22:54:53 +00:00
description = "TETR.IO desktop client";
2024-03-26 06:50:40 +00:00
downloadPage = "https://tetr.io/about/desktop/";
homepage = "https://tetr.io";
license = lib.licenses.unfree;
2021-11-21 22:54:53 +00:00
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!
'';
2024-03-26 06:50:40 +00:00
mainProgram = "tetrio";
maintainers = with lib.maintainers; [ wackbyte ];
2021-11-21 22:54:53 +00:00
platforms = [ "x86_64-linux" ];
};
2024-03-26 06:50:40 +00:00
}))