From 155033190d7b6440f9ce9eac7654a6ace1589788 Mon Sep 17 00:00:00 2001 From: termux-pacman-bot Date: Sat, 1 Oct 2022 16:09:59 +0000 Subject: [PATCH] new package: libblosc --- .../libblosc/0001-fix-posix-memalign.patch | 12 ++++++++++++ .../0002-do-not-link-against-librt.patch | 18 ++++++++++++++++++ packages/libblosc/build.sh | 16 ++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 packages/libblosc/0001-fix-posix-memalign.patch create mode 100644 packages/libblosc/0002-do-not-link-against-librt.patch create mode 100644 packages/libblosc/build.sh diff --git a/packages/libblosc/0001-fix-posix-memalign.patch b/packages/libblosc/0001-fix-posix-memalign.patch new file mode 100644 index 0000000000..88e91ce2f7 --- /dev/null +++ b/packages/libblosc/0001-fix-posix-memalign.patch @@ -0,0 +1,12 @@ +diff -uNr a/tests/test_common.h b/tests/test_common.h +--- a/tests/test_common.h ++++ b/tests/test_common.h +@@ -68,7 +68,7 @@ + #elif defined(_WIN32) + /* A (void *) cast needed for avoiding a warning with MINGW :-/ */ + block = (void *)_aligned_malloc(size, alignment); +-#elif _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600 ++#elif (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) || defined(__ANDROID__) + /* Platform does have an implementation of posix_memalign */ + res = posix_memalign(&block, alignment, size); + #elif defined(__APPLE__) diff --git a/packages/libblosc/0002-do-not-link-against-librt.patch b/packages/libblosc/0002-do-not-link-against-librt.patch new file mode 100644 index 0000000000..28cbafd59c --- /dev/null +++ b/packages/libblosc/0002-do-not-link-against-librt.patch @@ -0,0 +1,18 @@ +diff -uNr a/bench/CMakeLists.txt b/bench/CMakeLists.txt +--- a/bench/CMakeLists.txt ++++ b/bench/CMakeLists.txt +@@ -4,12 +4,12 @@ + + # targets + add_executable(bench ${SOURCES}) +-if(UNIX AND NOT APPLE AND NOT HAIKU) ++if(UNIX AND NOT APPLE AND NOT HAIKU AND NOT ANDROID) + # cmake is complaining about LINK_PRIVATE in original PR + # and removing it does not seem to hurt, so be it. + # target_link_libraries(bench LINK_PRIVATE rt) + target_link_libraries(bench rt) +-endif(UNIX AND NOT APPLE AND NOT HAIKU) ++endif(UNIX AND NOT APPLE AND NOT HAIKU AND NOT ANDROID) + target_link_libraries(bench blosc_shared) + + # have to copy blosc dlls on Windows diff --git a/packages/libblosc/build.sh b/packages/libblosc/build.sh new file mode 100644 index 0000000000..2ca2422233 --- /dev/null +++ b/packages/libblosc/build.sh @@ -0,0 +1,16 @@ +TERMUX_PKG_HOMEPAGE=https://www.blosc.org +TERMUX_PKG_DESCRIPTION="A blocking, shuffling and loss-less compression library" +TERMUX_PKG_LICENSE="BSD" +TERMUX_PKG_LICENSE_FILE="\ +LICENSES/BITSHUFFLE.txt +LICENSES/BLOSC.txt +LICENSES/FASTLZ.txt +LICENSES/LZ4.txt +LICENSES/SNAPPY.txt +LICENSES/STDINT.txt +LICENSES/ZLIB.txt" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=1.21.1 +TERMUX_PKG_SRCURL=https://github.com/Blosc/c-blosc/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=f387149eab24efa01c308e4cba0f59f64ccae57292ec9c794002232f7903b55b +TERMUX_PKG_DEPENDS="libsnappy, zstd"