archrelease: copy trunk to extra-x86_64
[arch-packages.git] / zstd / trunk / PKGBUILD
blobf4e3332e673fe4e5d00fe82ba37ff6760731d9c9
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.4
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=('6925880b84aca086308c27036ef1c16e76817372301ead7c37f90e23567f704e'
18             'SKIP')
19 b2sums=('8caea5dae06928076c2e54b059a501bd757663bae5948cb49ae32a7591c11636b22cb3b45d4f91653da800e1815cf5b28f72c69f4696ada4fdc746a272239da9'
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: