mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
vscode-utils.buildVscodeExtension: support alternative installPhase and sourceRoot
(cherry picked from commit 66c759bd1d)
This commit is contained in:
committed by
github-actions[bot]
parent
7da72809ba
commit
abd17c1f5f
@@ -36,7 +36,7 @@ let
|
||||
nativeBuildInputs ? [ ],
|
||||
passthru ? { },
|
||||
...
|
||||
}:
|
||||
}@args:
|
||||
{
|
||||
pname = "vscode-extension-${pname}";
|
||||
|
||||
@@ -53,21 +53,22 @@ let
|
||||
|
||||
# Some .vsix files contain other directories (e.g., `package`) that we don't use.
|
||||
# If other directories are present but `sourceRoot` is unset, the unpacker phase fails.
|
||||
sourceRoot = "extension";
|
||||
sourceRoot = args.sourceRoot or "extension";
|
||||
|
||||
# This cannot be removed, it is used by some extensions.
|
||||
installPrefix = "share/vscode/extensions/${vscodeExtUniqueId}";
|
||||
|
||||
nativeBuildInputs = [ unzip ] ++ nativeBuildInputs;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
installPhase =
|
||||
args.installPhase or ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p "$out/$installPrefix"
|
||||
find . -mindepth 1 -maxdepth 1 | xargs -d'\n' mv -t "$out/$installPrefix/"
|
||||
mkdir -p "$out/$installPrefix"
|
||||
find . -mindepth 1 -maxdepth 1 | xargs -d'\n' mv -t "$out/$installPrefix/"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user