2022-03-20 13:19:37 +01:00
|
|
|
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
|
|
|
|
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
|
|
|
|
# Contributor: Andrzej Giniewicz <gginiu@gmail.com>
|
|
|
|
# Contributor: Johan Förberg <johan@forberg.se>
|
|
|
|
|
|
|
|
pkgname=zstd
|
2024-05-12 21:47:06 +02:00
|
|
|
pkgver=1.5.6
|
2023-02-23 00:08:29 +01:00
|
|
|
pkgrel=1
|
2022-03-20 13:19:37 +01:00
|
|
|
pkgdesc='Zstandard - Fast real-time compression algorithm'
|
|
|
|
url='https://facebook.github.io/zstd/'
|
|
|
|
arch=(x86_64)
|
2024-05-12 21:47:06 +02:00
|
|
|
license=(
|
|
|
|
BSD-3-Clause
|
|
|
|
GPL-2.0-only
|
|
|
|
)
|
|
|
|
depends=(
|
|
|
|
glibc
|
|
|
|
gcc-libs
|
|
|
|
zlib
|
|
|
|
xz
|
|
|
|
lz4
|
|
|
|
)
|
|
|
|
makedepends=(
|
|
|
|
cmake
|
|
|
|
gtest
|
|
|
|
ninja
|
|
|
|
)
|
2022-03-20 13:19:37 +01:00
|
|
|
provides=(libzstd.so)
|
|
|
|
source=(https://github.com/facebook/zstd/releases/download/v${pkgver}/zstd-${pkgver}.tar.zst{,.sig})
|
2024-05-12 21:47:06 +02:00
|
|
|
sha256sums=('4aa8dd1c1115c0fd6b6b66c35c7f6ce7bd58cc1dfd3e4f175b45b39e84b14352'
|
2022-03-20 13:19:37 +01:00
|
|
|
'SKIP')
|
2024-05-12 21:47:06 +02:00
|
|
|
b2sums=('88430a6a5db47462f93f2458cd3cc4823913de2d2d979cad56b06b48367a4ee51f59c795944c16d06abfdd19758b69f0b6e504ed833d02ff76e4cda519d220e4'
|
2022-03-20 13:19:37 +01:00
|
|
|
'SKIP')
|
|
|
|
validpgpkeys=(4EF4AC63455FC9F4545D9B7DEF8FE99528B52FFD)
|
|
|
|
|
2022-06-18 14:42:51 +02:00
|
|
|
prepare() {
|
|
|
|
cd ${pkgname}-${pkgver}
|
|
|
|
# avoid error on tests without static libs, we use LD_LIBRARY_PATH
|
|
|
|
sed '/build static library to build tests/d' -i build/cmake/CMakeLists.txt
|
|
|
|
sed 's/libzstd_static/libzstd_shared/g' -i build/cmake/tests/CMakeLists.txt
|
|
|
|
}
|
|
|
|
|
2022-03-20 13:19:37 +01:00
|
|
|
build() {
|
2022-06-18 14:42:51 +02:00
|
|
|
cd ${pkgname}-${pkgver}
|
2022-06-16 22:35:42 +02:00
|
|
|
export CFLAGS+=' -ffat-lto-objects'
|
|
|
|
export CXXFLAGS+=' -ffat-lto-objects'
|
2022-06-18 14:42:51 +02:00
|
|
|
|
|
|
|
cmake -S build/cmake -B build -G Ninja \
|
2022-06-08 02:54:58 +02:00
|
|
|
-DCMAKE_BUILD_TYPE=None \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
2023-01-28 16:00:27 +01:00
|
|
|
-DZSTD_ZLIB_SUPPORT=ON \
|
|
|
|
-DZSTD_LZMA_SUPPORT=ON \
|
|
|
|
-DZSTD_LZ4_SUPPORT=ON \
|
2022-06-08 02:54:58 +02:00
|
|
|
-DZSTD_BUILD_CONTRIB=ON \
|
2022-06-16 22:35:42 +02:00
|
|
|
-DZSTD_BUILD_STATIC=OFF \
|
|
|
|
-DZSTD_BUILD_TESTS=ON \
|
2022-06-18 14:42:51 +02:00
|
|
|
-DZSTD_PROGRAMS_LINK_SHARED=ON
|
|
|
|
cmake --build build
|
2022-03-20 13:19:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2022-06-18 14:42:51 +02:00
|
|
|
cd ${pkgname}-${pkgver}
|
2023-02-23 00:08:29 +01:00
|
|
|
LD_LIBRARY_PATH="$(pwd)/build/lib" \
|
|
|
|
ctest -VV --test-dir build
|
2022-03-20 13:19:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2022-06-18 14:42:51 +02:00
|
|
|
cd ${pkgname}-${pkgver}
|
|
|
|
DESTDIR="${pkgdir}" cmake --install build
|
|
|
|
install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
|
2022-03-20 13:19:37 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# vim: ts=2 sw=2 et:
|