From 20781aa192bbc1c4f483e59fa1fa7115cbace0b9 Mon Sep 17 00:00:00 2001 From: huantian Date: Mon, 6 Mar 2023 23:34:17 -0700 Subject: [PATCH] tetrio-desktop: use dpkg for unpack, cleanup --- pkgs/games/tetrio-desktop/default.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/games/tetrio-desktop/default.nix b/pkgs/games/tetrio-desktop/default.nix index 221f0160ca95..a48f2b22138a 100644 --- a/pkgs/games/tetrio-desktop/default.nix +++ b/pkgs/games/tetrio-desktop/default.nix @@ -1,6 +1,7 @@ { stdenv , lib , fetchurl +, dpkg , autoPatchelfHook , wrapGAppsHook , alsa-lib @@ -29,10 +30,13 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ + dpkg autoPatchelfHook wrapGAppsHook ]; + dontWrapGApps = true; + buildInputs = [ alsa-lib cups @@ -44,24 +48,20 @@ stdenv.mkDerivation rec { gtk3 ]; - dontWrapGApps = true; - libPath = lib.makeLibraryPath [ libpulseaudio systemd ]; - unpackPhase = '' - mkdir -p $TMP/tetrio-desktop $out/bin - cp $src $TMP/tetrio-desktop.deb - ar vx $TMP/tetrio-desktop.deb - tar --no-overwrite-dir -xvf data.tar.xz -C $TMP/tetrio-desktop/ - ''; + unpackCmd = "dpkg -x $curSrc src"; installPhase = '' runHook preInstall - cp -R $TMP/tetrio-desktop/{usr/share,opt} $out/ + 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 \ @@ -71,8 +71,8 @@ stdenv.mkDerivation rec { ''; postInstall = lib.strings.optionalString withTetrioPlus '' - cp ${tetrio-plus} $out/opt/TETR.IO/resources/app.asar - ''; + cp ${tetrio-plus} $out/opt/TETR.IO/resources/app.asar + ''; postFixup = '' wrapProgram $out/opt/TETR.IO/tetrio-desktop \