tetrio-desktop: cleanup, fix GApps wrapping

gappsWrapperArgs must be added to wrapProgram in fixup phase
This commit is contained in:
huantian 2022-11-06 17:49:20 -07:00 committed by Yt
parent 3a73976c74
commit cc3ea17877

View file

@ -2,16 +2,17 @@
, lib
, fetchurl
, autoPatchelfHook
, wrapGAppsHook
, alsa-lib
, cups
, libpulseaudio
, libX11
, libXScrnSaver
, libXtst
, mesa
, nss
, gtk3
, libpulseaudio
, systemd
, wrapGAppsHook
}:
stdenv.mkDerivation rec {
@ -37,19 +38,13 @@ stdenv.mkDerivation rec {
libXtst
mesa
nss
gtk3
];
dontWrapGApps = true;
libPath = lib.makeLibraryPath [
alsa-lib
cups
libpulseaudio
libX11
libXScrnSaver
libXtst
mesa
nss
systemd
];
@ -61,15 +56,21 @@ stdenv.mkDerivation rec {
'';
installPhase = ''
runHook preInstall
cp -R $TMP/tetrio-desktop/{usr/share,opt} $out/
wrapProgram $out/opt/TETR.IO/tetrio-desktop \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/TETR.IO
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
'';
postFixup = ''
wrapProgram $out/opt/TETR.IO/tetrio-desktop \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/TETR.IO \
''${gappsWrapperArgs[@]}
'';
meta = with lib; {