Commit 703029e8 authored by Ed Reel's avatar Ed Reel Committed by Chris Thurber

Update code from 1.36.0 to 1.36.1 (#3391)

Add the Marketplace for extensions

Add i686 compatible node version

Add pre-built binary for x86_64
parent 02b3a618
require 'package'
class Code < Package
case ARCH
when 'x86_64'
@arch = 'x64'
when 'i686'
@arch = 'ia32'
when 'armv7l', 'aarch64'
@arch = 'arm'
end
description 'Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS.'
homepage 'https://code.visualstudio.com/'
version '1.36.0'
source_url 'https://github.com/microsoft/vscode/archive/1.36.0.tar.gz'
source_sha256 'c88ad3b41374b4d43fc92eb2bcffba33458f58ccc9b88c26d76028a61c4eb9c8'
version '1.36.1'
source_url 'https://github.com/microsoft/vscode/archive/1.36.1.tar.gz'
source_sha256 '24b9f4046bd8ef7edb663429a58bf7dbe3acc22487a2946a4e5ead216415c065'
binary_url ({
x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/code-1.36.1-chromeos-x86_64.tar.xz',
})
binary_sha256 ({
x86_64: 'cf2b7204aab182cffeafee59972dabf3306754c3d158811492dff39f0959e2ab',
})
depends_on 'nodebrew'
......@@ -31,12 +23,22 @@ class Code < Package
depends_on 'xdg_base'
depends_on 'sommelier'
case ARCH
when 'aarch64', 'armv7l'
@arch = 'arm64'
when 'i686'
@arch = 'ia32'
when 'x86_64'
@arch = 'x64'
end
ENV['PATH'] = "#{ENV['HOME']}/.nodebrew/current/bin:#{ENV['PATH']}"
ENV['LIBRARY_PATH'] = CREW_LIB_PREFIX
def self.build
old_ld = `ld_default b`.chomp
node_ver = 'v10.16.0'
node_ver = 'v9.11.2' if ARCH == 'i686'
node_old = `nodebrew ls | fgrep 'current: ' | cut -d' ' -f2`.chomp
node_ver_installed = `nodebrew ls | grep -o #{node_ver} | head -1`.chomp
system "nodebrew install #{node_ver}" unless node_ver_installed == node_ver
......@@ -54,9 +56,20 @@ class Code < Package
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
system 'mv', "../VSCode-linux-#{@arch}", "#{CREW_DEST_PREFIX}/share/code"
system "sed -i -e '/CLI=/d' -e 's,\"\\$CLI\" ,,g' -e 's,ELECTRON_RUN_AS_NODE=1 ,,g' #{CREW_DEST_PREFIX}/share/code/bin/code-oss"
# ^^^ Do not remove this line.
system "sed -i '42iGDK_BACKEND=x11' #{CREW_DEST_PREFIX}/share/code/bin/code-oss"
system 'ln', '-s', '../share/code/bin/code-oss', "#{CREW_DEST_PREFIX}/bin/code"
system 'ln', '-s', '../share/code/bin/code-oss', "#{CREW_DEST_PREFIX}/bin/code-oss"
# Add the Marketplace for extensions.
system "sed -i '30,31d' #{CREW_DEST_PREFIX}/share/code/resources/app/product.json"
system "cat << 'EOF' >> #{CREW_DEST_PREFIX}/share/code/resources/app/product.json
},
\"extensionsGallery\": {
\"serviceUrl\": \"https://marketplace.visualstudio.com/_apis/public/gallery\",
\"cacheUrl\": \"https://vscode.blob.core.windows.net/gallery/index\",
\"itemUrl\": \"https://marketplace.visualstudio.com/items\"
}
}
EOF"
end
def self.postinstall
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment