sys-libs/minizip-ng - 4.2.1 (gentoo)

Search

Notice: This package is in a virtual group: virtual/minizip, virtual/zlib
Equivalents: sys-libs/zlib, sys-libs/zlib-ng

Install

Install this version:

emerge -a =sys-libs/minizip-ng-4.2.1

If this version is masked, you can unmask it using the autounmask tool or standard emerge options:

autounmask =sys-libs/minizip-ng-4.2.1

Or alternatively:

emerge --autounmask-write -a =sys-libs/minizip-ng-4.2.1

Package Information

Description:
Fork of the popular zip manipulation library found in the zlib distribution
Homepage:
https://github.com/zlib-ng/minizip-ng
License:
ZLIB

Ebuild Details

Version EAPI Keywords Slot
4.2.1 8 ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc64 ~riscv ~x86 0/4
View Raw Ebuild
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

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-multilib multibuild

DESCRIPTION="Fork of the popular zip manipulation library found in the zlib distribution"
HOMEPAGE="https://github.com/zlib-ng/minizip-ng"
SRC_URI="https://github.com/zlib-ng/minizip-ng/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="ZLIB"
SLOT="0/4"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc64 ~riscv ~x86"
IUSE="compat lzma openssl test zstd"
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[${MULTILIB_USEDEP}]
	dev-libs/libbsd[${MULTILIB_USEDEP}]
	sys-libs/zlib-ng[${MULTILIB_USEDEP}]
	virtual/libiconv
	compat? ( !sys-libs/zlib[minizip] )
	lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
	openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
	zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
"
DEPEND="
	${RDEPEND}
	test? ( dev-cpp/gtest[${MULTILIB_USEDEP}] )
"

run_both() {
	local MULTIBUILD_VARIANTS=( base )
	use compat && MULTIBUILD_VARIANTS+=( compat )

	multibuild_foreach_variant "${@}"
}

my_src_configure() {
	local compat=OFF
	[[ ${MULTIBUILD_VARIANT} == compat ]] && compat=ON
	local mycmakeargs=(
		"${mycmakeargs[@]}"
		-DMZ_COMPAT="${compat}"
	)

	cmake_src_configure
}

multilib_src_configure() {
	local mycmakeargs=(
		# Controls installing "minizip" and "minigzip" tools.  Install
		# them unconditionally to avoid divergence with USE=test.
		-DMZ_BUILD_TESTS=ON
		-DMZ_BUILD_UNIT_TESTS=$(usex test)

		-DMZ_FETCH_LIBS=OFF
		-DMZ_FORCE_FETCH_LIBS=OFF

		# Compression library options
		-DMZ_ZLIB=ON
		-DMZ_BZIP2=ON
		-DMZ_LZMA=$(usex lzma)
		-DMZ_ZSTD=$(usex zstd)
		-DMZ_LIBCOMP=OFF
		-DMZ_PPMD=OFF

		# Encryption support options
		-DMZ_PKCRYPT=ON
		-DMZ_WZAES=ON
		-DMZ_OPENSSL=$(usex openssl)
		-DMZ_LIBBSD=ON

		# Character conversion options
		-DMZ_ICONV=ON
	)

	run_both my_src_configure
}

multilib_src_compile() { run_both cmake_src_compile; }

multilib_src_test() {
	# TODO: A bunch of tests end up looping and writing over each other's files
	# It gets better with a patch applied (see https://github.com/zlib-ng/minizip-ng/issues/623#issuecomment-1264518994)
	# but still hangs.
	local CTEST_JOBS=1
	run_both cmake_src_test
}

multilib_src_install() { run_both cmake_src_install; }

pkg_postinst() {
	if use compat ; then
		ewarn "minizip-ng is experimental and replacing the system zlib[minizip] is dangerous"
		ewarn "Please be careful!"
	fi
}

USE Flags

Manage flags for this package: euse -i <flag> -p sys-libs/minizip-ng | euse -E <flag> -p sys-libs/minizip-ng | euse -D <flag> -p sys-libs/minizip-ng

Global/Standard Flags

Inherited Eclasses

Dependencies

DEPEND

	
	app-arch/bzip2[]
	dev-libs/libbsd[]
	sys-libs/zlib-ng[]
	virtual/libiconv
	compat? ( !sys-libs/zlib[minizip] )
	lzma? ( app-arch/xz-utils[] )
	openssl? ( dev-libs/openssl:=[] )
	zstd? ( app-arch/zstd:=[] )

	test? ( dev-cpp/gtest[] )

RDEPEND

	app-arch/bzip2[]
	dev-libs/libbsd[]
	sys-libs/zlib-ng[]
	virtual/libiconv
	compat? ( !sys-libs/zlib[minizip] )
	lzma? ( app-arch/xz-utils[] )
	openssl? ( dev-libs/openssl:=[] )
	zstd? ( app-arch/zstd:=[] )

Manifest for 4.2.1

Type File Size Source URLs
DIST minizip-ng-4.2.1.tar.gz 610659 bytes https://github.com/zlib-ng/minizip-ng/archive/refs/tags/4.2.1.tar.gz