Date: Friday, September 14, 2018 @ 00:46:03 Author: ffy00 Revision: 380754
upgpkg: code 1.27.2-1 Modified: code/trunk/PKGBUILD code/trunk/code.js code/trunk/code.sh code/trunk/product_json.patch --------------------+ PKGBUILD | 56 +++++++++++++++++++++++++++++++++------------------ code.js | 13 +++++++++-- code.sh | 2 - product_json.patch | 6 +---- 4 files changed, 50 insertions(+), 27 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2018-09-13 23:22:47 UTC (rev 380753) +++ PKGBUILD 2018-09-14 00:46:03 UTC (rev 380754) @@ -4,8 +4,8 @@ pkgname=code pkgdesc='The Open Source build of Visual Studio Code (vscode) editor' -pkgver=1.27.1 -pkgrel=7 +pkgver=1.27.2 +pkgrel=1 arch=('x86_64') url='https://github.com/Microsoft/vscode' license=('MIT') @@ -13,11 +13,13 @@ makedepends=('git' 'gulp' 'npm' 'python2' 'yarn') source=("$pkgname::git+https://github.com/Microsoft/vscode.git#tag=$pkgver" 'code.js' + 'code.sh' 'product_json.patch' 'code-liveshare.patch') sha512sums=('SKIP' - '6f729b01e81d5cba31ee9e7e0275810410bcdbd3514b3956e9c19f4cbe849056fdc6267680cae6f9b28bf85b6b5b09130cf7bdf0db9ae651701efd3b480a22aa' - 'dcf52fa373a787cd94ce7ad216a269de3ca90b3f02cea1d635016d980e765a9cc040776ce4b4ef83721ab6f0d74efb7a3a9ca02fbdf3daa06653c766d36cde08' + 'd6d76d745372466936e516af7cacd146e7c90def5bba2eb03223b740675b810de00fff79a3f1cc8d29277f1d215ead5096aebb5ebeb52d25d8055e9c0d802bb9' + 'a857b52b5075bed2df9860da4a9a7772351a1f4226e1bcac4578c31801caec61c785d30f49785c8816709a8d0b11c12696a49c4942c26d130a10618ce2c73d6b' + '7f85387542987c45a6d0e23424eda9e702dc9c6a789cde96ed6e5d386bd294eae8a6c7b32c7ae18d8071063e83a1033c215d0f5f5e0b1040466ce4b7c3969f2c' '6080b9d30b2c852a831d4fa98be94e42eb7d94dfd5813bbe28410d031191c20563e4288d6b0062c74b635a962c3eba3533fcebeff1f67b4a8005a167c2f7fbf2') # Even though we don't officially support other archs, let's @@ -44,7 +46,7 @@ # This patch no longer contains proprietary modifications. # See https://github.com/Microsoft/vscode/issues/31168 for details. - patch -p1 < ../product_json.patch + patch -p0 < ../product_json.patch # Set the commit and build date local _commit=$(git rev-parse HEAD) @@ -51,15 +53,6 @@ local _datestamp=$(date -u -Is | sed 's/\+00:00/Z/') sed -e "s/@COMMIT@/$_commit/" -e "s/@DATE@/$_datestamp/" -i product.json - # Prepare appdata and desktop file - sed -i 's|/usr/share/@@NAME@@/@@NAME@@|@@NAME@@|g - s|@@NAME_SHORT@@|Code - OSS|g - s|@@NAME_LONG@@|Code|g - s|@@NAME@@|code|g - s|@@ICON@@|code|g - s|@@LICENSE@@|MIT|g - s|inode/directory;||' resources/linux/code.{appdata.xml,desktop} - # See https://github.com/MicrosoftDocs/live-share/issues/262 for details patch -p1 < ../code-liveshare.patch @@ -66,6 +59,15 @@ # Build native modules for system electron local _target=$(</usr/lib/electron/version) sed -i "s/^target .*/target \"${_target//v/}\"/" .yarnrc + + # Patch appdata and desktop file + sed -i 's|/usr/share/@@NAME@@/@@NAME@@|@@NAME@@|g + s|@@NAME_SHORT@@|Code - OSS|g + s|@@NAME_LONG@@|Code|g + s|@@NAME@@|code-oss|g + s|@@ICON@@|code-oss|g + s|@@LICENSE@@|MIT|g + s|inode/directory;||' resources/linux/code.{appdata.xml,desktop} } build() { @@ -72,7 +74,21 @@ cd $pkgname yarn install --arch=$_vscode_arch - node --max_old_space_size=4096 /usr/bin/gulp vscode-linux-$_vscode_arch-min + + # The default memory limit may be too low for current versions of node + # to successfully build vscode. Change it if this number still doesn't + # work for your system. + mem_limit="--max_old_space_size=4096" + + if ! /usr/bin/node $mem_limit /usr/bin/gulp vscode-linux-$_vscode_arch-min + then + echo + echo "*** NOTE: If the build failed due to running out of file handles (EMFILE)," + echo "*** you will need to raise your max open file limit." + echo "*** You can check this for more information on how to increase this limit:" + echo "*** https://ro-che.info/articles/2017-03-26-increase-open-files-limit" + exit 1 + fi } package() { @@ -81,12 +97,14 @@ cp -r --no-preserve=ownership --preserve=mode VSCode-linux-$_vscode_arch/resources/app/* "$pkgdir"/usr/lib/$pkgname/ # Install binary - install -Dm 755 code.js "$pkgdir"/usr/bin/code + install -Dm 755 code.sh "$pkgdir"/usr/bin/code-oss + install -Dm 755 code.js "$pkgdir"/usr/lib/$pkgname/code.js + ln -sf /usr/bin/code-oss "$pkgdir"/usr/bin/code # Install appdata and desktop file - install -Dm 644 code/resources/linux/code.appdata.xml "$pkgdir"/usr/share/metainfo/code.appdata.xml - install -Dm 644 code/resources/linux/code.desktop "$pkgdir"/usr/share/applications/code.desktop - install -Dm 644 VSCode-linux-$_vscode_arch/resources/app/resources/linux/code.png "$pkgdir"/usr/share/pixmaps/code.png + install -Dm 644 code/resources/linux/code.appdata.xml "$pkgdir"/usr/share/metainfo/code-oss.appdata.xml + install -Dm 644 code/resources/linux/code.desktop "$pkgdir"/usr/share/applications/code-oss.desktop + install -Dm 644 VSCode-linux-$_vscode_arch/resources/app/resources/linux/code.png "$pkgdir"/usr/share/pixmaps/code-oss.png # Install license files install -Dm 644 VSCode-linux-$_vscode_arch/resources/app/LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE Modified: code.js =================================================================== --- code.js 2018-09-13 23:22:47 UTC (rev 380753) +++ code.js 2018-09-14 00:46:03 UTC (rev 380754) @@ -1,15 +1,22 @@ #!/usr/bin/electron -const name = 'code' +const name = 'code'; + const app = require('electron').app; const path = require('path'); -// Remove first command line argument (/usr/bin/electron). +// Remove first command line argument (/usr/lib/code/code.js). - We call the CLI file first process.argv.splice(0, 1); // Set application paths. -const appPath = path.join(path.dirname(__dirname), 'lib', name); +const appPath = __dirname; +const packageJson = require(path.join(appPath, 'package.json')); +app.setAppPath(appPath); +app.setDesktopName(name + '.desktop'); app.setName(name); +app.setPath('userCache', path.join(app.getPath('cache'), name)); +app.setPath('userData', path.join(app.getPath('appData'), name)); +app.setVersion(packageJson.version); // Run the application. require('module')._load(appPath, module, true); Modified: code.sh =================================================================== --- code.sh 2018-09-13 23:22:47 UTC (rev 380753) +++ code.sh 2018-09-14 00:46:03 UTC (rev 380754) @@ -1,3 +1,3 @@ #!/bin/bash -electron /usr/lib/code/app/code.js "$@" +exec electron /usr/lib/code/out/cli.js /usr/lib/code/code.js "$@" Modified: product_json.patch =================================================================== --- product_json.patch 2018-09-13 23:22:47 UTC (rev 380753) +++ product_json.patch 2018-09-14 00:46:03 UTC (rev 380754) @@ -1,7 +1,5 @@ -diff --git a/product.json b/product.json -index ed3ced1c1b..df707206d5 100644 ---- a/product.json -+++ b/product.json +--- product.json 2018-09-13 23:01:59.345056949 +0100 ++++ product.json 2018-09-13 23:02:50.748800382 +0100 @@ -21,5 +21,15 @@ "extensionAllowedProposedApi": [ "ms-vscode.node-debug",