diff --git a/dev-libs/c_blosc/c_blosc-1.12.1.recipe b/dev-libs/c_blosc/c_blosc-1.12.1.recipe new file mode 100644 index 000000000..0f6d5f359 --- /dev/null +++ b/dev-libs/c_blosc/c_blosc-1.12.1.recipe @@ -0,0 +1,95 @@ +SUMMARY="Blocking, shuffling and lossless compression library" +DESCRIPTION="Blosc is a high performance compressor optimized for binary \ +data. It has been designed to transmit data to the processor cache faster \ +than the traditional, non-compressed, direct memory fetch approach via a \ +memcpy() OS call. Blosc is the first compressor (that I'm aware of) that is \ +meant not only to reduce the size of large datasets on-disk or in-memory, but \ +also to accelerate memory-bound computations." +HOMEPAGE="http://www.blosc.org" +COPYRIGHT="2012-2017 Francesc Alted" +LICENSE="MIT" +REVISION="1" +SOURCE_URI="https://github.com/Blosc/c-blosc/archive/v$portVersion.tar.gz" +CHECKSUM_SHA256="e04535e816bb942bedc9a0ba209944d1eb34e26e2d9cca37f114e8ee292cb3c8" +SOURCE_DIR="c-blosc-$portVersion" +PATCHES="c_blosc-$portVersion.patchset" + +ARCHITECTURES="?x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + c_blosc$secondaryArchSuffix = $portVersion compat >= 1 + lib:libblosc$secondaryArchSuffix = 1.12.1 compat >= 1 + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:liblz4$secondaryArchSuffix + lib:libsnappy$secondaryArchSuffix + lib:libz$secondaryArchSuffix + lib:libzstd$secondaryArchSuffix + " + +PROVIDES_devel=" + c_blosc${secondaryArchSuffix}_devel = $portVersion + devel:libblosc${secondaryArchSuffix} = 1.12.1 compat >= 1 + " +REQUIRES_devel=" + c_blosc${secondaryArchSuffix} == $portVersion base + " + +BUILD_REQUIRES=" + devel:liblz4$secondaryArchSuffix + devel:libsnappy$secondaryArchSuffix + devel:libz$secondaryArchSuffix + devel:libzstd$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel + cmd:gcc${secondaryArchSuffix} + cmd:ld${secondaryArchSuffix} + cmd:cmake + cmd:make + cmd:perl >= 5 + cmd:sed + " + +BUILD() +{ + mkdir -p haiku_build + cd haiku_build + + cmake .. \ + -DPREFER_EXTERNAL_LZ4=ON \ + -DPREFER_EXTERNAL_SNAPPY=ON \ + -DPREFER_EXTERNAL_ZLIB=ON \ + -DPREFER_EXTERNAL_ZSTD=ON \ + $cmakeDirArgs + + make ${jobArgs} +} + +INSTALL() +{ + cd haiku_build + + make install + + # move include dir to correct location + mkdir -p $(dirname $includeDir) + mv $prefix/include $includeDir + + # prepare develop/lib + prepareInstalledDevelLibs libblosc + fixPkgconfig + + # devel package + packageEntries devel \ + $developDir +} + +TEST() +{ + cd haiku_build + + make test +} diff --git a/dev-libs/c_blosc/patches/c_blosc-1.12.1.patchset b/dev-libs/c_blosc/patches/c_blosc-1.12.1.patchset new file mode 100644 index 000000000..f8b3d6d28 --- /dev/null +++ b/dev-libs/c_blosc/patches/c_blosc-1.12.1.patchset @@ -0,0 +1,59 @@ +From d014d1b144f867dbfc158eea1f45d26f9a35bf58 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Thu, 7 Dec 2017 21:27:35 +0100 +Subject: [PATCH] Build fix + +--- + bench/CMakeLists.txt | 4 ++-- + bench/bench.c | 2 +- + tests/test_common.h | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/bench/CMakeLists.txt b/bench/CMakeLists.txt +index 14e74de..1aad1f6 100644 +--- a/bench/CMakeLists.txt ++++ b/bench/CMakeLists.txt +@@ -4,12 +4,12 @@ set(SOURCES bench.c) + + # targets + add_executable(bench ${SOURCES}) +-if(UNIX AND NOT APPLE) ++if(UNIX AND NOT APPLE AND NOT HAIKU) + # 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) ++endif(UNIX AND NOT APPLE AND NOT HAIKU) + target_link_libraries(bench blosc_shared) + + # have to copy blosc dlls on Windows +diff --git a/bench/bench.c b/bench/bench.c +index 9852313..4c6196a 100644 +--- a/bench/bench.c ++++ b/bench/bench.c +@@ -36,7 +36,7 @@ + #include + #include + #include +-#elif defined(__unix__) ++#elif defined(__unix__) || defined(__HAIKU__) + #include + #if defined(__GLIBC__) + #include +diff --git a/tests/test_common.h b/tests/test_common.h +index 4e40533..7ed56f7 100644 +--- a/tests/test_common.h ++++ b/tests/test_common.h +@@ -68,7 +68,7 @@ static void* blosc_test_malloc(const size_t alignment, const size_t size) + #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(__HAIKU__) + /* Platform does have an implementation of posix_memalign */ + res = posix_memalign(&block, alignment, size); + #elif defined(__APPLE__) +-- +2.15.0 +