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)
17 source=(https://github.com/facebook/zstd/releases/download/v${pkgver}/zstd-${pkgver}.tar.zst{,.sig})
18 sha256sums=('3ea06164971edec7caa2045a1932d757c1815858e4c2b68c7ef812647535c23f'
20 b2sums=('513e4526a92bcb59416b3457d186a30e554f9e0cf21d7114eb3e9fbcbd9d662c8d95cf0b06237f6fe3f756862c63de0aa146d6a23cb4111c16e6459608d115f1'
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}
33 export CFLAGS+=' -ffat-lto-objects'
34 export CXXFLAGS+=' -ffat-lto-objects'
36 cmake -S build/cmake -B build -G Ninja \
37 -DCMAKE_BUILD_TYPE=None \
38 -DCMAKE_INSTALL_PREFIX=/usr \
39 -DCMAKE_INSTALL_LIBDIR=lib \
40 -DZSTD_BUILD_CONTRIB=ON \
41 -DZSTD_BUILD_STATIC=OFF \
42 -DZSTD_BUILD_TESTS=ON \
43 -DZSTD_PROGRAMS_LINK_SHARED=ON
48 cd ${pkgname}-${pkgver}
49 export LD_LIBRARY_PATH="$(pwd)/build/lib"
50 ctest -VV --test-dir build
54 cd ${pkgname}-${pkgver}
55 DESTDIR="${pkgdir}" cmake --install build
56 ln -sf /usr/bin/zstd "${pkgdir}/usr/bin/zstdmt"
57 install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"