archrelease: copy trunk to community-any
[ArchLinux/community.git] / lib32-zstd / trunk / PKGBUILD
blobf2f7800c2df9f64c914ce899fe840927e6dadd9b
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 pkgname=lib32-zstd
8 pkgver=1.5.5
9 pkgrel=1
10 pkgdesc='Zstandard - Fast real-time compression algorithm (32-bit)'
11 url='https://facebook.github.io/zstd/'
12 arch=(x86_64)
13 license=(BSD GPL2)
14 depends=(zstd lib32-glibc)
15 makedepends=(cmake gtest ninja)
16 provides=(libzstd.so)
17 source=(https://github.com/facebook/zstd/releases/download/v${pkgver}/zstd-${pkgver}.tar.zst{,.sig})
18 sha256sums=('ce264bca60eb2f0e99e4508cffd0d4d19dd362e84244d7fc941e79fa69ccf673'
19             'SKIP')
20 b2sums=('2c2dc95f227e661ada23d8f6141bcd293505ce14e605f946ae00d4d4ac37d10b4eb08279ef7560618c67caf266431f76686fda5ae1921d698a6a93bbaf9a0052'
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 CC="gcc -m32"
34   export CXX="g++ -m32"
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
48   cmake --build build
51 check() {
52   cd ${_pkgname}-${pkgver}
53   LD_LIBRARY_PATH="$(pwd)/build/lib" \
54     ctest -VV --test-dir build
57 package() {
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}"
64 # vim: ts=2 sw=2 et: