From c55bc5bfd3377d54f5b6153d09c033cceadfcc05 Mon Sep 17 00:00:00 2001 From: Raymond Gauthier Date: Tue, 12 Oct 2021 10:35:35 -0400 Subject: [PATCH] teamviewer: refactor executable wrapping This centralizes `PATH` and `LD_LIBRARY_PATH`, avoid multiple layers of wrappers. Refactor as suggested by @Artturin in PR provided patch: . --- .../networking/remote/teamviewer/default.nix | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/networking/remote/teamviewer/default.nix b/pkgs/applications/networking/remote/teamviewer/default.nix index 17e7bdaf1a91..266a80e19e59 100644 --- a/pkgs/applications/networking/remote/teamviewer/default.nix +++ b/pkgs/applications/networking/remote/teamviewer/default.nix @@ -72,19 +72,19 @@ mkDerivation rec { --replace '/lib64/ld-linux-x86-64.so.2' '${glibc.out}/lib/ld-linux-x86-64.so.2' substituteInPlace $out/share/teamviewer/tv_bin/script/tvw_config \ --replace '/var/run/' '/run/' + ''; - wrapProgram $out/share/teamviewer/tv_bin/script/teamviewer \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libXrandr libX11 dbus ]}" - wrapProgram $out/share/teamviewer/tv_bin/teamviewerd \ - --prefix PATH : "${lib.makeBinPath [ getconf ]}" \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libXrandr libX11 dbus ]}" - wrapProgram $out/share/teamviewer/tv_bin/TeamViewer \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libXrandr libX11 dbus ]}" - wrapProgram $out/share/teamviewer/tv_bin/TeamViewer_Desktop \ - --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [libXrandr libX11 libXext libXdamage libXtst libSM libXfixes dbus ]}" + makeWrapperArgs = [ + "--prefix PATH : ${lib.makeBinPath [ getconf ]}" + "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libXrandr libX11 libXext libXdamage libXtst libSM libXfixes dbus ]}" + ]; - wrapQtApp $out/share/teamviewer/tv_bin/script/teamviewer - wrapQtApp $out/bin/teamviewer + postFixup = '' + wrapProgram $out/share/teamviewer/tv_bin/teamviewerd ''${makeWrapperArgs[@]} + # tv_bin/script/teamviewer runs tvw_main which runs tv_bin/TeamViewer + wrapProgram $out/share/teamviewer/tv_bin/script/teamviewer ''${makeWrapperArgs[@]} ''${qtWrapperArgs[@]} + wrapProgram $out/share/teamviewer/tv_bin/teamviewer-config ''${makeWrapperArgs[@]} ''${qtWrapperArgs[@]} + wrapProgram $out/share/teamviewer/tv_bin/TeamViewer_Desktop ''${makeWrapperArgs[@]} ''${qtWrapperArgs[@]} ''; dontStrip = true;