aboutsummaryrefslogtreecommitdiffstats
path: root/main/zstd/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'main/zstd/APKBUILD')
-rw-r--r--main/zstd/APKBUILD90
1 files changed, 56 insertions, 34 deletions
diff --git a/main/zstd/APKBUILD b/main/zstd/APKBUILD
index f12b72c2967..e0ce02bb392 100644
--- a/main/zstd/APKBUILD
+++ b/main/zstd/APKBUILD
@@ -1,18 +1,27 @@
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Contributor: stef <l0ls0fo2i@ctrlc.hu>
-# Maintainer: André Klitzing <aklitzing@gmail.com>
+# Contributor: André Klitzing <aklitzing@gmail.com>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=zstd
-pkgver=1.5.0
+pkgver=1.5.6
pkgrel=0
pkgdesc="Zstandard - Fast real-time compression algorithm"
url="https://www.zstd.net/"
arch="all"
-license="BSD-3-Clause GPL-2.0-or-later"
+license="BSD-3-Clause OR GPL-2.0-or-later"
+depends_dev="$pkgname=$pkgver-r$pkgrel"
+makedepends="grep meson"
checkdepends="file"
-makedepends="$makedepends_build"
-makedepends_build="grep"
-subpackages="$pkgname-static $pkgname-libs $pkgname-dev $pkgname-doc pzstd"
+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:
@@ -22,46 +31,59 @@ source="zstd-$pkgver.tar.gz::https://github.com/facebook/zstd/archive/v$pkgver.t
# 1.3.8-r0:
# - CVE-2019-11922
-unset CPPFLAGS
-export CFLAGS="$CFLAGS -O2 -fno-strict-aliasing -fPIC"
-case "$CARCH" in
- # avoid memory copy hack that violates C standard
- armhf) export CFLAGS="$CFLAGS -DMEM_FORCE_MEMORY_ACCESS=0" ;;
-esac
+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
-case "$CARCH" in
- arm*) options="!check" ;;
-esac
+ meson compile -C output
-build() {
- make -C lib HAVE_PTHREAD=1 HAVE_ZLIB=0 HAVE_LZMA=0 HAVE_LZ4=0 lib-mt
- make -C programs HAVE_PTHREAD=1 HAVE_ZLIB=0 HAVE_LZMA=0 HAVE_LZ4=0
- make -C contrib/pzstd
+ 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() {
- msg "running check"
- make -C tests test-zstd
- make -C contrib/pzstd test
+ # ran in build above, via pgo
+ return 0
+ #meson test -t 4 --no-rebuild --print-errorlogs -C output
}
package() {
- make PREFIX="/usr" DESTDIR="$pkgdir" install
+ DESTDIR="$pkgdir" meson install --no-rebuild -C output
}
-static() {
- pkgdesc="zstd static library"
- mkdir -p "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
-}
+frugal() {
+ pkgdesc="$pkgdesc (frugal cli)"
-pzstd() {
- pkgdesc="parallel zstd"
- make -C "$builddir"/contrib/pzstd install PREFIX=/usr DESTDIR="$subpkgdir"
+ amove usr/bin/zstd-frugal
}
sha512sums="
-f529db9c094f9ae26428bf1fdfcc91c6d783d400980e0f0d802d2cf13c2be2931465ef568907e03841ff76a369a1447e7371f8799d8526edb9a513ba5c6db133 zstd-1.4.9.tar.gz
-06729a299183ea974190d65264c8feb349cf9ce63fd16c5a082a6743aa9054f12898b569a68ff1d84892ddbc9e92d69ca124af586baf123a8bc91ad326be8797 Reduce-memory-usage-of-MT-CLI-tests.patch
+ca12dffd86618ca008e1ecc79056c1129cb4e61668bf13a3cd5b2fa5c93bc9c92c80f64c1870c68b9c20009d9b3a834eac70db72242d5106125a1c53cccf8de8 zstd-1.5.6.tar.gz
"
-sha512sums="25b657529a698eec891f92ff4a085d1fd95d2ff938ce52c8a4ff6163eb0b668ec642dd09e0db190652638cd92371006afa01d8e437437762c4097ad301675c33 zstd-1.5.0.tar.gz"