SUMMARY="Zstandard, a fast real-time compression algorithm" SUMMARY_bin="Command line tools to compress/decompress .zst files" DESCRIPTION="Zstd, short for Zstandard, is a fast lossless compression \ algorithm, targeting real-time compression scenarios at zlib-level and better \ compression ratios. The zstd compression library provides in-memory \ compression and decompression functions. It offers a very wide range of \ compression / speed trade-off, while being backed by a very fast decoder. It \ also offers a special mode for small data, called dictionary compression, and \ can create dictionaries from any sample set." HOMEPAGE="https://facebook.github.io/zstd/" COPYRIGHT="2016-2018 Facebook, Inc." LICENSE="BSD (2-clause) GNU GPL v2" REVISION="3" SOURCE_URI="https://github.com/facebook/zstd/archive/v$portVersion.tar.gz" SOURCE_FILENAME="zstd-$portVersion.tar.gz" CHECKSUM_SHA256="f7de13462f7a82c29ab865820149e778cbfe01087b3a55b5332707abf9db4a6e" PATCHES="zstd-$portVersion.patchset" if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then PATCHES="$PATCHES zstd-$portVersion-gcc2.patchset " fi ARCHITECTURES="all" SECONDARY_ARCHITECTURES="x86_gcc2 x86" commandSuffix=$secondaryArchSuffix commandBinDir=$binDir if [ -n "$secondaryArchSuffix" ]; then # Comment out this block if you wish to co-install zstd_bin & e.g. zstd_x86_bin. commandSuffix= commandBinDir=$prefix/bin fi libVersion="$portVersion" libVersionCompat="$libVersion compat >= ${libVersion%%.*}" PROVIDES=" zstd$secondaryArchSuffix = $portVersion lib:libzstd$secondaryArchSuffix = $libVersionCompat " REQUIRES=" haiku$secondaryArchSuffix " PROVIDES_bin=" zstd${secondaryArchSuffix}_bin = $portVersion cmd:unzstd$commandSuffix = $portVersion cmd:zstd$commandSuffix = $portVersion cmd:zstdcat$commandSuffix = $portVersion cmd:zstdgrep$commandSuffix = $portVersion cmd:zstdless$commandSuffix = $portVersion cmd:zstdmt$commandSuffix = $portVersion " if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then PROVIDES_bin="$PROVIDES_bin cmd:pzstd$commandSuffix = $portVersion " fi REQUIRES_bin=" haiku$secondaryArchSuffix zstd$secondaryArchSuffix == $portVersion base cmd:grep cmd:less lib:liblz4$secondaryArchSuffix lib:libz$secondaryArchSuffix " if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then REQUIRES_bin="$REQUIRES_bin lib:liblzma$secondaryArchSuffix " fi if [ -n "$secondaryArchSuffix" -a "$commandBinDir" = "$prefix"/bin ]; then CONFLICTS_bin=" zstd_bin " fi PROVIDES_devel=" zstd${secondaryArchSuffix}_devel = $portVersion devel:libzstd$secondaryArchSuffix = $libVersionCompat " REQUIRES_devel=" zstd$secondaryArchSuffix == $portVersion base " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel devel:liblz4$secondaryArchSuffix devel:libz$secondaryArchSuffix " if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then BUILD_REQUIRES="$BUILD_REQUIRES devel:liblzma$secondaryArchSuffix " fi BUILD_PREREQUIRES=" cmd:gcc$secondaryArchSuffix cmd:cmake cmd:make cmd:sed cmd:find " TEST_REQUIRES=" cmd:python3 " PATCH() { # avoid error on tests without static libs, we use LD_LIBRARY_PATH sed '/build static library to build tests/d' -i build/cmake/CMakeLists.txt sed 's/libzstd_static/libzstd_shared/g' -i build/cmake/tests/CMakeLists.txt } BUILD() { cd build/cmake cmake . -DCMAKE_BUILD_TYPE=Release \ $cmakeDirArgs \ -DZSTD_BUILD_STATIC=OFF \ -DZSTD_BUILD_TESTS=ON \ -DZSTD_PROGRAMS_LINK_SHARED=ON make } INSTALL() { cd build/cmake make install prepareInstalledDevelLib libzstd fixPkgconfig fixCMake sed "s|$libDir|$developLibDir|g" \ -i $developLibDir/cmake/zstd/zstdTargets-release.cmake packageEntries bin \ $commandBinDir \ $manDir/man1 packageEntries devel \ $developDir rmdir $manDir install -d $docDir install -t $docDir -m 444 ../../LICENSE } TEST() { cd build/cmake make test }