# Contributor: Jakub Jirutka # Maintainer: Jakub Jirutka # # WATCH: https://github.com/luben/zstd-jni/issues/260 pkgname=java-zstd-jni _jarname=zstd-jni pkgver=1.5.5.3 _pkgver=${pkgver%.*}-${pkgver##*.} pkgrel=0 pkgdesc="JNI binding for Zstd" url="https://github.com/luben/zstd-jni" # armhf,armv7,x86: sbt fails # ppc64le: 44/146 tests fail # riscv64: blocked by java-jdk arch="all !armhf !armv7 !ppc64le !riscv64 !x86" license="BSD-2-Clause" depends="java-jre-headless" makedepends=" bash java-jdk " subpackages="$pkgname-native" source="https://github.com/luben/zstd-jni/archive/v$_pkgver/zstd-jni-$_pkgver.tar.gz gcc-flags.patch java-8.patch dont-bundle-native-lib.patch " builddir="$srcdir/$_jarname-$_pkgver" # net: fetches dependencies from Maven repos options="net" # java.security.manager - Allow running sbt with OpenJDK >16 # https://github.com/sbt/sbt/issues/6558 export SBT_OPTS="-ivy $srcdir/.ivy2 -sbt-dir $srcdir/.sbt -sbt-boot $srcdir/.sbt/boot -Djava.security.manager=allow" prepare() { default_prepare HOME="$PWD/.home" ./sbt update } build() { ./sbt compile package } check() { ./sbt test -Djava.library.path="$PWD/target/native/bin" } package() { depends="$depends $pkgname-native=$pkgver-r$pkgrel" # NOTE: zstd-jni expects file named libzstd-jni-x.y.so, not libzstd-jni.so.x.y. install -D -m755 target/native/bin/lib$_jarname-$_pkgver.so -t "$pkgdir"/usr/lib/ ln -s lib$_jarname-$_pkgver.so "$pkgdir"/usr/lib/lib$_jarname.so install -D -m644 target/$_jarname-$_pkgver.jar -t "$pkgdir"/usr/share/java/ ln -s $_jarname-$_pkgver.jar "$pkgdir"/usr/share/java/$_jarname.jar } native() { amove usr/lib } sha512sums=" 2a68b14b233cfd99893da7bdde14d47c86bf211d994bd4eecb2876c98e569e794b2c08f372665fffd46ab410149d25f1c70248867d17c0f25328424b5f479f19 zstd-jni-1.5.5-3.tar.gz 905a725325bd90a564811ffbf085f215cd2935d6a272dce591568517b587cc460637540dfeeba727458566cb7aeaf028a2a88ff438ec2053a27bf2032fcf3db2 gcc-flags.patch 99a1423c6e370eb26048258b2569b4a2c59f29f9dc44bfe3c5234d0d2bbce588c0d541b6624e50edf27bc3062a0ce986422f2d402e305088ce0b8c3c47b9c084 java-8.patch 26a6752f7d91b44e01525fd139ec56da093e5bd9b23a1de8ea096790a632af2ede6be85ca9283af6af125dd026734e7ab46590834be80e80d09352081db1c46f dont-bundle-native-lib.patch "