summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO23
-rw-r--r--.gitignore6
-rw-r--r--0001-Add-pkgconfig.patch24
-rw-r--r--0002-Disable-neon.patch18
-rw-r--r--PKGBUILD58
-rw-r--r--snappy.pc.in10
6 files changed, 139 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..e08cc7c55c8d
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = android-x86-64-snappy
+ pkgdesc = A fast compressor/decompressor library (Android x86-64)
+ pkgver = 1.1.10
+ pkgrel = 1
+ url = https://google.github.io/snappy/
+ arch = any
+ license = BSD
+ makedepends = android-cmake
+ depends = android-ndk
+ options = !strip
+ options = !buildflags
+ options = staticlibs
+ options = !emptydirs
+ source = https://github.com/google/snappy/archive/1.1.10/android-x86-64-snappy-1.1.10.tar.gz
+ source = snappy.pc.in
+ source = 0001-Add-pkgconfig.patch
+ source = 0002-Disable-neon.patch
+ sha256sums = 49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90
+ sha256sums = 134f06ca0584a1026538d0fb972fc141c008390ecae1806184b721eca1abbc75
+ sha256sums = 2a204d7d35509ffc290d80c641fcb7e8488c67ca550aa1695493cff12c53156b
+ sha256sums = 4ba42f130366ee39d2afba4967c2afde4ebb490b6470d2a39506c630e31d20d4
+
+pkgname = android-x86-64-snappy
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..b5b03b115225
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+pkg
+src
+*.tar.xz
+*.tar.gz
+*.tar.bz2
+*.asc
diff --git a/0001-Add-pkgconfig.patch b/0001-Add-pkgconfig.patch
new file mode 100644
index 000000000000..6c3952bdf11e
--- /dev/null
+++ b/0001-Add-pkgconfig.patch
@@ -0,0 +1,24 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -187,6 +187,12 @@
+ "${PROJECT_BINARY_DIR}/config.h"
+ )
+
++configure_file(
++ "${CMAKE_CURRENT_SOURCE_DIR}/snappy.pc.in"
++ "${CMAKE_CURRENT_BINARY_DIR}/snappy.pc"
++ @ONLY
++)
++
+ # We don't want to define HAVE_ macros in public headers. Instead, we use
+ # CMake's variable substitution with 0/1 variables, which will be seen by the
+ # preprocessor as constants.
+@@ -395,4 +401,8 @@
+ "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
+ )
++ install(
++ FILES "${PROJECT_BINARY_DIR}/snappy.pc"
++ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
++ )
+ endif(SNAPPY_INSTALL)
diff --git a/0002-Disable-neon.patch b/0002-Disable-neon.patch
new file mode 100644
index 000000000000..04ba74e23805
--- /dev/null
+++ b/0002-Disable-neon.patch
@@ -0,0 +1,18 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -191,15 +191,6 @@
+ return _bzhi_u32(0, 1);
+ }" SNAPPY_HAVE_BMI2)
+
+-check_cxx_source_compiles("
+-#include <arm_neon.h>
+-int main() {
+- uint8_t val = 3, dup[8];
+- uint8x16_t v = vld1q_dup_u8(&val);
+- vst1q_u8(dup, v);
+- return 0;
+-}" SNAPPY_HAVE_NEON)
+-
+ include(CheckSymbolExists)
+ check_symbol_exists("mmap" "sys/mman.h" HAVE_FUNC_MMAP)
+ check_symbol_exists("sysconf" "unistd.h" HAVE_FUNC_SYSCONF)
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..faab01857541
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,58 @@
+# Maintainer: Gonzalo Exequiel Pedone <hipersayan DOT x AT gmail DOT com>
+# Contributor: Dave Reisner <dreisner@archlinux.org>
+# Contributor: Antony Male <antony dot male at geemail dot com>>
+
+_android_arch=x86-64
+
+pkgname=android-${_android_arch}-snappy
+pkgver=1.1.10
+pkgrel=1
+arch=('any')
+pkgdesc="A fast compressor/decompressor library (Android ${_android_arch})"
+url="https://google.github.io/snappy/"
+license=('BSD')
+depends=('android-ndk')
+makedepends=('android-cmake')
+options=(!strip !buildflags staticlibs !emptydirs)
+source=("https://github.com/google/snappy/archive/$pkgver/$pkgname-$pkgver.tar.gz"
+ snappy.pc.in
+ 0001-Add-pkgconfig.patch
+ 0002-Disable-neon.patch)
+sha256sums=('49d831bffcc5f3d01482340fe5af59852ca2fe76c3e05df0e67203ebbe0f1d90'
+ '134f06ca0584a1026538d0fb972fc141c008390ecae1806184b721eca1abbc75'
+ '2a204d7d35509ffc290d80c641fcb7e8488c67ca550aa1695493cff12c53156b'
+ '4ba42f130366ee39d2afba4967c2afde4ebb490b6470d2a39506c630e31d20d4')
+
+prepare() {
+ cd "${srcdir}/snappy-$pkgver"
+ source android-env ${_android_arch}
+
+ cp ../snappy.pc.in .
+ patch -Np1 -i ../0001-Add-pkgconfig.patch
+ patch -Np1 -i ../0002-Disable-neon.patch
+}
+
+build() {
+ cd "${srcdir}/snappy-$pkgver"
+ source android-env ${_android_arch}
+
+ # compile without assertions
+ export CFLAGS="${CFLAGS} -DNDEBUG"
+ export CXXFLAGS="${CXXFLAGS} -DNDEBUG"
+
+ android-${_android_arch}-cmake \
+ -DSNAPPY_BUILD_TESTS=OFF \
+ -DSNAPPY_BUILD_BENCHMARKS=OFF \
+ -DSNAPPY_USE_BUNDLED_GTEST=OFF \
+ -DSNAPPY_USE_BUNDLED_BENCHMARK_LIB=OFF \
+ .
+ make $MAKEFLAGS
+}
+
+package() {
+ cd "${srcdir}/snappy-$pkgver"
+ source android-env ${_android_arch}
+
+ make DESTDIR="$pkgdir" install
+ ${ANDROID_STRIP} -g --strip-unneeded "${pkgdir}"/${ANDROID_PREFIX_LIB}/*.so
+}
diff --git a/snappy.pc.in b/snappy.pc.in
new file mode 100644
index 000000000000..9c1a3478ee4b
--- /dev/null
+++ b/snappy.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: snappy
+Description: Fast compressor/decompressor library.
+Version: @PROJECT_VERSION@
+Libs: -L${libdir} -lsnappy
+Cflags: -I${includedir}