c_blosc-1.17.0.recipe revision 0acd611d
1SUMMARY="Blocking, shuffling and lossless compression library"
2DESCRIPTION="Blosc is a high performance compressor optimized for binary \
3data. It has been designed to transmit data to the processor cache faster \
4than the traditional, non-compressed, direct memory fetch approach via a \
5memcpy() OS call. Blosc is the first compressor (that I'm aware of) that is \
6meant not only to reduce the size of large datasets on-disk or in-memory, but \
7also to accelerate memory-bound computations."
8HOMEPAGE="https://www.blosc.org/"
9COPYRIGHT="2012-2018 Francesc Alted"
10LICENSE="MIT"
11REVISION="2"
12SOURCE_URI="https://github.com/Blosc/c-blosc/archive/v$portVersion.tar.gz"
13CHECKSUM_SHA256="75d98c752b8cf0d4a6380a3089d56523f175b0afa2d0cf724a1bd0a1a8f975a4"
14SOURCE_FILENAME="c_blosc-$portVersion.tar.gz"
15SOURCE_DIR="c-blosc-$portVersion"
16
17ARCHITECTURES="?x86_gcc2 ?x86 x86_64"
18SECONDARY_ARCHITECTURES="x86"
19
20libVersion="$portVersion"
21libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
22
23PROVIDES="
24	c_blosc$secondaryArchSuffix = $portVersion
25	lib:libblosc$secondaryArchSuffix = $libVersionCompat
26	"
27REQUIRES="
28	haiku$secondaryArchSuffix
29	lib:liblz4$secondaryArchSuffix
30	lib:libsnappy$secondaryArchSuffix
31	lib:libz$secondaryArchSuffix
32	lib:libzstd$secondaryArchSuffix
33	"
34
35PROVIDES_devel="
36	c_blosc${secondaryArchSuffix}_devel = $portVersion
37	devel:libblosc$secondaryArchSuffix = $libVersionCompat
38	"
39REQUIRES_devel="
40	c_blosc$secondaryArchSuffix == $portVersion base
41	"
42
43BUILD_REQUIRES="
44	haiku${secondaryArchSuffix}_devel
45	devel:liblz4$secondaryArchSuffix
46	devel:libsnappy$secondaryArchSuffix
47	devel:libz$secondaryArchSuffix
48	devel:libzstd$secondaryArchSuffix
49	"
50BUILD_PREREQUIRES="
51	cmd:cmake
52	cmd:gcc$secondaryArchSuffix
53	cmd:ld$secondaryArchSuffix
54	cmd:make
55	cmd:perl >= 5
56	cmd:sed
57	"
58
59defineDebugInfoPackage c_blosc$secondaryArchSuffix \
60	"$libDir"/libblosc.so.$portVersion
61
62BUILD()
63{
64	mkdir -p haiku_build
65	cd haiku_build
66
67	cmake .. \
68		-DPREFER_EXTERNAL_LZ4=ON \
69		-DPREFER_EXTERNAL_SNAPPY=ON \
70		-DPREFER_EXTERNAL_ZLIB=ON \
71		-DPREFER_EXTERNAL_ZSTD=ON \
72		-DDEACTIVATE_AVX2=ON \
73		-DLIB_SUFFIX=$secondaryArchSubDir \
74		$cmakeDirArgs
75
76	make $jobArgs
77}
78
79INSTALL()
80{
81	cd haiku_build
82
83	make install
84
85	# move include dir to correct location
86	mkdir -p $(dirname $includeDir)
87	mv $prefix/include $includeDir
88
89	if [ -n "$secondaryArchSuffix" ]; then
90		# On secondary arch the pkgconfig subdir should also go to $libDir
91		# instead of $prefix/lib
92		mv "$prefix"/lib/pkgconfig "$libDir"
93	fi
94
95	# prepare develop/lib
96	prepareInstalledDevelLibs libblosc
97	fixPkgconfig
98
99	# devel package
100	packageEntries devel \
101		$developDir
102}
103
104TEST()
105{
106	cd haiku_build
107	make test
108}
109