aboutsummaryrefslogblamecommitdiffstats
path: root/community/java-jna/APKBUILD
blob: 4363527e907c15093f8dab0cc3ac6d34e6f3aef8 (plain) (tree)
1
2
3
4
5
6
7
8
9



                                               
            
        

                                                                            
          

                           
                                                                           






                                                                                                       
                       
 


                                                          
                                                                    

                                                                                 
                           
 


                                                   













                                                                 
                                          

                                                    
                                                              



                                                                           




                                                                                    
                       

                                                       
                                                   


                                                          

                                                                                                                                                                   
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=java-jna
_pkgname=${pkgname#java-}
pkgver=4.5.0
pkgrel=0
pkgdesc="JNA provides Java programs easy access to native shared libraries."
url="https://github.com/java-native-access/jna"
arch="all"
license="ASL-2.0 LGPL-2.1"
depends="openjdk8-jre-base"
makedepends="apache-ant autoconf automake libffi-dev>=3.2 libtool openjdk8"
subpackages="$pkgname-native"
source="$pkgname-$pkgver.tar.gz::https://github.com/java-native-access/$_pkgname/archive/$pkgver.tar.gz
	0001-jar-without-natives.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	default_prepare

	cd "$builddir"

	# Disable Java AWT support (requires some X libs).
	sed -i -E "s/^(CDEFINES=.*)$/\1 -DNO_JAWT/g" native/Makefile

	# Remove bundled libffi sources, we're gonna use headers form libffi-dev.
	rm -r native/libffi

	# Remove some bundled JARs.
	rm -r dist
	find lib/native -name "*.jar" -exec rm {} +
}

build() {
	cd "$builddir"

	ant clean

	# Parallel build doesn't work here!
	MAKEFLAGS="-j1" \
		ant native -Drelease=true -Ddynlink.native=true \
		&& ant jar -Domit-jnilib=true
}

package() {
	depends="$depends $pkgname-native"

	install -m644 -D "$builddir"/build/jna.jar \
		"$pkgdir"/usr/share/java/$_pkgname-$pkgver.jar
	ln -sf $_pkgname-$pkgver.jar "$pkgdir"/usr/share/java/$_pkgname.jar
}

native() {
	local soname="libjnidispatch.so"

	cd "$builddir"

	local sover="$(sed -En 's/^JNA_JNI_VERSION=([^ ]+).*/\1/p' native/Makefile)"
	[ -n "$sover" ]

	install -m755 -D build/native-linux-*/$soname \
		"$subpkgdir"/usr/lib/$soname.$sover
	ln -sf $soname.$sover "$subpkgdir"/usr/lib/$soname
}

sha512sums="70dd106e828643538ce464b077dd6a7fd8b0e1bdce595f5f03d76adbc61c422433ad56b4e2f37794b52bfdbc4753633de0eb6ce4f20061ef2566c7353be89d5d  java-jna-4.5.0.tar.gz
dacfa03e1a957172502dd10007445e844df67288fde07f7ada80a5cbfe3186511aa7a866c8c757a0a94c894829fead9c67ad0993f2105d2fef1f18d22ee01cdb  0001-jar-without-natives.patch"