# Maintainer: Levente Polyak # Contributor: Bartłomiej Piotrowski # Contributor: Andrzej Giniewicz # Contributor: Johan Förberg pkgname=zstd pkgver=1.5.4 pkgrel=1 pkgdesc='Zstandard - Fast real-time compression algorithm' url='https://facebook.github.io/zstd/' arch=(x86_64) license=(BSD GPL2) depends=(glibc gcc-libs zlib xz lz4) makedepends=(cmake gtest ninja) provides=(libzstd.so) options=(debug) source=(https://github.com/facebook/zstd/releases/download/v${pkgver}/zstd-${pkgver}.tar.zst{,.sig}) sha256sums=('6925880b84aca086308c27036ef1c16e76817372301ead7c37f90e23567f704e' 'SKIP') b2sums=('8caea5dae06928076c2e54b059a501bd757663bae5948cb49ae32a7591c11636b22cb3b45d4f91653da800e1815cf5b28f72c69f4696ada4fdc746a272239da9' 'SKIP') validpgpkeys=(4EF4AC63455FC9F4545D9B7DEF8FE99528B52FFD) prepare() { cd ${pkgname}-${pkgver} # 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 ${pkgname}-${pkgver} export CFLAGS+=' -ffat-lto-objects' export CXXFLAGS+=' -ffat-lto-objects' cmake -S build/cmake -B build -G Ninja \ -DCMAKE_BUILD_TYPE=None \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_LIBDIR=lib \ -DZSTD_BUILD_CONTRIB=ON \ -DZSTD_BUILD_STATIC=OFF \ -DZSTD_BUILD_TESTS=ON \ -DZSTD_PROGRAMS_LINK_SHARED=ON cmake --build build } #check() { # cd ${pkgname}-${pkgver} # export LD_LIBRARY_PATH="$(pwd)/build/lib" # ctest -VV --test-dir build #} package() { cd ${pkgname}-${pkgver} DESTDIR="${pkgdir}" cmake --install build ln -sf /usr/bin/zstd "${pkgdir}/usr/bin/zstdmt" install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" } # vim: ts=2 sw=2 et: