# Contributor: Leo # Contributor: stef # Contributor: André Klitzing # Maintainer: Natanael Copa pkgname=zstd pkgver=1.5.5 pkgrel=7 pkgdesc="Zstandard - Fast real-time compression algorithm" url="https://www.zstd.net/" arch="all" license="BSD-3-Clause GPL-2.0-or-later" depends_dev="$pkgname=$pkgver-r$pkgrel" makedepends="grep meson" checkdepends="file" subpackages=" $pkgname-libs $pkgname-static $pkgname-dev $pkgname-doc $pkgname-frugal " source="zstd-$pkgver.tar.gz::https://github.com/facebook/zstd/archive/v$pkgver.tar.gz" # we run the tests in build() for pgo, so it's tested from there. # options="!check" # secfixes: # 1.4.9-r0: # - CVE-2021-24032 # 1.4.1-r0: # - CVE-2021-24031 # 1.3.8-r0: # - CVE-2019-11922 build() { export CFLAGS="${CFLAGS/-Os/-O3} -flto=auto -ffat-lto-objects" export CXXFLAGS="${CXXFLAGS/-Os/-O3} -flto=auto -ffat-lto-objects" export CPPFLAGS="${CPPFLAGS/-Os/-O3} -flto=auto -ffat-lto-objects" if [ -z "$BOOTSTRAP" ]; then local pgo=true fi # 2-stage pgo+lto build (non-bootstrap), standard meson usage. # note that with clang, # llvm-profdata merge --output=output/somefilename(?) output/*.profraw # is needed. # believe it or not, this is +30% faster on x86_64 than the default makefile build (same params).. # maybe needs more testing # shellcheck disable=2046 abuild-meson \ --default-library=both \ -Db_ndebug=true \ $(test $pgo = true && echo -Db_pgo=generate) \ -Dbin_contrib=true \ -Dbin_programs=true \ -Dbin_tests="$(want_check && echo true || echo false)" \ -Dbacktrace=disabled \ -Dmulti_thread=enabled \ -Dlz4=disabled \ -Dlzma=disabled \ -Dzlib=disabled \ build/meson output meson compile -C output if [ $pgo = true ]; then meson test -t 4 --no-rebuild --print-errorlogs -C output meson configure -Dbin_tests=false -Db_pgo=use output meson compile -C output fi } check() { # ran in build above, via pgo return 0 #meson test -t 4 --no-rebuild --print-errorlogs -C output } package() { DESTDIR="$pkgdir" meson install --no-rebuild -C output } frugal() { pkgdesc="$pkgdesc (frugal cli)" amove usr/bin/zstd-frugal } sha512sums=" 356994e0d8188ce97590bf86b602eb50cbcb2f951594afb9c2d6e03cc68f966862505afc4a50e76efd55e4cfb11dbc9b15c7837b7827a961a1311ef72cd23505 zstd-1.5.5.tar.gz "