sys-libs/minizip-ng: add multilib

If this is ever going to be a thing with compat, we obviously need this.

We could conditionalise stuff on USE=compat but I don't really see the value
in that; still possible we could want this for newly built 32-bit stuff anyway.

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2023-06-16 02:41:23 +01:00
parent dc3acbe1cf
commit 2bbaee3e53

View File

@@ -6,7 +6,7 @@ EAPI=8
# Worth keeping an eye on 'develop' branch upstream for possible backports,
# as they copied this practice from sys-libs/zlib upstream.
inherit cmake
inherit cmake-multilib
DESCRIPTION="Fork of the popular zip manipulation library found in the zlib distribution"
HOMEPAGE="https://github.com/zlib-ng/minizip-ng"
@@ -21,20 +21,20 @@ RESTRICT="!test? ( test )"
# Automagically prefers sys-libs/zlib-ng if installed, so let's
# just depend on it as presumably it's better tested anyway.
RDEPEND="
app-arch/bzip2
app-arch/bzip2[${MULTILIB_USEDEP}]
app-arch/xz-utils
sys-libs/zlib-ng
sys-libs/zlib-ng[${MULTILIB_USEDEP}]
virtual/libiconv
compat? ( !sys-libs/zlib[minizip] )
openssl? ( dev-libs/openssl:= )
zstd? ( app-arch/zstd:= )
openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
"
DEPEND="
${RDEPEND}
test? ( dev-cpp/gtest )
"
src_configure() {
multilib_src_configure() {
local mycmakeargs=(
-DMZ_COMPAT=$(usex compat)
@@ -64,7 +64,7 @@ src_configure() {
cmake_src_configure
}
src_test() {
multilib_src_test() {
local myctestargs=(
# TODO: investigate
-E "(raw-unzip-pkcrypt|raw-append-unzip-pkcrypt|raw-erase-unzip-pkcrypt|deflate-unzip-pkcrypt|deflate-append-unzip-pkcrypt|deflate-erase-unzip-pkcrypt|bzip2-unzip-pkcrypt|bzip2-append-unzip-pkcrypt|bzip2-erase-unzip-pkcrypt|lzma-unzip-pkcrypt|lzma-append-unzip-pkcrypt|lzma-erase-unzip-pkcrypt|xz-unzip-pkcrypt|xz-append-unzip-pkcrypt|xz-erase-unzip-pkcrypt|zstd-unzip-pkcrypt|zstd-append-unzip-pkcrypt|zstd-erase-unzip-pkcrypt)"
@@ -76,15 +76,15 @@ src_test() {
cmake_src_test -j1
}
src_install() {
cmake_src_install
if use test ; then
multilib_src_install_all() {
if ! use compat && use test ; then
# Test binaries, bug #874591
rm "${ED}"/usr/bin/minigzip || die
rm "${ED}"/usr/bin/minizip-ng || die
fi
}
pkg_postinst() {
if use compat ; then
ewarn "minizip-ng is experimental and replacing the system zlib[minizip] is dangerous"
ewarn "Please be careful!"