sbcl 2.3.0 rebuild
[arch-packages.git] / zstd / repos / core-x86_64 / PKGBUILD
blob4a241c156946e08fcabbe0e0b2fb05ae18536c73
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.2
8 pkgrel=7
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 options=(debug)
17 source=(https://github.com/facebook/zstd/releases/download/v${pkgver}/zstd-${pkgver}.tar.zst{,.sig})
18 sha256sums=('3ea06164971edec7caa2045a1932d757c1815858e4c2b68c7ef812647535c23f'
19             'SKIP')
20 b2sums=('513e4526a92bcb59416b3457d186a30e554f9e0cf21d7114eb3e9fbcbd9d662c8d95cf0b06237f6fe3f756862c63de0aa146d6a23cb4111c16e6459608d115f1'
21         'SKIP')
22 validpgpkeys=(4EF4AC63455FC9F4545D9B7DEF8FE99528B52FFD)
24 prepare() {
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
31 build() {
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
44   cmake --build build
47 check() {
48   cd ${pkgname}-${pkgver}
49   export LD_LIBRARY_PATH="$(pwd)/build/lib"
50   ctest -VV --test-dir build
53 package() {
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}"
60 # vim: ts=2 sw=2 et: