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>
10 pkgdesc='Zstandard - Fast real-time compression algorithm (32-bit)'
11 url='https://facebook.github.io/zstd/'
14 depends=(zstd lib32-glibc)
15 makedepends=(cmake gtest ninja)
17 source=(https://github.com/facebook/zstd/releases/download/v${pkgver}/zstd-${pkgver}.tar.zst{,.sig})
18 sha256sums=('ce264bca60eb2f0e99e4508cffd0d4d19dd362e84244d7fc941e79fa69ccf673'
20 b2sums=('2c2dc95f227e661ada23d8f6141bcd293505ce14e605f946ae00d4d4ac37d10b4eb08279ef7560618c67caf266431f76686fda5ae1921d698a6a93bbaf9a0052'
22 validpgpkeys=(4EF4AC63455FC9F4545D9B7DEF8FE99528B52FFD)
25 cd ${_pkgname}-${pkgver}
26 # avoid error on tests without static libs, we use LD_LIBRARY_PATH
27 sed '/build static library to build tests/d' -i build/cmake/CMakeLists.txt
28 sed 's/libzstd_static/libzstd_shared/g' -i build/cmake/tests/CMakeLists.txt
32 cd ${_pkgname}-${pkgver}
35 export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
37 export CFLAGS+=' -ffat-lto-objects'
38 export CXXFLAGS+=' -ffat-lto-objects'
40 cmake -S build/cmake -B build -G Ninja \
41 -DCMAKE_BUILD_TYPE=None \
42 -DCMAKE_INSTALL_PREFIX=/usr \
43 -DCMAKE_INSTALL_LIBDIR=lib32 \
44 -DZSTD_BUILD_CONTRIB=ON \
45 -DZSTD_BUILD_STATIC=OFF \
46 -DZSTD_BUILD_TESTS=ON \
47 -DZSTD_PROGRAMS_LINK_SHARED=ON
52 cd ${_pkgname}-${pkgver}
53 LD_LIBRARY_PATH="$(pwd)/build/lib" \
54 ctest -VV --test-dir build
58 cd ${_pkgname}-${pkgver}
59 DESTDIR="${pkgdir}" cmake --install build
60 rm -rf "${pkgdir}"/usr/{share,include,bin}
61 install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"