archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / kotlin / repos / community-any / PKGBUILD
blob9b6e77a92c8c447abe287ee2be53df4a626a73d4
1 # Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
2 # Contributor: Romain Gautier <romain.gautier@nimamoh.com>
4 pkgname=kotlin
5 pkgver=1.8.21
6 pkgrel=1
7 pkgdesc='Statically typed programming language that can interoperate with Java'
8 arch=(any)
9 url='https://kotlinlang.org/'
10 license=(APACHE custom)
11 depends=('java-environment>=8')
12 makedepends=(setconf)
13 source=("https://github.com/JetBrains/kotlin/releases/download/v${pkgver/_/-}/kotlin-compiler-${pkgver/_/-}.zip")
14 sha512sums=('359c8d359bd43f68eee9c4fc0c1be473a19c42e4faf147fa42db233ce2ef3544d486f020b58c9ff6bf4857ba4c68275f762478da63c8bcc8628f6be09ea07648')
15 b2sums=('ca5cc9471793bd0acb9dab94461d215788a5b91bea2407081f8b0731e796116f7d16d6925f0a91cd9c40098ddcbc42d98b00a47c494c2bc1b97952d8f549cd90')
17 prepare() {
18   cd ${pkgname}c/bin
20   setconf kotlin      DIR         /usr/bin
21   setconf kotlinc-js  DIR         /usr/bin
22   setconf kotlinc-jvm DIR         /usr/bin
23   setconf kotlinc     KOTLIN_HOME /usr/share/$pkgname
26 package() {
27   cd ${pkgname}c
29   # executables
30   install -Dm755 -t "$pkgdir/usr/bin" bin/kotlin
31   install -Dm755 -t "$pkgdir/usr/bin" bin/kotlinc
32   install -Dm755 -t "$pkgdir/usr/bin" bin/kotlinc-js
33   install -Dm755 -t "$pkgdir/usr/bin" bin/kotlinc-jvm
35   # jar files
36   cd lib
37   install -d "$pkgdir/usr/share/$pkgname/lib"
38   for jar in *.jar; do
39     install -Dm644 "$jar" "$pkgdir/usr/share/$pkgname/lib"
40   done
42   # licenses
43   cd "$srcdir/${pkgname}c/license"
44   install -d "$pkgdir/usr/share/licenses/$pkgname"
45   install -Dm644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname"
46   install -Dm644 NOTICE.txt "$pkgdir/usr/share/licenses/$pkgname"
47   for txt in third_party/*.txt; do
48     install -Dm644 "$txt" "$pkgdir/usr/share/licenses/$pkgname"
49   done
51   # build.txt must be installed for for "-version" to work
52   cd $srcdir/${pkgname}c
53   install -Dm644 build.txt "$pkgdir/usr/share/$pkgname"
56 # getver: github.com/JetBrains/kotlin/releases/latest