0
0
Fork 0
haikuports/app-arch/zstd/zstd-1.5.0.recipe

144 lines
3.4 KiB
Bash

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="2"
SOURCE_URI="https://github.com/facebook/zstd/archive/v$portVersion.tar.gz"
SOURCE_FILENAME="zstd-$portVersion.tar.gz"
CHECKSUM_SHA256="0d9ade222c64e912d6957b11c923e214e2e010a18f39bec102f572e693ba2867"
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
"
BUILD()
{
cd build/cmake
cmake . -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON $cmakeDirArgs
make
}
INSTALL()
{
cd build/cmake
make install
prepareInstalledDevelLib libzstd
fixPkgconfig
fixCMake
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
}