aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Frankenberger <simon-alpine@fraho.eu>2021-08-18 19:41:55 +0200
committerKevin Daudt <kdaudt@alpinelinux.org>2021-08-19 05:48:38 +0000
commit6da5613c1b1d430cce4dcd027caab0b07b644b2c (patch)
treecb760d04fd2fc03bc97c7ac2946a02ea4c79633b
parente24b84f85f9085f42d09e6cdceb719c56df45d63 (diff)
community/java-snappy: fix compilation
fixes #12925
-rw-r--r--community/java-snappy/APKBUILD6
-rw-r--r--community/java-snappy/fix-racing-condition-unpack.patch11
-rw-r--r--community/java-snappy/unbundle-snappy.patch38
3 files changed, 44 insertions, 11 deletions
diff --git a/community/java-snappy/APKBUILD b/community/java-snappy/APKBUILD
index af914c2a81d..3ac88fe4f28 100644
--- a/community/java-snappy/APKBUILD
+++ b/community/java-snappy/APKBUILD
@@ -9,7 +9,7 @@ pkgdesc="Snappy compressor/decompressor for Java"
url="https://github.com/xerial/snappy-java"
# mips64, x86 and riscv64 blocked by openjdk8
# aarch64 fails to build https://gitlab.alpinelinux.org/alpine/aports/-/issues/12925
-arch="all !mips !mips64 !x86 !riscv64 !aarch64"
+arch="all !mips !mips64 !x86 !riscv64"
license="Apache-2.0"
options="!check" # Tests does not work correctly
depends="java-jre-headless"
@@ -17,6 +17,7 @@ makedepends="bash openjdk8 perl snappy-dev>=$_libver"
subpackages="$pkgname-native"
source="$pkgname-$pkgver.tar.gz::https://github.com/xerial/snappy-java/archive/$pkgver.tar.gz
unbundle-snappy.patch
+ fix-racing-condition-unpack.patch
"
builddir="$srcdir/$_pkgname-$pkgver"
@@ -58,5 +59,6 @@ native() {
sha512sums="
94813b64acb579b9e63315aa7765f2a2989057c93745edd714d59ebe59ae778958a9bd376ba3d831c21e79bc4c5fb7f8fb969ee827e307f7fc1dbed004df010b java-snappy-1.1.8.4.tar.gz
-6531908df96e41b3c31cf6096164803223a81d6eec411b7b98e04ba9c033d387bd3cb00b1d830e923ccbb76492014946055d6fd1651afce2b7df136cfa5acf6c unbundle-snappy.patch
+6f1e402435faa000e97cd18486c779be39e23d904077f79d614fd95d8feff6fe15c0292ff9dc463089f35817dcd9f4691e8248bc8caa9b8796d9b18175364af1 unbundle-snappy.patch
+24c0e11b191f582f3c0e6ca14af1ef04067b4fb832097dfad82c1cacaf3f37a32c42b9a4cd04e8247188f746438cfed8ac9ed1203ad5e3b8df5aca5ea41a8aa3 fix-racing-condition-unpack.patch
"
diff --git a/community/java-snappy/fix-racing-condition-unpack.patch b/community/java-snappy/fix-racing-condition-unpack.patch
new file mode 100644
index 00000000000..d396fada82b
--- /dev/null
+++ b/community/java-snappy/fix-racing-condition-unpack.patch
@@ -0,0 +1,11 @@
+--- old/Makefile
++++ new/Makefile
+@@ -106,7 +106,7 @@
+ @mkdir -p $(@D)
+ $(CXX) $(SNAPPY_CXX_OPTS) $(CXXFLAGS) -c $< -o $@
+
+-$(SNAPPY_OUT)/BitShuffleNative.o: $(SRC)/org/xerial/snappy/BitShuffleNative.cpp $(SRC)/org/xerial/snappy/BitShuffleNative.h
++$(SNAPPY_OUT)/BitShuffleNative.o: $(SRC)/org/xerial/snappy/BitShuffleNative.cpp $(SRC)/org/xerial/snappy/BitShuffleNative.h $(BITSHUFFLE_UNPACKED)
+ @mkdir -p $(@D)
+ $(CXX) $(CXXFLAGS) -c $< -o $@
+
diff --git a/community/java-snappy/unbundle-snappy.patch b/community/java-snappy/unbundle-snappy.patch
index bbaaafde745..8143e6dac8a 100644
--- a/community/java-snappy/unbundle-snappy.patch
+++ b/community/java-snappy/unbundle-snappy.patch
@@ -5,8 +5,8 @@ Subject: [PATCH] Unbundle snappy
Use system-provided snappy library instead of downloading and building
snappy from the upstream.
---- a/Makefile
-+++ b/Makefile
+--- old/Makefile
++++ new/Makefile
@@ -10,7 +10,7 @@
SNAPPY_OUT:=$(TARGET)/snappy-$(SNAPPY_VERSION)-$(os_arch)
@@ -16,9 +16,29 @@ snappy from the upstream.
SNAPPY_SRC_DIR:=$(TARGET)/snappy-$(SNAPPY_VERSION)
SNAPPY_SRC:=$(addprefix $(SNAPPY_SRC_DIR)/,$(SNAPPY_CC))
SNAPPY_GIT_REPO_URL:=https://github.com/google/snappy
-@@ -86,9 +86,9 @@
- cd $(SNAPPY_OUT) && cmake $(SNAPPY_CMAKE_OPTS) ../../$(SNAPPY_SRC_DIR)
- touch $@
+@@ -66,29 +66,16 @@
+ endif
+
+ $(SNAPPY_ARCHIVE):
+- @mkdir -p $(@D)
+- curl -L -o$@ https://github.com/google/snappy/releases/download/$(SNAPPY_VERSION)/snappy-$(SNAPPY_VERSION).tar.gz
+
+ $(SNAPPY_UNPACKED): $(SNAPPY_ARCHIVE)
+- $(TAR) xvfz $< -C $(TARGET)
+- touch $@
+
+ $(SNAPPY_GIT_UNPACKED):
+- @mkdir -p $(SNAPPY_OUT)
+- rm -rf $(SNAPPY_SRC_DIR)
+- @mkdir -p $(SNAPPY_SRC_DIR)
+- git clone $(SNAPPY_GIT_REPO_URL) $(SNAPPY_SRC_DIR)
+- git --git-dir=$(SNAPPY_SRC_DIR)/.git --work-tree=$(SNAPPY_SRC_DIR) checkout -b local/snappy-$(SNAPPY_VERSION) $(SNAPPY_GIT_REV)
+- touch $@
+
+ $(SNAPPY_CMAKE_CACHE): $(SNAPPY_GIT_UNPACKED)
+- @mkdir -p $(SNAPPY_OUT)
+- cd $(SNAPPY_OUT) && cmake $(SNAPPY_CMAKE_OPTS) ../../$(SNAPPY_SRC_DIR)
+- touch $@
-jni-header: $(SNAPPY_GIT_UNPACKED) $(BITSHUFFLE_UNPACKED) $(SRC)/org/xerial/snappy/SnappyNative.h $(SRC)/org/xerial/snappy/BitShuffleNative.h
+jni-header: $(BITSHUFFLE_UNPACKED) $(SRC)/org/xerial/snappy/SnappyNative.h $(SRC)/org/xerial/snappy/BitShuffleNative.h
@@ -28,7 +48,7 @@ snappy from the upstream.
$(TARGET)/jni-classes/org/xerial/snappy/SnappyNative.class: $(SRC)/org/xerial/snappy/SnappyNative.java
@mkdir -p $(TARGET)/jni-classes
-@@ -102,7 +102,7 @@
+@@ -102,7 +89,7 @@
$(SRC)/org/xerial/snappy/BitShuffleNative.h: $(TARGET)/jni-classes/org/xerial/snappy/BitShuffleNative.class
@@ -37,7 +57,7 @@ snappy from the upstream.
# aarch64 can use big-endian optimzied code
ifeq ($(OS_ARCH),aarch64)
-@@ -124,7 +124,7 @@
+@@ -124,7 +111,7 @@
$(CXX) $(CXXFLAGS) -c $< -o $@
$(SNAPPY_OUT)/$(LIBNAME): $(SNAPPY_OBJ)
@@ -46,7 +66,7 @@ snappy from the upstream.
# Workaround for strip Protocol error when using VirtualBox on Mac
cp $@ /tmp/$(@F)
$(STRIP) /tmp/$(@F)
-@@ -144,7 +144,7 @@
+@@ -144,7 +131,7 @@
native: jni-header snappy-header $(NATIVE_DLL)
native-nocmake: jni-header $(NATIVE_DLL)
@@ -55,7 +75,7 @@ snappy from the upstream.
native-all: native mac64 win32 win64 native-arm linux32 linux64 linux-ppc64le
-@@ -153,6 +153,7 @@
+@@ -153,6 +140,7 @@
cp $(SNAPPY_OUT)/$(LIBNAME) $@
@mkdir -p $(NATIVE_TARGET_DIR)
cp $(SNAPPY_OUT)/$(LIBNAME) $(NATIVE_TARGET_DIR)/$(LIBNAME)