summaryrefslogtreecommitdiff
path: root/java/jna/PKGBUILD
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-09-26 16:51:39 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-09-26 16:59:39 -0400
commit706009a7dba502eb03d133afe818c03a43d45108 (patch)
tree7e2d89280294c0f56d62c858c3cd322879dfeb6b /java/jna/PKGBUILD
parente6450f3c0b59d3b51886f62d4fbd28ce66ec769a (diff)
downloadabslibre-706009a7dba502eb03d133afe818c03a43d45108.tar.gz
abslibre-706009a7dba502eb03d133afe818c03a43d45108.tar.bz2
abslibre-706009a7dba502eb03d133afe818c03a43d45108.zip
add java/jna, a dependency of arduino
Diffstat (limited to 'java/jna/PKGBUILD')
-rw-r--r--java/jna/PKGBUILD117
1 files changed, 117 insertions, 0 deletions
diff --git a/java/jna/PKGBUILD b/java/jna/PKGBUILD
new file mode 100644
index 000000000..db5f552cb
--- /dev/null
+++ b/java/jna/PKGBUILD
@@ -0,0 +1,117 @@
+# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>
+
+pkgname=jna
+pkgver=3.4.2
+
+pkgdesc="Provides Java programs easy access to native shared libraries"
+url="https://github.com/twall/jna"
+license=('LGPL')
+source=("git://github.com/twall/jna.git#tag=${pkgver}"
+ 'libre-without-clover.patch'
+ 'bugfix-type-inference.patch'
+ 'webstart-test.keystore')
+
+####
+
+pkgrel=1
+arch=('i686' 'x86_64')
+depends=('java-environment' 'libffi')
+makedepends=('apache-ant' 'zip')
+checkdepends=('junit' 'icedtea-web-java7')
+options=('!makeflags')
+
+unset _JAVA_OPTIONS
+_M2_LOCALREPO='/usr/share/maven/repository'
+. /etc/profile.d/jdk.sh
+
+_ant_options=(
+ '-Ddynlink.native=true' # use the system install of libffi
+)
+
+####
+
+mksource() {
+ cd "$srcdir/jna"
+ find . -name '*.jar' -delete
+ rm -rf dist
+ rm -rf native/libffi # make sure it doesn't cheat
+ rm lib/clover.license
+ rm w32ce-test.lnk
+
+ ln -s /usr/share/java/junit.jar lib/
+
+ # Create an emtpy zip (jar) file
+ cd "$srcdir"
+ touch file
+ zip empty.zip file
+ zip -d empty.zip file
+ rm file
+}
+
+####
+
+build() {
+ mksource
+ cd "$srcdir/jna"
+
+ # Because JNA's release process is ridiculous, it wants a jar file for every
+ # architecture to be present. So let's just dump in an empty jar file!
+ sed -n 's|\s*<zipfileset src="${lib\.native}/\(.*\)"|\1|p' build.xml \
+ | while read jarfile; do
+ cp "$srcdir/empty.zip" lib/native/$jarfile
+ done
+
+ patch -p1 -i "$srcdir/libre-without-clover.patch"
+ patch -p1 -i "$srcdir/bugfix-type-inference.patch"
+
+ # Disable tests that intermittently fail
+ # crashes vm (segfault)
+ sed -i -e 's|testRegisterMethods|no&|' test/com/sun/jna/DirectTest.java
+ # crashes vm, java 7 only (icedtea-7, oracle-jdk-bin-1.7)
+ sed -i -e 's|testGCCallbackOnFinalize|no&|' test/com/sun/jna/CallbacksTest.java
+
+ # Actually build
+ ant "${_ant_options[@]}" dist
+}
+
+check() {
+ cd "$srcdir/jna"
+
+ # Create a foke home directory to trash
+ mkdir "$srcdir/user.home"
+ export _JAVA_OPTIONS="-Duser.home=$srcdir/user.home"
+
+ # The webstart test looks for this config file
+ mkdir -p "$srcdir/user.home/.java/deployment"
+ touch "$srcdir/user.home/.java/deployment/deployment.properties"
+
+ # Trust the cert used for the webstart test
+ mkdir -p "$srcdir/user.home/.icedtea/security"
+ cp "$srcdir/webstart-test.keystore" "$srcdir/user.home/.icedtea/security/trusted.certs"
+
+ _ant_options+=('-Dtests.exclude-patterns=**/DirectTest.java')
+
+ # Run the tests
+ ant "${_ant_options[@]}" test
+}
+
+package() {
+ cd "$srcdir/jna"
+
+ install -d "$pkgdir/usr/share/java/jna"
+
+ for pkg in jna platform; do
+ dir="$_M2_LOCALREPO"/net/java/dev/jna/$pkg/$pkgver
+ install -d "$pkgdir$dir"
+ cp dist/$pkg.jar "$pkgdir$dir/$pkg-$pkgver.jar"
+ cp pom-$pkg.xml "$pkgdir$dir/$pkg-$pkgver.pom"
+ ln -s "$dir/$pkg-$pkgver.jar" "$pkgdir/usr/share/java/jna/$pkg.jar"
+ done
+
+ ln -s jna/jna.jar "$pkgdir/usr/share/java/jna.jar"
+}
+
+md5sums=('SKIP'
+ '3a2f96b868f49ca125b677779e846484'
+ '932d9cb2da1531a2315ae132480683fa'
+ 'b704c7d2cb1fe7a93f8cad8d321d16f8')