From c9d02b7c573774d2ffd2add2192ec92d60a12396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Till=20H=C3=B6ppner?= Date: Fri, 31 Mar 2017 20:19:55 +0200 Subject: [PATCH] vscode: Fix relocation errors LD_PRELOAD was inherited by spawned processes, and caused issues with systems that have older system packages while using fresh user packages. Links out the wrapper script instead of electron binary to expose CLI like on other systems Breaks anything that relies on vscode not detaching --- pkgs/applications/editors/vscode/default.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix index 3031fa1cb0c1b1..c4664060214185 100644 --- a/pkgs/applications/editors/vscode/default.nix +++ b/pkgs/applications/editors/vscode/default.nix @@ -55,7 +55,7 @@ in '' else '' mkdir -p $out/lib/vscode $out/bin cp -r ./* $out/lib/vscode - ln -s $out/lib/vscode/code $out/bin + ln -s $out/lib/vscode/bin/code $out/bin mkdir -p $out/share/applications cp $desktopItem/share/applications/* $out/share/applications @@ -67,11 +67,8 @@ in postFixup = lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") '' patchelf \ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${atomEnv.libPath}:$out/lib/vscode" \ + --set-rpath "${atomEnv.libPath}:${stdenv.lib.makeLibraryPath [libXScrnSaver]}/libXss.so.1:$out/lib/vscode" \ $out/lib/vscode/code - - wrapProgram $out/bin/code \ - --prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1 ''; meta = with stdenv.lib; {