summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e3162fc0067a16924a5a05f957a825b3d82ccbfb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Maintainer: Pierre Carru <aur at carru.fr>
# based on https://github.com/theia-ide/theia-apps/blob/master/theia-docker/Dockerfile#L8
# see also https://spectrum.chat/theia/general/how-to-package-the-browser-example-app~308c1998-2082-4063-ad99-0f1fd3b64d78

pkgname=theia-next
pkgver=20191025
pkgrel=1
arch=('any')
url='https://www.theia-ide.org/'
license=('EPL2')
depends=(nodejs)
makedepends=()

_ms_python_version=2019.5.18875
_ms_python_vsix="ms-python.python-${_ms_python_version}.vsix"

_ms_go_version=0.11.0
_ms_go_vsix="Go-${_ms_go_version}.vsix"

source=(
  "theia"
  "package.json"
  "${_ms_python_vsix}::https://github.com/microsoft/vscode-python/releases/download/${_ms_python_version}/ms-python-release.vsix"
  "${_ms_go_vsix}::https://github.com/microsoft/vscode-go/releases/download/${_ms_go_version}/Go-${_ms_go_version}.vsix"
)
sha1sums=('e567647596a73d032df365ed15cab6da490c4fd4'
          '1e84fc34576beac0d376c9970af1d2403a6c731f'
          '2b0672378cbc96e5cfa778b19b8f0ae92f67686a'
          '5e8066e914792f8d2793e495ce386cd6b2df1afa')
noextract=("${_ms_python_vsix}")
options=(!strip) #to speed up build

prepare() {
  mkdir -p plugins
  mv ${_ms_python_vsix} plugins/
  mv ${_ms_go_vsix} plugins/
}

build() {
  mkdir -p node_modules

  npx yarn
  NODE_OPTIONS="--max_old_space_size=4096" npx yarn theia build

  npx yarn --production --offline
  npx yarn autoclean --init
  echo *.ts >> .yarnclean
  echo *.ts.map >> .yarnclean
  echo *.spec.* >> .yarnclean
  npx yarn autoclean --force
}

package() {
  mkdir -p $pkgdir/opt/
  cp -RL $PWD $pkgdir/opt/theia

  rm $pkgdir/opt/theia/webpack.config.js
  #rm $pkgdir/opt/theia/yarn.lock
  rm $pkgdir/opt/theia/.yarnclean
  #rm $pkgdir/opt/theia/package.json

  install -Dm755 theia "$pkgdir/usr/bin/theia"
}