diff options
-rw-r--r-- | .SRCINFO | 48 | ||||
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | PKGBUILD | 113 | ||||
-rw-r--r-- | code.desktop | 16 | ||||
-rw-r--r-- | product_json.patch | 22 | ||||
-rw-r--r-- | startup_script.patch | 23 |
6 files changed, 160 insertions, 70 deletions
@@ -1,30 +1,40 @@ +# Generated by mksrcinfo v8 +# Mon Dec 18 22:35:59 UTC 2017 pkgbase = code - pkgdesc = Code editing. Redefined. Visual Studio Code. - pkgver = 1.4.0 - pkgrel = 2 - url = https://code.visualstudio.com/ + pkgdesc = Microsoft Code -- The Open Source build of Visual Studio Code + pkgver = 1.19.0 + pkgrel = 1 + url = https://github.com/Microsoft/vscode arch = i686 arch = x86_64 + arch = armv7h license = MIT - depends = gconf + makedepends = npm + makedepends = nodejs>=6.8.0 + makedepends = gulp + makedepends = python2 + makedepends = git + makedepends = yarn depends = gtk2 + depends = gconf depends = libnotify + depends = libxss + depends = libxtst + depends = libxkbfile depends = nss - provides = vscode - provides = visualstudiocode - provides = visual-studio-code - conflicts = visual-studio-code + depends = alsa-lib + provides = vscode-oss + provides = visual-studio-code-oss + conflicts = vscode-oss conflicts = visual-studio-code-oss - conflicts = visual-studio-code-git - replaces = visual-studio-code - source_i686 = https://az764295.vo.msecnd.net/stable/6276dcb0ae497766056b4c09ea75be1d76a8b679/VSCode-linux-ia32-stable.zip - source_i686 = code.desktop - md5sums_i686 = acba124c25d7ca9356824ee416e72688 - md5sums_i686 = d21422a3633592bac7b22aa7d891d9f2 - source_x86_64 = https://az764295.vo.msecnd.net/stable/6276dcb0ae497766056b4c09ea75be1d76a8b679/VSCode-linux-x64-stable.zip - source_x86_64 = code.desktop - md5sums_x86_64 = 86881a676f8b582886618933d5b55267 - md5sums_x86_64 = d21422a3633592bac7b22aa7d891d9f2 + source = vscode::git+https://github.com/Microsoft/vscode#tag=1.19.0 + source = code.desktop + source = startup_script.patch + source = product_json.patch + sha256sums = SKIP + sha256sums = f472fb49852ae9048966f02278110efbbe451192a8ae312ec05d1c31093a0ff4 + sha256sums = 8b2feded3382e5bf6b5b292c14083bfc536c05cd00f3235dd22b75b67fba134d + sha256sums = 7970996eaddbb0265373e71c5452064465472ebb5bd6a393b94e8b84bde24854 pkgname = code diff --git a/.gitignore b/.gitignore index 870c2aa18702..022fbdd3bca9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -src/ -*.zip -pkg/ -*.pkg.tar.xz +/src/ +/pkg/ +*.tar.xz +*.tar.gz @@ -1,52 +1,85 @@ -# Maintainer: Mateusz Paluszkiewicz <aifam96@gmail.com> +# Maintainer: Michael Hansen <zrax0111 gmail com> +# Contributor: Francisco Magalhães <franmagneto gmail com> pkgname=code -pkgver=1.4.0 -pkgrel=2 -pkgdesc="Code editing. Redefined. Visual Studio Code." -arch=('i686' 'x86_64') -url="https://code.visualstudio.com/" +pkgdesc='Microsoft Code -- The Open Source build of Visual Studio Code' +pkgver=1.19.0 +pkgrel=1 +arch=('i686' 'x86_64' 'armv7h') +url='https://github.com/Microsoft/vscode' license=('MIT') -depends=('gconf' 'gtk2' 'libnotify' 'nss') -provides=('vscode' 'visualstudiocode' 'visual-studio-code') -conflicts=('visual-studio-code' 'visual-studio-code-oss' 'visual-studio-code-git') -replaces=('visual-studio-code') - -_version=6276dcb0ae497766056b4c09ea75be1d76a8b679 -source_x86_64=("https://az764295.vo.msecnd.net/stable/${_version}/VSCode-linux-x64-stable.zip" -"code.desktop") -source_i686=("https://az764295.vo.msecnd.net/stable/${_version}/VSCode-linux-ia32-stable.zip" -"code.desktop") -md5sums_x86_64=('86881a676f8b582886618933d5b55267' -'d21422a3633592bac7b22aa7d891d9f2') -md5sums_i686=('acba124c25d7ca9356824ee416e72688' -'d21422a3633592bac7b22aa7d891d9f2') +makedepends=('npm' 'nodejs>=6.8.0' 'gulp' 'python2' 'git' 'yarn') +depends=('gtk2' 'gconf' 'libnotify' 'libxss' 'libxtst' 'libxkbfile' 'nss' + 'alsa-lib') +conflicts=('vscode-oss' 'visual-studio-code-oss') +provides=('vscode-oss' 'visual-studio-code-oss') -package() { - _pkg=VSCode-linux-x64 - if [ "${CARCH}" = "i686" ]; then - _pkg=VSCode-linux-ia32 - fi +source=("vscode::git+https://github.com/Microsoft/vscode#tag=${pkgver}" + "${pkgname}.desktop" + "startup_script.patch" + "product_json.patch") +sha256sums=('SKIP' + 'f472fb49852ae9048966f02278110efbbe451192a8ae312ec05d1c31093a0ff4' + '8b2feded3382e5bf6b5b292c14083bfc536c05cd00f3235dd22b75b67fba134d' + '7970996eaddbb0265373e71c5452064465472ebb5bd6a393b94e8b84bde24854') + +case "$CARCH" in + i686) + _vscode_arch=ia32 + ;; + x86_64) + _vscode_arch=x64 + ;; + armv7h) + _vscode_arch=arm + ;; + *) + # Needed for mksrcinfo + _vscode_arch=DUMMY + ;; +esac + +prepare() { + cd "${srcdir}/vscode" + + # This patch no longer contains proprietary modifications. + # See https://github.com/Microsoft/vscode/issues/31168 for details. + patch -p1 -i "${srcdir}/product_json.patch" + local _commit=$(cd "${srcdir}/vscode" && git rev-parse HEAD) + local _datestamp=$(date -u -Is | sed 's/\+00:00/Z/') + sed -e "s/@COMMIT@/${_commit}/" -e "s/@DATE@/${_datestamp}/" \ + -i product.json +} + +build() { + cd "${srcdir}/vscode" - # Creating directories - install -dm755 "$pkgdir"/{,usr/{bin,share/{pixmaps,applications,licenses/$pkgname}}} + yarn install --arch=${_vscode_arch} - # Read Write for all users and groups, that repairs problems with icon extension - install -dm777 "$pkgdir"/usr/share/$pkgname + # The default memory limit may be too low for current versions of node + # to successfully build vscode. Uncomment this to set it to 2GB, or + # change it if this number still doesn't work for your system. + mem_limit="--max_old_space_size=2048" + /usr/bin/node $mem_limit /usr/bin/gulp vscode-linux-${_vscode_arch} - # Installing launcher - install -m644 "$srcdir"/$pkgname.desktop "$pkgdir"/usr/share/applications/ + # Patch the startup script to know where the app is installed, rather + # than guessing... + ( cd "${srcdir}/VSCode-linux-${_vscode_arch}" && \ + patch -p1 -i "${srcdir}/startup_script.patch" ) +} - # Copying all files - cp -a "$srcdir"/$_pkg/* "$pkgdir"/usr/share/$pkgname/ - chmod -R 777 "$pkgdir"/usr/share/$pkgname/ +package() { + install -m 0755 -d "${pkgdir}/usr/share/code-oss" + cp -r "${srcdir}/VSCode-linux-${_vscode_arch}"/* "${pkgdir}/usr/share/code-oss" - # Installing icons - install -m644 "$srcdir"/$_pkg/resources/app/resources/linux/code.png "$pkgdir"/usr/share/pixmaps/$pkgname.png + # Put the startup script in /usr/bin + mv "${pkgdir}/usr/share/code-oss/bin" "${pkgdir}/usr" - # Installing license - install -m644 "$srcdir"/$_pkg/resources/app/LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/ + # Add .desktop file + install -D -m644 "${srcdir}/${pkgname}.desktop" \ + "${pkgdir}/usr/share/applications/${pkgname}.desktop" - # Link binary to /usr/bin - ln -s /usr/share/$pkgname/code "$pkgdir"/usr/bin/code + # Install license file + install -D -m644 "${srcdir}/VSCode-linux-${_vscode_arch}/resources/app/LICENSE.txt" \ + "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } diff --git a/code.desktop b/code.desktop index 7e25d6a2ecae..8a15436a0bab 100644 --- a/code.desktop +++ b/code.desktop @@ -1,14 +1,16 @@ [Desktop Entry] -Name=Visual Studio Code +Encoding=UTF-8 +Version=1.0 +Name=Microsoft Code (Open Source) Comment=Code Editing. Redefined. GenericName=Text Editor -Exec=/usr/bin/code %U -Icon=/usr/share/pixmaps/code.png +Exec=/usr/bin/code-oss --unity-launch %F +Icon=/usr/share/code-oss/resources/app/resources/linux/code.png Type=Application StartupNotify=true -StartupWMClass=Code +StartupWMClass=code-oss Categories=Utility;TextEditor;Development;IDE; -MimeType=text/plain; +MimeType=text/plain;inode/directory; Actions=new-window; Keywords=vscode; @@ -23,5 +25,5 @@ Name[ko]=새 창 Name[ru]=Новое окно Name[zh_CN]=新建窗口 Name[zh_TW]=開新視窗 -Exec=/usr/bin/code --new-window %U -Icon=/usr/share/pixmaps/code.png +Exec=/usr/bin/code-oss --new-window %F +Icon=/usr/share/code-oss/resources/app/resources/linux/code.png diff --git a/product_json.patch b/product_json.patch new file mode 100644 index 000000000000..48ed80be3bd8 --- /dev/null +++ b/product_json.patch @@ -0,0 +1,22 @@ +diff -rupN a/product.json b/product.json +--- a/product.json 2016-09-08 14:48:45.419566181 -0700 ++++ b/product.json 2016-09-08 14:49:43.000000000 -0700 +@@ -12,5 +12,15 @@ + "win32AppUserModelId": "Microsoft.CodeOSS", + "darwinBundleIdentifier": "com.visualstudio.code.oss", + "reportIssueUrl": "https://github.com/Microsoft/vscode/issues/new", +- "urlProtocol": "code-oss" +-} +\ No newline at end of file ++ "urlProtocol": "code-oss", ++ "quality": "stable", ++ "extensionsGallery": { ++ "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", ++ "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", ++ "itemUrl": "https://marketplace.visualstudio.com/items" ++ }, ++ "documentationUrl": "https://github.com/microsoft/vscode-docs", ++ "requestFeatureUrl": "https://github.com/Microsoft/vscode/issues", ++ "commit": "@COMMIT@", ++ "date": "@DATE@" ++} diff --git a/startup_script.patch b/startup_script.patch new file mode 100644 index 000000000000..a88aee3b27c6 --- /dev/null +++ b/startup_script.patch @@ -0,0 +1,23 @@ +diff -rupN a/bin/code-oss b/bin/code-oss +--- a/bin/code-oss 2017-04-10 14:45:30.501186879 -0700 ++++ b/bin/code-oss 2017-04-11 09:02:09.934505159 -0700 +@@ -17,18 +17,7 @@ if [ "$(id -u)" = "0" ]; then + fi + fi + +-if [ ! -L $0 ]; then +- # if path is not a symlink, find relatively +- VSCODE_PATH="$(dirname $0)/.." +-else +- if which readlink >/dev/null; then +- # if readlink exists, follow the symlink and find relatively +- VSCODE_PATH="$(dirname $(readlink -f $0))/.." +- else +- # else use the standard install location +- VSCODE_PATH="/usr/share/code-oss" +- fi +-fi ++VSCODE_PATH="/usr/share/code-oss" + + ELECTRON="$VSCODE_PATH/code-oss" + CLI="$VSCODE_PATH/resources/app/out/cli.js" |