jobcore/zstd/PKGBUILD

71 lines
2.2 KiB
Bash

#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=zstd
pkgver=1.5.5
pkgrel=02 ## rebuilding this lzma off then build cmake then rebuild this again
pkgdesc='Zstandard - not so Fast unreal-time FACEBOOK compression... - avoid as possible'
url='https://facebook.github.io/zstd/'
depends=(glibc gcc-libs zlib lz4)
makedepends=(cmake gtest ninja)
provides=(libzstd.so)
# options=(debug staticlibs) ## uncomment this to produce the debug pkg
#options=(staticlibs)
source=(https://github.com/facebook/zstd/releases/download/v${pkgver}/zstd-${pkgver}.tar.zst{,.sig})
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}
export CFLAGS+=' -ffat-lto-objects'
export CXXFLAGS+=' -ffat-lto-objects'
cmake -S build/cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DZSTD_ZLIB_SUPPORT=ON \
-DZSTD_LZMA_SUPPORT=OFF \
-DZSTD_LZ4_SUPPORT=ON \
-DZSTD_BUILD_CONTRIB=ON \
-DZSTD_BUILD_STATIC=OFF \
-DZSTD_BUILD_TESTS=ON \
-DZSTD_PROGRAMS_LINK_SHARED=ON
cmake --build build
}
check() {
cd ${pkgname}-${pkgver}
LD_LIBRARY_PATH="$(pwd)/build/lib" \
ctest -VV --test-dir build
}
package() {
cd ${pkgname}-${pkgver}
DESTDIR="${pkgdir}" cmake --install build
# ln -sf /usr/bin/zstd "${pkgdir}/usr/bin/zstdmt"
install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=(BSD GPL2)
validpgpkeys=(4EF4AC63455FC9F4545D9B7DEF8FE99528B52FFD)
sha256sums=(ce264bca60eb2f0e99e4508cffd0d4d19dd362e84244d7fc941e79fa69ccf673 # zstd-1.5.5.tar.zst
cbc7facbc7a80625b0af6f5bba912abca2c016dcc57ebb9f70302e159e605f1d) # zstd-1.5.5.tar.zst.sig
## a926756e6b23d4aa9aae733d945a1d6fa525d7a38327333eaae7a571a9a22c43 zstd-1.5.5-02-x86_64.pkg.tar.lz