Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode npm support #384

Draft
wants to merge 70 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
521a77b
Add vscode-1.94.2 with npm-offline-mirror
Kawanaao Oct 18, 2024
c6c4ac8
make askpass.sh executable
Kawanaao Oct 18, 2024
6806e6c
Update Manifest
Kawanaao Oct 18, 2024
117d122
Use local headers, preinstall css-parser tar
Kawanaao Oct 18, 2024
df677d0
Sudden ctrl+v
Kawanaao Oct 18, 2024
e8f562e
Install css-parser only in offline build
Kawanaao Oct 18, 2024
abf8c81
js-tokens-1.0.1
Kawanaao Oct 18, 2024
cd6cb8b
Manifest update
Kawanaao Oct 18, 2024
db59ea5
Negation in build-online css-parser
Kawanaao Oct 18, 2024
dc3b5d6
reh && reh-web support, skip node version check
Kawanaao Oct 18, 2024
8ab9bf4
Force stdc++20 in native-keymap module
Kawanaao Oct 19, 2024
cbc5c1a
Double quotes
Kawanaao Oct 19, 2024
b0b3dd5
cflags_cc
Kawanaao Oct 19, 2024
15f5f0e
Ensure native-keymap is patched upon installation
Kawanaao Oct 19, 2024
6ca10a7
Trying to pass c++20
Kawanaao Oct 19, 2024
e2118f7
Trying to pass c++20 ,
Kawanaao Oct 19, 2024
1d76c3c
Don't call gyp until patch
Kawanaao Oct 19, 2024
0c746fb
Hydrating npm cache instead of mirror
Kawanaao Oct 22, 2024
67a0f69
Npm options, enable offline mode if build-online disabled
Kawanaao Oct 22, 2024
86ab581
Added die where necessary
Kawanaao Oct 22, 2024
ef784bd
Redirrect info logs to null
Kawanaao Oct 23, 2024
961d74b
Use clean-install
Kawanaao Oct 23, 2024
e6ef239
Patch native-keymap only with the electron-32 use flag
Kawanaao Oct 23, 2024
d096c61
Disabling parallelization of cache hydration
Kawanaao Oct 23, 2024
88cacb7
Cleaned up SRC_URI, reh for offline builds
Kawanaao Oct 24, 2024
7c07636
Fix issue with tar not using gzip format for compression
Kawanaao Oct 24, 2024
3ca96c1
Use system node
Kawanaao Oct 24, 2024
58c7025
Also use system node in all reh helpers
Kawanaao Oct 24, 2024
96faf55
Merge branch 'PF4Public:master' into vscode-npm-support
Kawanaao Oct 25, 2024
b2e3bfb
Preparing for electron 33, mark 32 as stable in NEXT release
Kawanaao Oct 25, 2024
70cfabf
Force mask temp-fix >=app-editors/vscode-1.94.0
Kawanaao Oct 25, 2024
78fb408
Cleanup, 9999 to npm
Kawanaao Oct 26, 2024
eab04e9
Change ELECTRON_SLOT_DEFAULT to stable 30
Kawanaao Oct 27, 2024
c0127da
Dynamic native-keymap version resolution
Kawanaao Oct 27, 2024
ab723bd
Remove all VS_ESBUILD_V
Kawanaao Oct 27, 2024
e03f810
Also use dynamic version for ripgrep
Kawanaao Oct 27, 2024
dc4e6d2
Delete package.use.mask
Kawanaao Oct 27, 2024
bdea95a
node-addon-api sed not needed?
Kawanaao Oct 28, 2024
4928236
ripgrep temporarily needed online, update tree-sitter
Kawanaao Oct 29, 2024
1cafaaa
ln -s ripgrep as some extensions (Todo-Tree as example) reference it …
Kawanaao Oct 30, 2024
1ada620
ln -s ripgrep as some extensions reference bin/rg
Kawanaao Oct 30, 2024
67d2abf
Remove extra ln -s
Kawanaao Oct 30, 2024
9b5d183
Don't use/build .asar files (fix temp-fix) 1/2
Kawanaao Oct 30, 2024
01e2dd2
Remove all .asar files to support temp-fix 2/2
Kawanaao Oct 31, 2024
3acce19
temp-fix
Kawanaao Oct 31, 2024
4b3d7dd
npm install -> npm clean-install
Kawanaao Oct 31, 2024
d4df917
Force npm to regenerate package-lock after updating dependencies
Kawanaao Oct 31, 2024
acd8c24
Add +x for scripts
Kawanaao Nov 1, 2024
940d575
vscode-1.95.{0,1} support
Kawanaao Nov 1, 2024
db2d3e4
Shrinkpack, remove temp-fix
Kawanaao Nov 2, 2024
263a757
Altering only top-level package-locks
Kawanaao Nov 2, 2024
599d57a
Port ebuild to 1.95.{0,1} and 9999
Kawanaao Nov 2, 2024
79e8cf8
Merge branch 'PF4Public:master' into vscode-npm-support
Kawanaao Nov 2, 2024
e185a45
Remove empty ENV
Kawanaao Nov 2, 2024
c5491ce
Purge npm cache after configure stage
Kawanaao Nov 2, 2024
e4999f4
Disable ASAR completely
Kawanaao Nov 2, 2024
8650e77
Prefer system npm and node when building
Kawanaao Nov 2, 2024
249e178
Make ripgrep symlink only during installation?
Kawanaao Nov 3, 2024
61521af
Don't use chmod on rg symlink
Kawanaao Nov 4, 2024
ba43175
Also install mime info from deb
Kawanaao Nov 4, 2024
f00ed86
Remove ln -s and mkdir rg completely
Kawanaao Nov 4, 2024
a23ebf4
Installing node_modules can be memory intensive
Kawanaao Nov 4, 2024
2dd662d
One more ln -s
Kawanaao Nov 5, 2024
3b8cc98
Parallel shrinkpack
Kawanaao Nov 5, 2024
4ab60d1
Remove yarn as dependency
Kawanaao Nov 5, 2024
44be09e
registry.npm.org
Kawanaao Nov 5, 2024
b318d16
Exclude test packages
Kawanaao Nov 5, 2024
6ea24b0
Merge branch 'PF4Public:master' into vscode-npm-support
Kawanaao Nov 6, 2024
bcf856f
vscode-1.95.2
Kawanaao Nov 10, 2024
a01eb3a
Merge branch 'PF4Public:master' into vscode-npm-support
Kawanaao Nov 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
375 changes: 375 additions & 0 deletions app-editors/vscode/Manifest

Large diffs are not rendered by default.

4,435 changes: 4,435 additions & 0 deletions app-editors/vscode/files/shrinkpack-package-lock.json

Large diffs are not rendered by default.

177 changes: 177 additions & 0 deletions app-editors/vscode/files/shrinkpack.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
diff --git a/node_modules/shrinkpack/dist/bin.js b/node_modules/shrinkpack/dist/bin.js
--- a/node_modules/shrinkpack/dist/bin.js
+++ b/node_modules/shrinkpack/dist/bin.js
@@ -8,14 +8,18 @@ var picocolors_1 = __importDefault(require("picocolors"));
var commander_1 = require("commander");
var path_1 = __importDefault(require("path"));
var _1 = require(".");
-var directoryValue = process.cwd();
commander_1.program
.version(require('../package.json').version)
- .arguments('[directory]')
- .action(function (directory) {
- if (directory) {
- directoryValue = path_1["default"].resolve(directory);
- }
+ .arguments('<tgz-directory> <project-directory>')
+ .option('-p, --purge', "Trigger the removal of unused .tgz package files")
+ .action(function (tgzDirectory, projectDirectory, options) {
+ var tgzDirectoryValue = path_1["default"].resolve(tgzDirectory);
+ var projectDirectoryValue = path_1["default"].resolve(projectDirectory);
+ (0, _1.shrinkpack)({
+ tgzDirectory: tgzDirectoryValue,
+ projectDirectory: projectDirectoryValue,
+ purge: !!options.purge
+ });
})
.on('--help', function () {
console.log('');
@@ -26,6 +30,3 @@ commander_1.program
console.log(" ".concat(picocolors_1["default"].gray('12:34'), " Time Taken"));
})
.parse(process.argv);
-(0, _1.shrinkpack)({
- directory: directoryValue
-});
diff --git a/node_modules/shrinkpack/dist/index.js b/node_modules/shrinkpack/dist/index.js
--- a/node_modules/shrinkpack/dist/index.js
+++ b/node_modules/shrinkpack/dist/index.js
@@ -60,22 +60,21 @@ var get_ssri_from_file_1 = require("./lib/get-ssri-from-file");
var get_time_between_1 = require("./lib/get-time-between");
var log_1 = require("./lib/log");
function shrinkpack(_a) {
- var directory = _a.directory;
+ var tgzDirectory = _a.tgzDirectory, projectDirectory = _a.projectDirectory, purge = _a.purge;
return __awaiter(this, void 0, void 0, function () {
- var startTime, _b, lockfilePath, lockfile, wrapDirPath, totalAdded, totalDeleted, wrapDirContents, requiredWrapDirContents, deletions, _c, _d, _i, key, record, name, scopelessName, resolved, wrapFileName, wrapFilePath, shortWrapFilePath, spec, isInWrapDir, isAlreadyWrapped, header, footer, integrity, _e, wrapDirContents_1, wrapDirContents_1_1, filename, filePath, shortPath, nextLockfile;
+ var startTime, _b, lockfilePath, lockfile, totalAdded, totalDeleted, wrapDirContents, requiredWrapDirContents, deletions, _c, _d, _i, key, record, regex, match, name, scopelessName, resolved, wrapFileName, wrapFilePath, spec, isInWrapDir, isAlreadyWrapped, header, footer, integrity, _e, wrapDirContents_1, wrapDirContents_1_1, filename, filePath, shortPath, nextLockfile;
var e_1, _f;
return __generator(this, function (_g) {
switch (_g.label) {
case 0:
startTime = new Date();
- _b = (0, get_lockfile_1.getLockfile)(directory), lockfilePath = _b.lockfilePath, lockfile = _b.lockfile;
- wrapDirPath = (0, path_1.join)(directory, 'node_shrinkpack');
+ _b = (0, get_lockfile_1.getLockfile)(projectDirectory), lockfilePath = _b.lockfilePath, lockfile = _b.lockfile;
totalAdded = 0;
totalDeleted = 0;
- return [4 /*yield*/, (0, promises_1.mkdir)(wrapDirPath, { recursive: true })];
+ return [4 /*yield*/, (0, promises_1.mkdir)(tgzDirectory, { recursive: true })];
case 1:
_g.sent();
- return [4 /*yield*/, (0, promises_1.readdir)(wrapDirPath)];
+ return [4 /*yield*/, (0, promises_1.readdir)(tgzDirectory)];
case 2:
wrapDirContents = _g.sent();
requiredWrapDirContents = {};
@@ -97,16 +96,21 @@ function shrinkpack(_a) {
return [3 /*break*/, 8];
if (!record.resolved && !record.version)
return [3 /*break*/, 8];
- name = key.replace(/^.*node_modules\//g, '');
+ regex = /https:\/\/registry\.npmjs\.org\/(?:@([^/]+)\/)?([^/]+)\/-\/[^/]+\.tgz/;
+ match = record.resolved.match(regex);
+ name = "";
+ if (match)
+ name = match[1] ? "@".concat(match[1], "-").concat(match[2]) : match[2];
+ else
+ name = key.replace(/^.*node_modules\//g, '');
scopelessName = name.replace(/^.+\//, '');
resolved = record.resolved ||
"https://registry.npmjs.org/".concat(name, "/-/").concat(scopelessName, "-").concat(record.version, ".tgz");
- wrapFileName = "".concat(name.replace(/\//g, '_'), "-").concat(record.version, ".tar");
- wrapFilePath = (0, path_1.join)(wrapDirPath, wrapFileName);
- shortWrapFilePath = (0, path_1.relative)(directory, wrapFilePath);
+ wrapFileName = "".concat(name.replace(/\//g, '-'), "-").concat(record.version, ".tgz");
+ wrapFilePath = (0, path_1.join)(tgzDirectory, wrapFileName);
spec = "".concat(name, "@").concat(record.version);
isInWrapDir = wrapDirContents.includes(wrapFileName);
- isAlreadyWrapped = resolved.includes('node_shrinkpack');
+ isAlreadyWrapped = resolved.includes(tgzDirectory);
if (isAlreadyWrapped && !isInWrapDir) {
header = "".concat(spec, " points to ").concat(resolved, " which is missing");
footer = "delete lockfile, reinstall, then run shrinkpack again";
@@ -128,32 +132,34 @@ function shrinkpack(_a) {
log_1.log.download(spec);
totalAdded++;
}
- record.integrity = [record.integrity, integrity].filter(Boolean).join(' ');
- record.resolved = "file:".concat(shortWrapFilePath);
+ record.integrity = [integrity].filter(Boolean).join(' ');
+ record.resolved = "file:".concat(wrapFilePath);
requiredWrapDirContents[wrapFileName] = true;
_g.label = 8;
case 8:
_i++;
return [3 /*break*/, 3];
case 9:
- try {
- for (wrapDirContents_1 = __values(wrapDirContents), wrapDirContents_1_1 = wrapDirContents_1.next(); !wrapDirContents_1_1.done; wrapDirContents_1_1 = wrapDirContents_1.next()) {
- filename = wrapDirContents_1_1.value;
- if (!requiredWrapDirContents[filename]) {
- filePath = (0, path_1.join)(wrapDirPath, filename);
- shortPath = (0, path_1.relative)(directory, filePath);
- log_1.log.deletion(shortPath);
- deletions.push((0, promises_1.rm)(filePath));
- totalDeleted++;
+ if (purge) {
+ try {
+ for (wrapDirContents_1 = __values(wrapDirContents), wrapDirContents_1_1 = wrapDirContents_1.next(); !wrapDirContents_1_1.done; wrapDirContents_1_1 = wrapDirContents_1.next()) {
+ filename = wrapDirContents_1_1.value;
+ if (!requiredWrapDirContents[filename]) {
+ filePath = (0, path_1.join)(tgzDirectory, filename);
+ shortPath = (0, path_1.relative)(projectDirectory, filePath);
+ log_1.log.deletion(shortPath);
+ deletions.push((0, promises_1.rm)(filePath));
+ totalDeleted++;
+ }
}
}
- }
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
- finally {
- try {
- if (wrapDirContents_1_1 && !wrapDirContents_1_1.done && (_f = wrapDirContents_1["return"])) _f.call(wrapDirContents_1);
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
+ finally {
+ try {
+ if (wrapDirContents_1_1 && !wrapDirContents_1_1.done && (_f = wrapDirContents_1["return"])) _f.call(wrapDirContents_1);
+ }
+ finally { if (e_1) throw e_1.error; }
}
- finally { if (e_1) throw e_1.error; }
}
// this is ignored by npm >= 7
lockfile.dependencies = undefined;
diff --git a/node_modules/shrinkpack/dist/lib/from-network.js b/node_modules/shrinkpack/dist/lib/from-network.js
--- a/node_modules/shrinkpack/dist/lib/from-network.js
+++ b/node_modules/shrinkpack/dist/lib/from-network.js
@@ -41,7 +41,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
exports.__esModule = true;
exports.fromNetwork = void 0;
var fs_1 = __importDefault(require("fs"));
-var gunzip_maybe_1 = __importDefault(require("gunzip-maybe"));
var pacote_1 = __importDefault(require("pacote"));
var ssri_1 = __importDefault(require("ssri"));
var stream_1 = require("stream");
@@ -55,18 +54,15 @@ var log_1 = require("./log");
*/
function fromNetwork(resolved, filePath) {
return __awaiter(this, void 0, void 0, function () {
- var $integrity, $unzip, $write, pRequest, pWrite, pIntegrity, pSha512;
+ var $integrity, $write, pRequest, pWrite, pIntegrity, pSha512;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
$integrity = ssri_1["default"].integrityStream();
- $unzip = (0, gunzip_maybe_1["default"])();
$write = fs_1["default"].createWriteStream(filePath);
pRequest = pacote_1["default"].tarball.stream(resolved, function ($download) {
return new Promise(function (resolve, reject) {
- var $contents = resolved.endsWith('.tgz')
- ? $download.pipe($unzip)
- : $download;
+ var $contents = $download;
$download.on('end', resolve);
$download.on('error', reject);
$contents.pipe(new stream_1.PassThrough()).pipe($write);
1 change: 1 addition & 0 deletions app-editors/vscode/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<flag name="electron-30">Build against electron-30 instead of the default one. Use at your own risk!</flag>
<flag name="electron-31">Build against electron-31 instead of the default one. Use at your own risk!</flag>
<flag name="electron-32">Build against electron-32 instead of the default one. Use at your own risk!</flag>
<flag name="electron-33">Build against electron-33 instead of the default one. Use at your own risk!</flag>
<flag name="openvsx">Use Eclipse Open VSX instead of Visual Studio Marketplace</flag>
<flag name="reh">Build Remote Extension Host</flag>
<flag name="reh-web">Build Remote Extension Host for Web</flag>
Expand Down
11 changes: 6 additions & 5 deletions app-editors/vscode/vscode-1.92.2.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ HOMEPAGE="https://github.com/microsoft/vscode"
LICENSE="MIT"
SLOT="0"
VS_RIPGREP_V="1.15.9"
VS_ESBUILD_V="0.23.0"
SRC_URI="!build-online? (
https://codeload.github.com/ramya-rao-a/css-parser/tar.gz/370c480ac103bd17c7bcfb34bf5d577dc40d3660
https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz
Expand Down Expand Up @@ -2234,6 +2233,7 @@ src_configure() {

ebegin "Installing node_modules"
# yarn config set yarn-offline-mirror ${T}/yarn_cache || die
export NODE_OPTIONS="--max-old-space-size=8192 --heapsnapshot-near-heap-limit=5"
OLD_PATH=$PATH
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin/node-gyp-bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin:$PATH"
Expand Down Expand Up @@ -2279,8 +2279,8 @@ src_configure() {
eend $? || die
sed -i "s/\"dependencies\": {/\"dependencies\": {\"@vscode\/ripgrep\": \"^${VS_RIPGREP_V}\",/" package.json || die

#rm extensions/css-language-features/server/test/pathCompletionFixtures/src/data/foo.asar
#rm -rf extensions/css-language-features/server/test > /dev/null || die
rm extensions/css-language-features/server/test/pathCompletionFixtures/src/data/foo.asar
rm -rf extensions/css-language-features/server/test > /dev/null || die

einfo "Editing build/lib/getVersion.js"
sed -i '/.*\!version.*/{s++if \(false\)\{+;h};${x;/./{x;q0};x;q1}' \
Expand Down Expand Up @@ -2311,7 +2311,7 @@ src_compile() {
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}:$PATH"
export PATH
export NODE_OPTIONS="--max-old-space-size=12192 --heapsnapshot-near-heap-limit=5"
export NODE_OPTIONS="--max-old-space-size=8192 --heapsnapshot-near-heap-limit=5"

if use temp-fix; then
node node_modules/gulp/bin/gulp.js vscode-linux-${VSCODE_ARCH}-min || die
Expand Down Expand Up @@ -2379,6 +2379,7 @@ src_install() {
doins "${WORKDIR}"/VSCode-linux-${VSCODE_ARCH}/node_modules.asar
doins -r "${WORKDIR}"/VSCode-linux-${VSCODE_ARCH}/node_modules.asar.unpacked
fperms +x ${VSCODE_HOME}/out/vs/base/node/cpuUsage.sh
fperms +x ${VSCODE_HOME}/extensions/git/dist/askpass.sh
# fperms +x ${VSCODE_HOME}/node_modules.asar.unpacked/node-pty/build/Release/spawn-helper

if use reh; then
Expand All @@ -2396,7 +2397,7 @@ src_install() {
sed -i 's$x-scheme-handler/code-oss$x-scheme-handler/code-oss;x-scheme-handler/vscode$' \
applications/*handler.desktop || die
sed -i 's$/usr/share/code-oss/code-oss$/usr/bin/code-oss$' applications/*.desktop || die
doins -r applications bash-completion pixmaps zsh
doins -r applications bash-completion mime pixmaps zsh

insinto /usr/share/metainfo/
doins appdata/*
Expand Down
7 changes: 4 additions & 3 deletions app-editors/vscode/vscode-1.93.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ HOMEPAGE="https://github.com/microsoft/vscode"
LICENSE="MIT"
SLOT="0"
VS_RIPGREP_V="1.15.9"
VS_ESBUILD_V="0.23.0"
SRC_URI="!build-online? (
https://codeload.github.com/ramya-rao-a/css-parser/tar.gz/370c480ac103bd17c7bcfb34bf5d577dc40d3660
https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz
Expand Down Expand Up @@ -2252,6 +2251,7 @@ src_configure() {

ebegin "Installing node_modules"
# yarn config set yarn-offline-mirror ${T}/yarn_cache || die
export NODE_OPTIONS="--max-old-space-size=8192 --heapsnapshot-near-heap-limit=5"
OLD_PATH=$PATH
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin/node-gyp-bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin:$PATH"
Expand Down Expand Up @@ -2329,7 +2329,7 @@ src_compile() {
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}:$PATH"
export PATH
export NODE_OPTIONS="--max-old-space-size=12192 --heapsnapshot-near-heap-limit=5"
export NODE_OPTIONS="--max-old-space-size=8192 --heapsnapshot-near-heap-limit=5"

if use temp-fix; then
node node_modules/gulp/bin/gulp.js vscode-linux-${VSCODE_ARCH}-min || die
Expand Down Expand Up @@ -2397,6 +2397,7 @@ src_install() {
doins "${WORKDIR}"/VSCode-linux-${VSCODE_ARCH}/node_modules.asar
doins -r "${WORKDIR}"/VSCode-linux-${VSCODE_ARCH}/node_modules.asar.unpacked
fperms +x ${VSCODE_HOME}/out/vs/base/node/cpuUsage.sh
fperms +x ${VSCODE_HOME}/extensions/git/dist/askpass.sh
# fperms +x ${VSCODE_HOME}/node_modules.asar.unpacked/node-pty/build/Release/spawn-helper

if use reh; then
Expand All @@ -2414,7 +2415,7 @@ src_install() {
sed -i 's$x-scheme-handler/code-oss$x-scheme-handler/code-oss;x-scheme-handler/vscode$' \
applications/*handler.desktop || die
sed -i 's$/usr/share/code-oss/code-oss$/usr/bin/code-oss$' applications/*.desktop || die
doins -r applications bash-completion pixmaps zsh
doins -r applications bash-completion mime pixmaps zsh

insinto /usr/share/metainfo/
doins appdata/*
Expand Down
7 changes: 4 additions & 3 deletions app-editors/vscode/vscode-1.93.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ HOMEPAGE="https://github.com/microsoft/vscode"
LICENSE="MIT"
SLOT="0"
VS_RIPGREP_V="1.15.9"
VS_ESBUILD_V="0.23.0"
SRC_URI="!build-online? (
https://codeload.github.com/ramya-rao-a/css-parser/tar.gz/370c480ac103bd17c7bcfb34bf5d577dc40d3660
https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz
Expand Down Expand Up @@ -2252,6 +2251,7 @@ src_configure() {

ebegin "Installing node_modules"
# yarn config set yarn-offline-mirror ${T}/yarn_cache || die
export NODE_OPTIONS="--max-old-space-size=8192 --heapsnapshot-near-heap-limit=5"
OLD_PATH=$PATH
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin/node-gyp-bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin:$PATH"
Expand Down Expand Up @@ -2329,7 +2329,7 @@ src_compile() {
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}/node_modules/npm/bin:$PATH"
PATH="/usr/$(get_libdir)/electron-${ELECTRON_SLOT}:$PATH"
export PATH
export NODE_OPTIONS="--max-old-space-size=12192 --heapsnapshot-near-heap-limit=5"
export NODE_OPTIONS="--max-old-space-size=8192 --heapsnapshot-near-heap-limit=5"

if use temp-fix; then
node node_modules/gulp/bin/gulp.js vscode-linux-${VSCODE_ARCH}-min || die
Expand Down Expand Up @@ -2397,6 +2397,7 @@ src_install() {
doins "${WORKDIR}"/VSCode-linux-${VSCODE_ARCH}/node_modules.asar
doins -r "${WORKDIR}"/VSCode-linux-${VSCODE_ARCH}/node_modules.asar.unpacked
fperms +x ${VSCODE_HOME}/out/vs/base/node/cpuUsage.sh
fperms +x ${VSCODE_HOME}/extensions/git/dist/askpass.sh
# fperms +x ${VSCODE_HOME}/node_modules.asar.unpacked/node-pty/build/Release/spawn-helper

if use reh; then
Expand All @@ -2414,7 +2415,7 @@ src_install() {
sed -i 's$x-scheme-handler/code-oss$x-scheme-handler/code-oss;x-scheme-handler/vscode$' \
applications/*handler.desktop || die
sed -i 's$/usr/share/code-oss/code-oss$/usr/bin/code-oss$' applications/*.desktop || die
doins -r applications bash-completion pixmaps zsh
doins -r applications bash-completion mime pixmaps zsh

insinto /usr/share/metainfo/
doins appdata/*
Expand Down
Loading