diff options
Diffstat (limited to 'main/zstd/APKBUILD')
-rw-r--r-- | main/zstd/APKBUILD | 93 |
1 files changed, 67 insertions, 26 deletions
diff --git a/main/zstd/APKBUILD b/main/zstd/APKBUILD index ca8775f280e..e0ce02bb392 100644 --- a/main/zstd/APKBUILD +++ b/main/zstd/APKBUILD @@ -1,48 +1,89 @@ +# 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.4.5 -pkgrel=1 +pkgver=1.5.6 +pkgrel=0 pkgdesc="Zstandard - Fast real-time compression algorithm" -url="https://www.zstd.net" +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="grep" -subpackages="$pkgname-static $pkgname-libs $pkgname-dev $pkgname-doc" -source="zstd-$pkgver.tar.gz::https://github.com/facebook/zstd/archive/v$pkgver.tar.gz +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() { - unset CPPFLAGS - local _moreflags="-O2 -fno-strict-aliasing" - case "$CARCH" in - # avoid memory copy hack that violates C standard - armhf) _moreflags="$_moreflags -DMEM_FORCE_MEMORY_ACCESS=0" ;; - esac - make HAVE_PTHREAD=1 HAVE_ZLIB=0 HAVE_LZMA=0 HAVE_LZ4=0 CFLAGS="$CFLAGS $_moreflags" + 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() { - msg "running check" - case "$CARCH" in - arm*) make check CFLAGS="$CFLAGS -O2 -fno-strict-aliasing";; - *) make test CFLAGS="$CFLAGS -O2 -fno-strict-aliasing";; - esac + # 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)" + + amove usr/bin/zstd-frugal } -sha512sums="b03c497c3e0590c3d384cb856e3024f144b2bfac0d805d80e68deafa612c68237f12a2d657416d476a28059e80936c79f099fc42331464b417593895ea214387 zstd-1.4.5.tar.gz" +sha512sums=" +ca12dffd86618ca008e1ecc79056c1129cb4e61668bf13a3cd5b2fa5c93bc9c92c80f64c1870c68b9c20009d9b3a834eac70db72242d5106125a1c53cccf8de8 zstd-1.5.6.tar.gz +" |