summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 189b9b49856425664b1e23fd3513d5fe5da557c3 (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
# Maintainer: kageru <kageru at encode dot moe>
_pkgname=ki-shell
_srcdir=kotlin-interactive-shell
pkgname=ki-shell-git
pkgver=0.3.3.r14.g0cc592d.kotlin1.5.21
pkgrel=1
pkgdesc="Kotlin Language Interactive Shell"
arch=('any')
url='https://github.com/Kotlin/kotlin-interactive-shell'
license=('Apache')
depends=('sh' 'java-runtime>=8')
makedepends=('maven' 'awk' 'kotlin>=1.4.32')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("${_srcdir}::git+https://github.com/Kotlin/kotlin-interactive-shell.git")
sha256sums=('SKIP')

# Build against system Kotlin version because upstream is very slow to update
_kotlin_version="$(kotlin -version | awk '{ split($3, a, "-"); print a[1] }')"

build() {
  cd "${_srcdir}"
  echo "#!/bin/sh
java -jar /usr/lib/${_pkgname}/${_pkgname}.jar" > ki
  mvn -Dkotlin.version=${_kotlin_version} -DskipTests package
}

pkgver() {
  cd "${_srcdir}"
  version=$(git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//')
  echo "$version.kotlin$_kotlin_version" | tr ' :/-' .
}

package() {
  cd "${_srcdir}"
  install -Dm644 "lib/${_pkgname}.jar" -t "${pkgdir}/usr/lib/${_pkgname}"
  install -Dm755 "ki" -t "${pkgdir}/usr/bin"
}