Merge pull request #89196 from eadwu/vscode/76427-fallout

vscode: fix #76427 fallout
This commit is contained in:
Dmitry Kalinkin 2020-06-04 14:31:08 -04:00 committed by GitHub
commit dd8f077ff9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 11 deletions

View file

@ -70,6 +70,6 @@ runCommand "${wrappedPkgName}-with-extensions-${wrappedPkgVersion}" {
ln -sT "${vscode}/share/applications/${executableName}.desktop" "$out/share/applications/${executableName}.desktop" ln -sT "${vscode}/share/applications/${executableName}.desktop" "$out/share/applications/${executableName}.desktop"
ln -sT "${vscode}/share/applications/${executableName}-url-handler.desktop" "$out/share/applications/${executableName}-url-handler.desktop" ln -sT "${vscode}/share/applications/${executableName}-url-handler.desktop" "$out/share/applications/${executableName}-url-handler.desktop"
makeWrapper "${vscode}/bin/${executableName}" "$out/bin/${executableName}" ${lib.optionalString (vscodeExtensions != []) '' makeWrapper "${vscode}/bin/${executableName}" "$out/bin/${executableName}" ${lib.optionalString (vscodeExtensions != []) ''
--add-flags "--extensions-dir ${combinedExtensionsDrv}" --add-flags "--extensions-dir ${combinedExtensionsDrv}/share/vscode/extensions"
''} ''}
'' ''

View file

@ -1,12 +1,7 @@
{ stdenv, lib, buildEnv, writeShellScriptBin, fetchurl, vscode, unzip, jq }: { stdenv, lib, buildEnv, writeShellScriptBin, fetchurl, vscode, unzip, jq }:
let let
extendedPkgVersion = lib.getVersion vscode;
extendedPkgName = lib.removeSuffix "-${extendedPkgVersion}" vscode.name;
buildVscodeExtension = a@{ buildVscodeExtension = a@{
name, name,
namePrefix ? "${extendedPkgName}-extension-",
src, src,
# Same as "Unique Identifier" on the extension's web page. # Same as "Unique Identifier" on the extension's web page.
# For the moment, only serve as unique extension dir. # For the moment, only serve as unique extension dir.
@ -18,14 +13,14 @@ let
buildInputs ? [], buildInputs ? [],
... ...
}: }:
stdenv.mkDerivation ((removeAttrs a [ "vscodeExtUniqueId" ]) // { stdenv.mkDerivation ((removeAttrs a [ "vscodeExtUniqueId" ]) // {
name = namePrefix + name; name = "vscode-extension-${name}";
inherit vscodeExtUniqueId; inherit vscodeExtUniqueId;
inherit configurePhase buildPhase dontPatchELF dontStrip; inherit configurePhase buildPhase dontPatchELF dontStrip;
installPrefix = "share/${extendedPkgName}/extensions/${vscodeExtUniqueId}"; installPrefix = "share/vscode/extensions/${vscodeExtUniqueId}";
buildInputs = [ unzip ] ++ buildInputs; buildInputs = [ unzip ] ++ buildInputs;
@ -80,7 +75,7 @@ let
vscodeDefault = vscode; vscodeDefault = vscode;
}; };
vscodeExts2nix = import ./vscodeExts2nix.nix { vscodeExts2nix = import ./vscodeExts2nix.nix {
inherit lib writeShellScriptBin; inherit lib writeShellScriptBin;
vscodeDefault = vscode; vscodeDefault = vscode;
@ -90,7 +85,7 @@ let
inherit lib buildEnv writeShellScriptBin extensionsFromVscodeMarketplace jq; inherit lib buildEnv writeShellScriptBin extensionsFromVscodeMarketplace jq;
vscodeDefault = vscode; vscodeDefault = vscode;
}; };
in in
{ {
inherit fetchVsixFromVscodeMarketplace buildVscodeExtension inherit fetchVsixFromVscodeMarketplace buildVscodeExtension
buildVscodeMarketplaceExtension extensionFromVscodeMarketplace buildVscodeMarketplaceExtension extensionFromVscodeMarketplace