about summary refs log tree commit diff
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@users.noreply.github.com>2019-02-09 23:03:48 -0500
committerworldofpeace <worldofpeace@users.noreply.github.com>2019-02-10 19:52:42 +0000
commitd9b14864a54ebdb4d36961226bd5260996ada2eb (patch)
tree387b3eaa82fd6bbb8d9a82c323106091d71c530e
parent919a5f696357f92aa5acb5b57c09dfb20d37852e (diff)
downloadnixlib-d9b14864a54ebdb4d36961226bd5260996ada2eb.tar
nixlib-d9b14864a54ebdb4d36961226bd5260996ada2eb.tar.gz
nixlib-d9b14864a54ebdb4d36961226bd5260996ada2eb.tar.bz2
nixlib-d9b14864a54ebdb4d36961226bd5260996ada2eb.tar.lz
nixlib-d9b14864a54ebdb4d36961226bd5260996ada2eb.tar.xz
nixlib-d9b14864a54ebdb4d36961226bd5260996ada2eb.tar.zst
nixlib-d9b14864a54ebdb4d36961226bd5260996ada2eb.zip
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
-rw-r--r--pkgs/applications/editors/vscode/default.nix18
1 files changed, 10 insertions, 8 deletions
diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix
index f64a22e642d2..662363cbfba8 100644
--- a/pkgs/applications/editors/vscode/default.nix
+++ b/pkgs/applications/editors/vscode/default.nix
@@ -9,11 +9,13 @@ let
   longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
   shortName = "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";
@@ -21,7 +23,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}";
@@ -82,8 +84,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
@@ -105,11 +110,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; {