about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/editors/vscode/generic.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-04-28 14:39:00 +0000
committerAlyssa Ross <hi@alyssa.is>2021-06-10 08:52:36 +0000
commit693e64ef7421374338ddb1dc12b9573feec75972 (patch)
tree2526ac075d248699c35d63e04499890ee4381f5f /nixpkgs/pkgs/applications/editors/vscode/generic.nix
parent7014df2256694d97093d6f2bb1db340d346dea88 (diff)
parent8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17 (diff)
downloadnixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar.gz
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar.bz2
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar.lz
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar.xz
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.tar.zst
nixlib-693e64ef7421374338ddb1dc12b9573feec75972.zip
Merge commit '8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17'
Diffstat (limited to 'nixpkgs/pkgs/applications/editors/vscode/generic.nix')
-rw-r--r--nixpkgs/pkgs/applications/editors/vscode/generic.nix51
1 files changed, 27 insertions, 24 deletions
diff --git a/nixpkgs/pkgs/applications/editors/vscode/generic.nix b/nixpkgs/pkgs/applications/editors/vscode/generic.nix
index 370d5b1561ce..060078cd57b6 100644
--- a/nixpkgs/pkgs/applications/editors/vscode/generic.nix
+++ b/nixpkgs/pkgs/applications/editors/vscode/generic.nix
@@ -61,37 +61,40 @@ in
     };
 
     buildInputs = [ libsecret libXScrnSaver libxshmfence ]
-      ++ lib.optionals (!stdenv.isDarwin) ([ gtk2 at-spi2-atk wrapGAppsHook ] ++ atomEnv.packages);
+      ++ lib.optionals (!stdenv.isDarwin) ([ gtk2 at-spi2-atk ] ++ atomEnv.packages);
 
     runtimeDependencies = lib.optional (stdenv.isLinux) [ (lib.getLib systemd) fontconfig.lib libdbusmenu ];
 
-    nativeBuildInputs = [unzip] ++ lib.optional (!stdenv.isDarwin) autoPatchelfHook;
+    nativeBuildInputs = [unzip] ++ lib.optionals (!stdenv.isDarwin) [ autoPatchelfHook wrapGAppsHook ];
 
     dontBuild = true;
     dontConfigure = true;
 
-    installPhase =
-      if system == "x86_64-darwin" then ''
-        mkdir -p "$out/Applications/${longName}.app" $out/bin
-        cp -r ./* "$out/Applications/${longName}.app"
-        ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/code" $out/bin/${executableName}
-      '' else ''
-        mkdir -p $out/lib/vscode $out/bin
-        cp -r ./* $out/lib/vscode
-
-        ln -s $out/lib/vscode/bin/${executableName} $out/bin
-
-        mkdir -p $out/share/applications
-        ln -s $desktopItem/share/applications/${executableName}.desktop $out/share/applications/${executableName}.desktop
-        ln -s $urlHandlerDesktopItem/share/applications/${executableName}-url-handler.desktop $out/share/applications/${executableName}-url-handler.desktop
-
-        mkdir -p $out/share/pixmaps
-        cp $out/lib/vscode/resources/app/resources/linux/code.png $out/share/pixmaps/code.png
-
-        # Override the previously determined VSCODE_PATH with the one we know to be correct
-        sed -i "/ELECTRON=/iVSCODE_PATH='$out/lib/vscode'" $out/bin/${executableName}
-        grep -q "VSCODE_PATH='$out/lib/vscode'" $out/bin/${executableName} # check if sed succeeded
-      '';
+    installPhase = ''
+      runHook preInstall
+    '' + (if system == "x86_64-darwin" then ''
+      mkdir -p "$out/Applications/${longName}.app" $out/bin
+      cp -r ./* "$out/Applications/${longName}.app"
+      ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/code" $out/bin/${executableName}
+    '' else ''
+      mkdir -p $out/lib/vscode $out/bin
+      cp -r ./* $out/lib/vscode
+
+      ln -s $out/lib/vscode/bin/${executableName} $out/bin
+
+      mkdir -p $out/share/applications
+      ln -s $desktopItem/share/applications/${executableName}.desktop $out/share/applications/${executableName}.desktop
+      ln -s $urlHandlerDesktopItem/share/applications/${executableName}-url-handler.desktop $out/share/applications/${executableName}-url-handler.desktop
+
+      mkdir -p $out/share/pixmaps
+      cp $out/lib/vscode/resources/app/resources/linux/code.png $out/share/pixmaps/code.png
+
+      # Override the previously determined VSCODE_PATH with the one we know to be correct
+      sed -i "/ELECTRON=/iVSCODE_PATH='$out/lib/vscode'" $out/bin/${executableName}
+      grep -q "VSCODE_PATH='$out/lib/vscode'" $out/bin/${executableName} # check if sed succeeded
+    '') + ''
+      runHook postInstall
+    '';
 
     inherit meta;
   }