app-arch/zstd: Sync with Gentoo

It's from Gentoo commit 90b422d5d85f278d71181d142f5b26863f6e1700.
This commit is contained in:
Flatcar Buildbot 2025-02-25 12:33:58 +01:00 committed by Krzesimir Nowak
parent 30ab7cc0f2
commit 78efa0b3d6
2 changed files with 72 additions and 0 deletions

View File

@ -1 +1,2 @@
DIST zstd-1.5.6.tar.gz 2406875 BLAKE2B fe17cf0950f8ee2cc07bfa2b41e97f36a1832e396386cb94a55bede975dc974920578cf147b39eecbc5b53ff06fe0dc1fe781a4cab9bc9f767ea28c0e786422e SHA512 54a578f2484da0520a6e9a24f501b9540a3fe3806785d6bc9db79fc095b7c142a7c121387c7eecd460ca71446603584ef1ba4d29a33ca90873338c9ffbd04f14
DIST zstd-1.5.7.tar.gz 2434947 BLAKE2B ef6bcf13bbb79edce2de21ef4860b01dcb4d2dd47ebd03657d5331c3bb1a207ef128e99ed907a32e787dca7bb51df225ebd8abb2097d03d02c003ca713e1e271 SHA512 b4de208f179b68d4c6454139ca60d66ed3ef3893a560d6159a056640f83d3ee67cdf6ffb88971cdba35449dba4b597eaa8b4ae908127ef7fd58c89f40bf9a705

View File

@ -0,0 +1,71 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit meson-multilib
DESCRIPTION="zstd fast compression library"
HOMEPAGE="https://facebook.github.io/zstd/"
SRC_URI="https://github.com/facebook/zstd/releases/download/v${PV}/${P}.tar.gz"
S="${WORKDIR}"/${P}/build/meson
LICENSE="|| ( BSD GPL-2 )"
SLOT="0/1"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="+lzma lz4 static-libs test zlib"
RESTRICT="!test? ( test )"
RDEPEND="
lzma? ( app-arch/xz-utils )
lz4? ( app-arch/lz4:= )
zlib? ( sys-libs/zlib )
"
DEPEND="${RDEPEND}"
MESON_PATCHES=(
# Workaround until Valgrind bugfix lands
"${FILESDIR}"/${PN}-1.5.4-no-find-valgrind.patch
)
PATCHES=(
)
src_prepare() {
cd "${WORKDIR}"/${P} || die
default
cd "${S}" || die
eapply "${MESON_PATCHES[@]}"
}
multilib_src_configure() {
local native_file="${T}"/meson.${CHOST}.${ABI}.ini.local
# This replaces the no-find-valgrind patch once bugfix lands in a meson
# release + we can BDEPEND on it (https://github.com/mesonbuild/meson/pull/11372)
cat >> ${native_file} <<-EOF || die
[binaries]
valgrind='valgrind-falseified'
EOF
local emesonargs=(
-Ddefault_library=$(multilib_native_usex static-libs both shared)
$(meson_native_true bin_programs)
$(meson_native_true bin_contrib)
$(meson_use test bin_tests)
$(meson_native_use_feature zlib)
$(meson_native_use_feature lzma)
$(meson_native_use_feature lz4)
--native-file "${native_file}"
)
meson_src_configure
}
multilib_src_test() {
meson_src_test --timeout-multiplier=2
}