From 0d06290e3f50302e84798c172004e73cbf125311 Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Fri, 2 Sep 2016 17:19:13 +0000 Subject: community/java-snappy: fix build on aarch64 and enable on all archs --- community/java-snappy/APKBUILD | 14 ++-- .../java-snappy/add-linux-aarch64-support.patch | 75 ++++++++++++++++++++++ 2 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 community/java-snappy/add-linux-aarch64-support.patch (limited to 'community/java-snappy') diff --git a/community/java-snappy/APKBUILD b/community/java-snappy/APKBUILD index bfb7bb30a2..63a5a87b42 100644 --- a/community/java-snappy/APKBUILD +++ b/community/java-snappy/APKBUILD @@ -4,16 +4,17 @@ pkgname=java-snappy _pkgname=snappy-java pkgver=1.1.2.6 _libver=${pkgver%.*} -pkgrel=0 +pkgrel=1 pkgdesc="Snappy compressor/decompressor for Java" url="https://github.com/xerial/snappy-java" -arch="x86_64 x86" +arch="all" license="ASL-2.0" depends="openjdk8-jre-base" makedepends="bash openjdk8 perl snappy-dev>=$_libver" subpackages="$pkgname-native" source="$pkgname-$pkgver.tar.gz::https://github.com/xerial/$_pkgname/archive/$pkgver.tar.gz 0001-unbundle-snappy.patch + add-linux-aarch64-support.patch " builddir="$srcdir/$_pkgname-$pkgver" @@ -61,8 +62,11 @@ native() { } md5sums="8938dc2d64ec7405581faa454bdf8ed2 java-snappy-1.1.2.6.tar.gz -1bf623f419c1103bce8a76ef129e974b 0001-unbundle-snappy.patch" +1bf623f419c1103bce8a76ef129e974b 0001-unbundle-snappy.patch +2c4aa1f420e29f55c77a98d4fb7bba9a add-linux-aarch64-support.patch" sha256sums="404fa39e5337f08b5c80b20b45096af805b5abb3ded126ef63e43ba4538e8d6e java-snappy-1.1.2.6.tar.gz -d624485186c880d7a7ede00b81e70ae345b9f429a218dd49bb85d3a9fb837cfe 0001-unbundle-snappy.patch" +d624485186c880d7a7ede00b81e70ae345b9f429a218dd49bb85d3a9fb837cfe 0001-unbundle-snappy.patch +3ed5fd2840bb0d41744cb2f803d50fe376b5424c7f6f6bb4b21902541fa69dc7 add-linux-aarch64-support.patch" sha512sums="647c7942249fd08d402538da5442bbbbd6a3fc2d6173999253ebcf270e8dea5135a2c702c12ea1f170e3e187f0092270d9d7db28593c438c58a7eb9dd2ca157c java-snappy-1.1.2.6.tar.gz -23aa84f1bee4f2a419402912e17ee04259f37a41a2eac9a6cc271d7a87899778a196b9bbcced856335bb56ea905bd6448f4ef39da9cbd8c83882506651e13a9c 0001-unbundle-snappy.patch" +23aa84f1bee4f2a419402912e17ee04259f37a41a2eac9a6cc271d7a87899778a196b9bbcced856335bb56ea905bd6448f4ef39da9cbd8c83882506651e13a9c 0001-unbundle-snappy.patch +4575f146a2a25284381978e8e6de920c904bc8055e4814821b68668fd74c2beef77efa33486a3564896ce0010c1d70d71b936f6623edc74fb27c14c9647ab416 add-linux-aarch64-support.patch" diff --git a/community/java-snappy/add-linux-aarch64-support.patch b/community/java-snappy/add-linux-aarch64-support.patch new file mode 100644 index 0000000000..63b92f5694 --- /dev/null +++ b/community/java-snappy/add-linux-aarch64-support.patch @@ -0,0 +1,75 @@ +From cfb114f92f720ab13966eef71f11644ba9dfa5d3 Mon Sep 17 00:00:00 2001 +From: "Santiago M. Mola" +Date: Mon, 7 Mar 2016 21:03:54 +0100 +Subject: [PATCH] Add Linux aarch64 support. + +diff --git a/Makefile.common b/Makefile.common +index e152b68..d198b1f 100755 +--- a/Makefile.common ++++ b/Makefile.common +@@ -42,7 +42,7 @@ endif + + # os=Default is meant to be generic unix/linux + +-known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armhf Linux-ppc Linux-ppc64 Linux-s390 Linux-s390x Mac-x86 Mac-x86_64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64 ++known_os_archs := Linux-x86 Linux-x86_64 Linux-arm Linux-armhf Linux-aarch64 Linux-ppc Linux-ppc64 Linux-s390 Linux-s390x Mac-x86 Mac-x86_64 FreeBSD-x86_64 Windows-x86 Windows-x86_64 SunOS-x86 SunOS-sparc SunOS-x86_64 AIX-ppc AIX-ppc64 + os_arch := $(OS_NAME)-$(OS_ARCH) + IBM_JDK_7 := $(findstring IBM, $(shell $(JAVA) -version 2>&1 | grep IBM | grep "JRE 1.7")) + +@@ -200,6 +200,13 @@ Linux-armhf_LINKFLAGS := -shared -static-libgcc + Linux-armhf_LIBNAME := libsnappyjava.so + Linux-armhf_SNAPPY_FLAGS:= + ++Linux-aarch64_CXX := $(CROSS_PREFIX)g++ ++Linux-aarch64_STRIP := $(CROSS_PREFIX)strip ++Linux-aarch64_CXXFLAGS := -include lib/inc_linux/jni_md.h -I$(JAVA_HOME)/include -O2 -fPIC -fvisibility=hidden ++Linux-aarch64_LINKFLAGS := -shared -static-libgcc ++Linux-aarch64_LIBNAME := libsnappyjava.so ++Linux-aarch64_SNAPPY_FLAGS:= ++ + Mac-x86_CXX := g++ -arch i386 + Mac-x86_STRIP := strip -x + Mac-x86_CXXFLAGS := -Ilib/inc_mac -I$(JAVA_HOME)/include -O2 -fPIC -mmacosx-version-min=10.4 -fvisibility=hidden +diff --git a/README.md b/README.md +index 89b40ec..977af0d 100755 +--- a/README.md ++++ b/README.md +@@ -146,7 +146,7 @@ Older snapshots of snappy contain a buggy config.h.in that does not work properl + ## Cross-compiling for other platforms + The Makefile contains rules for cross-compiling the native library for other platforms so that the snappy-java JAR can support multiple platforms. For example, to build the native libraries for x86 Linux, x86 and x86-64 Windows, and soft- and hard-float ARM: + +- $ make linux32 win32 win64 linux-arm linux-armhf ++ $ make linux32 win32 win64 linux-arm linux-armhf linux-aarch64 + + If you append `snappy` to the line above, it will also build the native library for the current platform and then build the snappy-java JAR (containing all native libraries built so far). + +@@ -157,6 +157,7 @@ Of course, you must first have the necessary cross-compilers and development lib + * win64: `sudo apt-get install g++-mingw-w64-x86-64` + * arm: `sudo apt-get install g++-arm-linux-gnueabi` + * armhf: `sudo apt-get install g++-arm-linux-gnueabihf` ++ * aarch64: `sudo apt-get install g++-aarch64-linux` + + Unfortunately, cross-compiling for Mac OS X is not currently possible; you must compile within OS X. + +diff --git a/src/main/java/org/xerial/snappy/OSInfo.java b/src/main/java/org/xerial/snappy/OSInfo.java +index ff366fa..cf6b0bc 100755 +--- a/src/main/java/org/xerial/snappy/OSInfo.java ++++ b/src/main/java/org/xerial/snappy/OSInfo.java +@@ -45,6 +45,7 @@ + public static final String PPC64 = "ppc64"; + public static final String IBMZ = "s390"; + public static final String IBMZ_64 = "s390x"; ++ public static final String AARCH_64 = "aarch64"; + + static { + // x86 mappings +@@ -88,6 +89,9 @@ + + // IBM z 64-bit mappings + archMapping.put(IBMZ_64, IBMZ_64); ++ ++ // Aarch64 mappings ++ archMapping.put(AARCH_64, AARCH_64); + } + + public static void main(String[] args) -- cgit v1.2.3