archrelease: copy trunk to extra-x86_64
[arch-packages.git] / zstd / trunk / PKGBUILD
blob0ca9502cfeafb1935b4f7ccba96b9e05a7ce45b2
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>
6 pkgname=zstd
7 pkgver=1.5.5
8 pkgrel=1
9 pkgdesc='Zstandard - Fast real-time compression algorithm'
10 url='https://facebook.github.io/zstd/'
11 arch=(x86_64)
12 license=(BSD GPL2)
13 depends=(glibc gcc-libs zlib xz lz4)
14 makedepends=(cmake gtest ninja)
15 provides=(libzstd.so)
16 source=(https://github.com/facebook/zstd/releases/download/v${pkgver}/zstd-${pkgver}.tar.zst{,.sig})
17 sha256sums=('ce264bca60eb2f0e99e4508cffd0d4d19dd362e84244d7fc941e79fa69ccf673'
18             'SKIP')
19 b2sums=('2c2dc95f227e661ada23d8f6141bcd293505ce14e605f946ae00d4d4ac37d10b4eb08279ef7560618c67caf266431f76686fda5ae1921d698a6a93bbaf9a0052'
20         'SKIP')
21 validpgpkeys=(4EF4AC63455FC9F4545D9B7DEF8FE99528B52FFD)
23 prepare() {
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
30 build() {
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
45   cmake --build build
48 check() {
49   cd ${pkgname}-${pkgver}
50   LD_LIBRARY_PATH="$(pwd)/build/lib" \
51     ctest -VV --test-dir build
54 package() {
55   cd ${pkgname}-${pkgver}
56   DESTDIR="${pkgdir}" cmake --install build
57   install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
60 # vim: ts=2 sw=2 et: