summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3a84e9bfb26955194ba419ace52175bcb64d3e15 (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: Ricardo Grim Cabrita <grimkriegor@krutt.org>

pkgname=java-language-server-git
_pkgname=java-language-server
pkgver=0.2.33.r1622.4502b51d
pkgrel=1
pkgdesc="Java language server using the Java compiler API"
arch=('any')
url="https://github.com/georgewfraser/java-language-server.git"
license=('MIT')
conflicts=('java-language-server')
provides=('java-language-server')
depends=('java-runtime=14')
makedepends=('java-environment=14' 'maven' 'git')
source=("${_pkgname}::git+${url}"
        "launcher.sh")
sha256sums=('SKIP'
            '26eb4214d744c16cd4e8976e495f6cad8c7c98d4ffad3ec79b71b6241e0a1bbf')


pkgver() {
  cd "$_pkgname"
  printf "%s.r%s.%s" \
    "$(sed -nE 's/^\s*"version": "(.*?)",$/\1/p' package.json)" \
    "$(git rev-list --count HEAD)" \
    "$(git rev-parse --short HEAD)"
}

build() {
    export JAVA_HOME="/usr/lib/jvm/java-14-openjdk"
    cd "${srcdir}/${_pkgname}"
    ./scripts/link_linux.sh
    mvn package -DskipTests
}

package() {
    mkdir -p \
      "${pkgdir}/usr/share/java" \
      "${pkgdir}/usr/bin"
    cp -r \
      "${srcdir}/${_pkgname}/dist" \
      "${pkgdir}/usr/share/java/java-language-server"
    install \
      "${srcdir}/launcher.sh" \
      "${pkgdir}/usr/bin/java-language-server"
}