summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 77aa72b33000659476ebbfe62e314203213fc55e (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
# Maintainer: Kibouo <csonka.mihaly@hotmail.com>
pkgname=rust-analyzer-vscode-git
pkgver=r4319.8de56ec4
pkgrel=1
pkgdesc='An experimental Rust compiler front-end for IDEs (VSCode installation).'
arch=('any')
url='https://github.com/rust-analyzer/rust-analyzer/'
license=('MIT')
depends=('rustup' 'code')
makedepends=('git' 'npm')
provides=("${pkgname}")
conflicts=("${pkgname}" 'rust-analyzer-git')
source=("${pkgname}::git+${url}")
md5sums=('SKIP')
pkgver() {
	cd "${pkgname}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
	cd $pkgname
	cargo build --release

  cd ./editors/code
  npm install
}

package() {
	cd $pkgname
	install -D -m755 "$srcdir/$pkgname/target/release/ra_lsp_server" "$pkgdir/usr/bin/ra_lsp_server"
	install -D -m755 "$srcdir/$pkgname/target/release/ra_cli" "$pkgdir/usr/bin/ra_cli"

  cd ./editors/code
  ./node_modules/vsce/out/vsce package
  code --install-extension ./ra-lsp-0.0.1.vsix
}