pkgs/zstd/PKGBUILD

41 lines
1.1 KiB
Bash

# Maintainer: Daryl Ronningen <relms@relms.dev>
pkgname=zstd
pkgver=1.5.5
pkgrel=1
pkgdesc="Zstandard - Fast real-time compression algorithm"
arch=("x86_64")
url="https://facebook.github.io/zstd/"
license=(BSD GPL2)
source=("https://github.com/facebook/zstd/releases/download/v$pkgver/zstd-$pkgver.tar.gz")
sha256sums=("9c4396cc829cfae319a6e2615202e82aad41372073482fce286fac78646d3ee4")
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
}
build() {
cd $pkgname-$pkgver
cmake -S build/cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DZSTD_ZLIB_SUPPORT=ON \
-DZSTD_BUILD_CONTRIB=ON \
-DZSTD_BUILD_STATIC=OFF \
-DZSTD_BUILD_TESTS=ON \
-DZSTD_PROGRAMS_LINK_SHARED=ON
ninja -C build
}
package() {
cd $pkgname-$pkgver
DESTDIR=$pkgdir ninja -C build install
install -Dm 644 LICENSE -t $pkgdir/usr/share/licenses/$pkgname
mv $pkgdir/usr/lib64 $pkgdir/usr/lib
}