summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 893cc7a296d950d3d4147b5266adce54361d830c (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
# Maintainer: Wil Thomason (wbthomason) <wbthomason@cs.cornell.edu>

pkgname=microsoft-python-language-server-git
pkgver=r955.2aef1f81
pkgrel=1
pkgdesc="Microsoft Language Server for Python"
url="https://github.com/Microsoft/python-language-server"
arch=(any)
license=(Apache)
depends=(dotnet-runtime)
makedepends=(dotnet-sdk git)
conflicts=('microsoft-python-language-server')
provides=('microsoft-python-language-server')
source=("$pkgname::git+$url")
sha256sums=('SKIP')
validpgpkeys=('5DE3E0509C47EA3CF04A42D34AEE18F83AFDEB23')

pkgver() {
  cd "$pkgname"
  ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

prepare() {
  cd $pkgname/src/LanguageServer/Impl
  dotnet restore
}

build() {
  cd $pkgname/src/LanguageServer/Impl
  dotnet build -c Release --no-restore
}

package() {
  cd $pkgname/src/LanguageServer/Impl

  # Returns 1 but reports no error (???)
  dotnet publish -c Release --no-build -o "$pkgdir/usr/lib/$pkgname" || :

  install -D /dev/stdin "$pkgdir/usr/bin/mspyls" <<END
#!/bin/sh
exec dotnet /usr/lib/$pkgname/Microsoft.Python.LanguageServer.dll "\$@"
END
}