1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
3 # Contributor: Andrzej Giniewicz <gginiu@gmail.com>
4 # Contributor: Johan Förberg <johan@forberg.se>
9 pkgdesc='Zstandard - Fast real-time compression algorithm'
10 url='https://facebook.github.io/zstd/'
13 depends=(glibc gcc-libs zlib xz lz4)
14 makedepends=(cmake gtest ninja)
16 source=(https://github.com/facebook/zstd/releases/download/v${pkgver}/zstd-${pkgver}.tar.zst{,.sig})
17 sha256sums=('ce264bca60eb2f0e99e4508cffd0d4d19dd362e84244d7fc941e79fa69ccf673'
19 b2sums=('2c2dc95f227e661ada23d8f6141bcd293505ce14e605f946ae00d4d4ac37d10b4eb08279ef7560618c67caf266431f76686fda5ae1921d698a6a93bbaf9a0052'
21 validpgpkeys=(4EF4AC63455FC9F4545D9B7DEF8FE99528B52FFD)
24 cd ${pkgname}-${pkgver}
25 # avoid error on tests without static libs, we use LD_LIBRARY_PATH
26 sed '/build static library to build tests/d' -i build/cmake/CMakeLists.txt
27 sed 's/libzstd_static/libzstd_shared/g' -i build/cmake/tests/CMakeLists.txt
31 cd ${pkgname}-${pkgver}
32 export CFLAGS+=' -ffat-lto-objects'
33 export CXXFLAGS+=' -ffat-lto-objects'
35 cmake -S build/cmake -B build -G Ninja \
36 -DCMAKE_BUILD_TYPE=None \
37 -DCMAKE_INSTALL_PREFIX=/usr \
38 -DZSTD_ZLIB_SUPPORT=ON \
39 -DZSTD_LZMA_SUPPORT=ON \
40 -DZSTD_LZ4_SUPPORT=ON \
41 -DZSTD_BUILD_CONTRIB=ON \
42 -DZSTD_BUILD_STATIC=OFF \
43 -DZSTD_BUILD_TESTS=ON \
44 -DZSTD_PROGRAMS_LINK_SHARED=ON
49 cd ${pkgname}-${pkgver}
50 LD_LIBRARY_PATH="$(pwd)/build/lib" \
51 ctest -VV --test-dir build
55 cd ${pkgname}-${pkgver}
56 DESTDIR="${pkgdir}" cmake --install build
57 install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"