From a4a2964f7dafcdacf5ba7d160e7194f3cbe912b7 Mon Sep 17 00:00:00 2001 From: Edmund Wu Date: Sun, 27 Jan 2019 20:48:47 -0500 Subject: [PATCH 1/4] vscode-extensions.ms-vscode.cpptools: 0.20.1 -> 0.21.0 (cherry picked from commit baf6ba553f729f063359a59ceb54de11328e0aba) --- pkgs/misc/vscode-extensions/cpptools/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/vscode-extensions/cpptools/default.nix b/pkgs/misc/vscode-extensions/cpptools/default.nix index 06f86582d535..e5b83511e72e 100644 --- a/pkgs/misc/vscode-extensions/cpptools/default.nix +++ b/pkgs/misc/vscode-extensions/cpptools/default.nix @@ -68,8 +68,8 @@ vscode-utils.buildVscodeMarketplaceExtension { mktplcRef = { name = "cpptools"; publisher = "ms-vscode"; - version = "0.20.1"; - sha256 = "1gmnkrn26n57vx2nm5hhalkkl2irak38m2lklgja0bi10jb6y08l"; + version = "0.21.0"; + sha256 = "0zq81xfj4hyz01kcw131fmql1mfs9yrjzcmw8i0yha0hymrgwngv"; }; buildInputs = [ From 4af87382a504148963b1d066a388422fd21a8db3 Mon Sep 17 00:00:00 2001 From: Edmund Wu Date: Sun, 16 Dec 2018 22:09:21 -0500 Subject: [PATCH 2/4] vscode: fix rpath for native modules (cherry picked from commit 919a5f696357f92aa5acb5b57c09dfb20d37852e) --- pkgs/applications/editors/vscode/default.nix | 42 ++++++-------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix index b38b357126fa..b14802774ca9 100644 --- a/pkgs/applications/editors/vscode/default.nix +++ b/pkgs/applications/editors/vscode/default.nix @@ -1,6 +1,8 @@ -{ stdenv, lib, fetchurl, unzip, atomEnv, makeDesktopItem, - gtk2, wrapGAppsHook, libXScrnSaver, libxkbfile, libsecret, - isInsiders ? false }: +{ stdenv, lib, fetchurl, makeDesktopItem +, unzip, libsecret, libXScrnSaver, wrapGAppsHook +, gtk2, atomEnv, at-spi2-atk, autoPatchelfHook +, systemd, fontconfig +, isInsiders ? false }: let executableName = "code" + lib.optionalString isInsiders "-insiders"; @@ -18,16 +20,6 @@ let }.${stdenv.hostPlatform.system}; archive_fmt = if stdenv.hostPlatform.system == "x86_64-darwin" then "zip" else "tar.gz"; - - rpath = lib.concatStringsSep ":" [ - atomEnv.libPath - "${lib.makeLibraryPath [gtk2]}" - "${lib.makeLibraryPath [libsecret]}/libsecret-1.so.0" - "${lib.makeLibraryPath [libXScrnSaver]}/libXss.so.1" - "${lib.makeLibraryPath [libxkbfile]}/libxkbfile.so.1" - "$out/lib/vscode" - ]; - in stdenv.mkDerivation rec { name = "vscode-${version}"; @@ -53,9 +45,12 @@ in categories = "GNOME;GTK;Utility;TextEditor;Development;"; }; - buildInputs = if stdenv.hostPlatform.system == "x86_64-darwin" - then [ unzip libXScrnSaver libsecret ] - else [ wrapGAppsHook libXScrnSaver libxkbfile libsecret ]; + buildInputs = (if stdenv.isDarwin + then [ unzip ] + else [ gtk2 at-spi2-atk wrapGAppsHook ] ++ atomEnv.packages) + ++ [ libsecret libXScrnSaver ]; + + nativeBuildInputs = lib.optional (!stdenv.isDarwin) autoPatchelfHook; installPhase = if stdenv.hostPlatform.system == "x86_64-darwin" then '' @@ -79,19 +74,8 @@ in ''; postFixup = lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") '' - patchelf \ - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${rpath}" \ - $out/lib/vscode/${executableName} - - patchelf \ - --set-rpath "${rpath}" \ - $out/lib/vscode/resources/app/node_modules.asar.unpacked/keytar/build/Release/keytar.node - - patchelf \ - --set-rpath "${rpath}" \ - "$out/lib/vscode/resources/app/node_modules.asar.unpacked/native-keymap/build/Release/\ - keymapping.node" + wrapProgram $out/lib/vscode/${executableName} \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ systemd fontconfig ]} ln -s ${lib.makeLibraryPath [libsecret]}/libsecret-1.so.0 $out/lib/vscode/libsecret-1.so.0 ''; From 23689934dcac745fb63e67a1662e557d10cc17be Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sat, 9 Feb 2019 23:03:48 -0500 Subject: [PATCH 3/4] vscode: minor cleanup, produce one wrapper on linux I removed the hack for libsecret, introduced in[0] and I didn't encounter any problems at runtime. [0]: https://github.com/NixOS/nixpkgs/pull/29127 (cherry picked from commit d9b14864a54ebdb4d36961226bd5260996ada2eb) --- pkgs/applications/editors/vscode/default.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix index b14802774ca9..56e4994cc738 100644 --- a/pkgs/applications/editors/vscode/default.nix +++ b/pkgs/applications/editors/vscode/default.nix @@ -7,11 +7,13 @@ let executableName = "code" + lib.optionalString isInsiders "-insiders"; + inherit (stdenv.hostPlatform) system; + plat = { "i686-linux" = "linux-ia32"; "x86_64-linux" = "linux-x64"; "x86_64-darwin" = "darwin"; - }.${stdenv.hostPlatform.system}; + }.${system}; sha256 = { "i686-linux" = "1g73fay6fxlqhalkqq5m6rjbp68k9npk0rrxrkhdj8mw0cz74dpm"; @@ -19,7 +21,7 @@ let "x86_64-darwin" = "07r52scs1sgafzxqal39r8vf9p9qqvwwx8f6z09gqcf6clr6k48q"; }.${stdenv.hostPlatform.system}; - archive_fmt = if stdenv.hostPlatform.system == "x86_64-darwin" then "zip" else "tar.gz"; + archive_fmt = if system == "x86_64-darwin" then "zip" else "tar.gz"; in stdenv.mkDerivation rec { name = "vscode-${version}"; @@ -52,8 +54,11 @@ in nativeBuildInputs = lib.optional (!stdenv.isDarwin) autoPatchelfHook; + dontBuild = true; + dontConfigure = true; + installPhase = - if stdenv.hostPlatform.system == "x86_64-darwin" then '' + if system == "x86_64-darwin" then '' mkdir -p $out/lib/vscode $out/bin cp -r ./* $out/lib/vscode ln -s $out/lib/vscode/Contents/Resources/app/bin/${executableName} $out/bin @@ -73,11 +78,8 @@ in cp $out/lib/vscode/resources/app/resources/linux/code.png $out/share/pixmaps/code.png ''; - postFixup = lib.optionalString (stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux") '' - wrapProgram $out/lib/vscode/${executableName} \ - --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ systemd fontconfig ]} - - ln -s ${lib.makeLibraryPath [libsecret]}/libsecret-1.so.0 $out/lib/vscode/libsecret-1.so.0 + preFixup = lib.optionalString (system == "i686-linux" || system == "x86_64-linux") '' + gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ systemd fontconfig ]}) ''; meta = with stdenv.lib; { From 2475906e4a0d02d07b3d10adfca805be313f1aab Mon Sep 17 00:00:00 2001 From: Edmund Wu Date: Wed, 6 Feb 2019 17:17:41 -0500 Subject: [PATCH 4/4] vscode: 1.30.2 -> 1.31.0 (cherry picked from commit ea679302a5a866575683d84653f933f43cd461bc) --- pkgs/applications/editors/vscode/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix index 56e4994cc738..ff9d0a45b862 100644 --- a/pkgs/applications/editors/vscode/default.nix +++ b/pkgs/applications/editors/vscode/default.nix @@ -16,16 +16,16 @@ let }.${system}; sha256 = { - "i686-linux" = "1g73fay6fxlqhalkqq5m6rjbp68k9npk0rrxrkhdj8mw0cz74dpm"; - "x86_64-linux" = "0mil8n5i2ajdyrgq862wq59ajy2122rvvn7m7mxq4ab92sk26rix"; - "x86_64-darwin" = "07r52scs1sgafzxqal39r8vf9p9qqvwwx8f6z09gqcf6clr6k48q"; - }.${stdenv.hostPlatform.system}; + "i686-linux" = "09mgvff27iljj9z7h0xxmr6152hcxh7qqxl3i7wdc55ra1rsjq1n"; + "x86_64-linux" = "1gvlvg3cjsscx6khy5gxd4wnb069kska00qdfwcq4kn7x1z04xnz"; + "x86_64-darwin" = "1mf9nyjnxgmzai7rfd1rkwk0wvil0ripg3mh8icg4mld2jjz8rsy"; + }.${system}; archive_fmt = if system == "x86_64-darwin" then "zip" else "tar.gz"; in stdenv.mkDerivation rec { name = "vscode-${version}"; - version = "1.30.2"; + version = "1.31.0"; src = fetchurl { name = "VSCode_${version}_${plat}.${archive_fmt}"; @@ -97,6 +97,7 @@ in homepage = http://code.visualstudio.com/; downloadPage = https://code.visualstudio.com/Updates; license = licenses.unfree; + maintainers = with maintainers; [ eadwu ]; platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; }; }