public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/minizip-ng/, sys-libs/minizip-ng/files/
@ 2022-10-02  1:01 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2022-10-02  1:01 UTC (permalink / raw
  To: gentoo-commits

commit:     3441ab9985c98c9f21bf4e529c54e0db84c19187
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct  2 00:58:20 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct  2 01:00:54 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3441ab99

sys-libs/minizip-ng: new package, add 3.0.6

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/minizip-ng/Manifest                       |   1 +
 ...-getrandom-and-arc4random_buf-usage-order.patch |  68 +++++++++++
 .../files/minizip-ng-3.0.6-test-temporary.patch    | 129 +++++++++++++++++++++
 sys-libs/minizip-ng/metadata.xml                   |  15 +++
 sys-libs/minizip-ng/minizip-ng-3.0.6.ebuild        |  80 +++++++++++++
 5 files changed, 293 insertions(+)

diff --git a/sys-libs/minizip-ng/Manifest b/sys-libs/minizip-ng/Manifest
new file mode 100644
index 000000000000..a1c9881d8a0e
--- /dev/null
+++ b/sys-libs/minizip-ng/Manifest
@@ -0,0 +1 @@
+DIST minizip-ng-3.0.6.tar.gz 642138 BLAKE2B 3faddeef035da0417671ef5578b90ad9ec9a69f376d04fb8095f93e27e3276931ef432e179613e841e754ff6e915e8c631eeaa48795aaa87773e45465bd14afa SHA512 92aaad655e7dbec60ab8075435ccdc72314f75f0516aa4a16094215df2b14b108c2b49cdf6c876e396f0f43f52ad63f52ce7db2e119efe25c55b8b873bef9d4f

diff --git a/sys-libs/minizip-ng/files/minizip-ng-3.0.6-Switch-getrandom-and-arc4random_buf-usage-order.patch b/sys-libs/minizip-ng/files/minizip-ng-3.0.6-Switch-getrandom-and-arc4random_buf-usage-order.patch
new file mode 100644
index 000000000000..92db9c05b5d1
--- /dev/null
+++ b/sys-libs/minizip-ng/files/minizip-ng-3.0.6-Switch-getrandom-and-arc4random_buf-usage-order.patch
@@ -0,0 +1,68 @@
+https://github.com/zlib-ng/minizip-ng/pull/651
+
+From 1be6ea22e127a99786aefd2896e08bab43ad1333 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sun, 2 Oct 2022 01:39:17 +0100
+Subject: [PATCH] Switch getrandom() and arc4random_buf() usage order
+
+We need to match the order of inclusions at the top of the file
+otherwise we might end up trying to use arc4random_buf() when
+available (because HAVE_ARC4RANODM_BUF is set) even though
+we hit HAVE_GETRANDOM first above and only included
+<sys/random.h> because of it.
+
+Besides, if getrandom() is available, we should really prefer
+it anyway.
+
+Fixes an implicit function declaration:
+```
+minizip-ng-3.0.6/mz_os_posix.c:124:5: error: implicit declaration of function 'arc4random_buf' [-Werror=implicit-function-declaration]
+```
+--- a/mz_os_posix.c
++++ b/mz_os_posix.c
+@@ -117,7 +117,22 @@ void mz_os_utf8_string_delete(uint8_t **string) {
+ 
+ /***************************************************************************/
+ 
+-#if defined(HAVE_ARC4RANDOM_BUF)
++#if defined(HAVE_GETRANDOM)
++int32_t mz_os_rand(uint8_t *buf, int32_t size) {
++    int32_t left = size;
++    int32_t written = 0;
++
++    while (left > 0) {
++        written = getrandom(buf, left, 0);
++        if (written < 0)
++            return MZ_INTERNAL_ERROR;
++
++        buf += written;
++        left -= written;
++    }
++    return size - left;
++}
++#elif defined(HAVE_ARC4RANDOM_BUF)
+ int32_t mz_os_rand(uint8_t *buf, int32_t size) {
+     if (size < 0)
+         return 0;
+@@ -139,21 +154,6 @@ int32_t mz_os_rand(uint8_t *buf, int32_t size) {
+     }
+     return size - left;
+ }
+-#elif defined(HAVE_GETRANDOM)
+-int32_t mz_os_rand(uint8_t *buf, int32_t size) {
+-    int32_t left = size;
+-    int32_t written = 0;
+-
+-    while (left > 0) {
+-        written = getrandom(buf, left, 0);
+-        if (written < 0)
+-            return MZ_INTERNAL_ERROR;
+-
+-        buf += written;
+-        left -= written;
+-    }
+-    return size - left;
+-}
+ #else
+ int32_t mz_os_rand(uint8_t *buf, int32_t size) {
+     static unsigned calls = 0;

diff --git a/sys-libs/minizip-ng/files/minizip-ng-3.0.6-test-temporary.patch b/sys-libs/minizip-ng/files/minizip-ng-3.0.6-test-temporary.patch
new file mode 100644
index 000000000000..d38603ac7378
--- /dev/null
+++ b/sys-libs/minizip-ng/files/minizip-ng-3.0.6-test-temporary.patch
@@ -0,0 +1,129 @@
+https://github.com/zlib-ng/minizip-ng/issues/623
+https://github.com/zlib-ng/minizip-ng/commit/6261d6f5ec5bd275257354c048f68ad9723c3231
+
+From 6261d6f5ec5bd275257354c048f68ad9723c3231 Mon Sep 17 00:00:00 2001
+From: Nathan Moinvaziri <nathan@solidstatenetworks.com>
+Date: Sat, 11 Jun 2022 10:36:42 -0700
+Subject: [PATCH] Generate test files in binary temp directory.
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -804,6 +804,8 @@ if(MZ_BUILD_TESTS AND MZ_BUILD_UNIT_TESTS)
+         endif()
+     endif()
+ 
++    set(TEST_TEMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/Testing/Temporary)
++
+     add_test(NAME test_cmd COMMAND test_cmd WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+ 
+     function(create_compress_tests EXTRA_NAME EXTRA_ARGS)
+@@ -840,33 +842,43 @@ if(MZ_BUILD_TESTS AND MZ_BUILD_UNIT_TESTS)
+         foreach(INDEX RANGE ${COMPRESS_METHOD_COUNT})
+             list(GET COMPRESS_METHOD_NAMES ${INDEX} COMPRESS_METHOD_NAME)
+             list(GET COMPRESS_METHOD_ARGS ${INDEX} COMPRESS_METHOD_ARG)
++
++            set(COMPRESS_METHOD_DEST_DIR
++                ${TEST_TEMP_DIR}/${COMPRESS_METHOD_NAME}-${EXTRA_NAME})
++            set(COMPRESS_METHOD_PATH
++                ${TEST_TEMP_DIR}/${COMPRESS_METHOD_NAME}-${EXTRA_NAME}.zip)
++
+             add_test(NAME ${COMPRESS_METHOD_NAME}-zip-${EXTRA_NAME}
+                      COMMAND minizip_cmd ${COMPRESS_METHOD_ARG} -o ${EXTRA_ARGS}
+-                        result.zip test.c test.h empty.txt random.bin uniform.bin fuzz
++                        ${COMPRESS_METHOD_PATH}
++                        test.c test.h empty.txt random.bin uniform.bin fuzz
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+             add_test(NAME ${COMPRESS_METHOD_NAME}-list-${EXTRA_NAME}
+-                     COMMAND minizip_cmd -l ${EXTRA_ARGS} result.zip
++                     COMMAND minizip_cmd -l ${EXTRA_ARGS} ${COMPRESS_METHOD_PATH}
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+             if(NOT MZ_COMPRESS_ONLY)
+                 add_test(NAME ${COMPRESS_METHOD_NAME}-unzip-${EXTRA_NAME}
+-                         COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out result.zip
++                         COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
++                            -d ${COMPRESS_METHOD_DEST_DIR} ${COMPRESS_METHOD_PATH}
+                          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+             endif()
+             add_test(NAME ${COMPRESS_METHOD_NAME}-append-${EXTRA_NAME}
+                     COMMAND minizip_cmd ${COMPRESS_METHOD_ARG} -a ${EXTRA_ARGS}
+-                        result.zip single.txt
++                        ${COMPRESS_METHOD_PATH} single.txt
+                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+             if(NOT MZ_COMPRESS_ONLY)
+                 add_test(NAME ${COMPRESS_METHOD_NAME}-append-unzip-${EXTRA_NAME}
+-                            COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out result.zip
++                            COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
++                                -d ${COMPRESS_METHOD_DEST_DIR} ${COMPRESS_METHOD_PATH}
+                             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+             endif()
+             add_test(NAME ${COMPRESS_METHOD_NAME}-erase-${EXTRA_NAME}
+-                    COMMAND minizip_cmd -o -e result.zip test.c test.h
++                    COMMAND minizip_cmd -o -e ${COMPRESS_METHOD_PATH} test.c test.h
+                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+             if(NOT MZ_COMPRESS_ONLY)
+                 add_test(NAME ${COMPRESS_METHOD_NAME}-erase-unzip-${EXTRA_NAME}
+-                         COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out result.zip
++                         COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
++                            -d ${COMPRESS_METHOD_DEST_DIR} ${COMPRESS_METHOD_PATH}
+                          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+             endif()
+         endforeach()
+@@ -891,43 +903,49 @@ if(MZ_BUILD_TESTS AND MZ_BUILD_UNIT_TESTS)
+     if(NOT MZ_COMPRESS_ONLY)
+         if(MZ_ZLIB OR MZ_LIBCOMP)
+             add_test(NAME unzip-tiny
+-                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out
++                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
++                        -d ${TEST_TEMP_DIR}/unzip-tiny
+                         fuzz/unzip_fuzzer_seed_corpus/tiny.zip
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+         endif()
+         if(MZ_BZIP2)
+             add_test(NAME unzip-bzip2
+-                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out
++                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
++                        -d ${TEST_TEMP_DIR}/unzip-bzip2
+                         fuzz/unzip_fuzzer_seed_corpus/bzip2.zip
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+         endif()
+         if(MZ_LZMA)
+             add_test(NAME unzip-lzma
+-                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out
++                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
++                        -d ${TEST_TEMP_DIR}/unzip-lzma
+                         fuzz/unzip_fuzzer_seed_corpus/lzma.zip
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+         endif()
+         if(MZ_PKCRYPT)
+             add_test(NAME unzip-pkcrypt
+-                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out -p test123
++                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
++                        -d ${TEST_TEMP_DIR}/unzip-pkcrypt -p test123
+                         fuzz/unzip_fuzzer_seed_corpus/encrypted_pkcrypt.zip
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+         endif()
+         if(MZ_WZAES)
+             add_test(NAME unzip-wzaes
+-                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out -p test123
++                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
++                        -d ${TEST_TEMP_DIR}/unzip-wzaes -p test123
+                         fuzz/unzip_fuzzer_seed_corpus/encrypted_wzaes.zip
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
+         endif()
+     endif()
+     if(NOT MZ_COMPRESS_ONLY AND NOT MZ_DECOMPRESS_ONLY)
+         if(MZ_ZLIB AND NOT MZ_LIBCOMP)
++            file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test/random.bin DESTINATION ${TEST_TEMP_DIR})
+             add_test(NAME gz
+                 COMMAND minigzip_cmd random.bin
+-                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
++                WORKING_DIRECTORY ${TEST_TEMP_DIR})
+             add_test(NAME ungz
+-                COMMAND minigzip_cmd -x -d out random.bin.gz
+-                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
++                COMMAND minigzip_cmd -x -d ${TEST_TEMP_DIR} random.bin.gz
++                WORKING_DIRECTORY ${TEST_TEMP_DIR})
+         endif()
+     endif()
+ endif()
+

diff --git a/sys-libs/minizip-ng/metadata.xml b/sys-libs/minizip-ng/metadata.xml
new file mode 100644
index 000000000000..f712872be38f
--- /dev/null
+++ b/sys-libs/minizip-ng/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>base-system@gentoo.org</email>
+		<name>Gentoo Base System</name>
+	</maintainer>
+	<use>
+		<flag name="compat">Enable compatibility with <pkg>sys-libs/zlib</pkg>'s USE=minizip</flag>
+		<flag name="openssl">Use <pkg>dev-libs/openssl</pkg> for further encryption capabilities</flag>
+	</use>
+	<upstream>
+		<remote-id type="github">zlib-ng/minizip-ng</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sys-libs/minizip-ng/minizip-ng-3.0.6.ebuild b/sys-libs/minizip-ng/minizip-ng-3.0.6.ebuild
new file mode 100644
index 000000000000..e27b7d11fd07
--- /dev/null
+++ b/sys-libs/minizip-ng/minizip-ng-3.0.6.ebuild
@@ -0,0 +1,80 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+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"
+KEYWORDS="~amd64 ~x86"
+IUSE="compat openssl test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	virtual/libiconv
+	compat? ( !sys-libs/zlib[minizip] )
+	openssl? ( dev-libs/openssl:= )
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-3.0.6-Switch-getrandom-and-arc4random_buf-usage-order.patch
+	"${FILESDIR}"/minizip-ng-3.0.6-test-temporary.patch
+)
+
+src_configure() {
+	local mycmakeargs=(
+		-DMZ_COMPAT=$(usex compat)
+		-DMZ_BUILD_TESTS=$(usex test)
+		-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=ON
+		-DMZ_ZSTD=ON
+		-DMZ_LIBCOMP=OFF
+
+		# Encryption support options
+		-DMZ_PKCRYPT=ON
+		-DMZ_WZAES=ON
+		-DMZ_OPENSSL=$(usex openssl)
+		# TODO: Re-enable, ideally unconditionally, for arc4random
+		# Revisit when https://github.com/zlib-ng/minizip-ng/pull/648 fixed
+		-DMZ_LIBBSD=ON
+		-DMZ_SIGNING=ON
+
+		# Character conversion options
+		-DMZ_ICONV=ON
+	)
+
+	cmake_src_configure
+}
+
+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)"
+	)
+
+	# 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.
+	cmake_src_test -j1
+}
+
+src_install() {
+	cmake_src_install
+
+	if use compat ; then
+		ewarn "minizip-ng is experimental and replacing the system zlib[minizip] is dangerous"
+		ewarn "Please be careful!"
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/minizip-ng/, sys-libs/minizip-ng/files/
@ 2022-11-19  3:19 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2022-11-19  3:19 UTC (permalink / raw
  To: gentoo-commits

commit:     08471e180567de161d0f3777c357a0ba2d9e9ac7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 19 03:18:00 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 19 03:19:14 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08471e18

sys-libs/minizip-ng: add 3.0.7

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/minizip-ng/Manifest                       |  1 +
 .../files/minizip-ng-3.0.7-system-gtest.patch      | 25 ++++++
 sys-libs/minizip-ng/minizip-ng-3.0.7.ebuild        | 93 ++++++++++++++++++++++
 3 files changed, 119 insertions(+)

diff --git a/sys-libs/minizip-ng/Manifest b/sys-libs/minizip-ng/Manifest
index a1c9881d8a0e..a2fc647f45d7 100644
--- a/sys-libs/minizip-ng/Manifest
+++ b/sys-libs/minizip-ng/Manifest
@@ -1 +1,2 @@
 DIST minizip-ng-3.0.6.tar.gz 642138 BLAKE2B 3faddeef035da0417671ef5578b90ad9ec9a69f376d04fb8095f93e27e3276931ef432e179613e841e754ff6e915e8c631eeaa48795aaa87773e45465bd14afa SHA512 92aaad655e7dbec60ab8075435ccdc72314f75f0516aa4a16094215df2b14b108c2b49cdf6c876e396f0f43f52ad63f52ce7db2e119efe25c55b8b873bef9d4f
+DIST minizip-ng-3.0.7.tar.gz 643065 BLAKE2B e7026a5cc54fac6eba6fd1e79f8d53474966999aec1c24c70ff2207b93314f1e1cf5360841570ace66a30d6178f0057428757c7ba9b2d4bb14feb397142dedcb SHA512 01805ec955514efca32f4beb0e1241e94591d7d1d6119036c55d898a595de038bb18b8a2ffe5dab13101a890d14485aaefdf81680a7c60aa4ab3fd9de63ee991

diff --git a/sys-libs/minizip-ng/files/minizip-ng-3.0.7-system-gtest.patch b/sys-libs/minizip-ng/files/minizip-ng-3.0.7-system-gtest.patch
new file mode 100644
index 000000000000..57197d0da587
--- /dev/null
+++ b/sys-libs/minizip-ng/files/minizip-ng-3.0.7-system-gtest.patch
@@ -0,0 +1,25 @@
+https://github.com/zlib-ng/minizip-ng/pull/657
+
+From 3aa42e0520e4e7ffeae5a3def458c7ee0fefacb9 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sat, 19 Nov 2022 03:09:34 +0000
+Subject: [PATCH] Search system for GTest before downloading. #654
+
+Distributions often do builds with no network access available
+for both security reasons and also to ensure reproducibility.
+
+This change tells CMake to query the system for a copy of gtest,
+but if it's not available, it'll fall back to downloading via
+FetchContent.
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.12)
+ 
+ include(FetchContent)
+ 
++find_package(GTest)
++
+ enable_language(CXX)
+ 
+ if(NOT TARGET GTest::GTest)
+

diff --git a/sys-libs/minizip-ng/minizip-ng-3.0.7.ebuild b/sys-libs/minizip-ng/minizip-ng-3.0.7.ebuild
new file mode 100644
index 000000000000..12ebd223606a
--- /dev/null
+++ b/sys-libs/minizip-ng/minizip-ng-3.0.7.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2022 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
+
+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"
+KEYWORDS="~amd64 ~x86"
+IUSE="compat 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
+	app-arch/xz-utils
+	sys-libs/zlib-ng
+	virtual/libiconv
+	compat? ( !sys-libs/zlib[minizip] )
+	openssl? ( dev-libs/openssl:= )
+	zstd? ( app-arch/zstd:= )
+"
+DEPEND="
+	${RDEPEND}
+	test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-3.0.7-system-gtest.patch
+)
+
+src_configure() {
+	local mycmakeargs=(
+		-DMZ_COMPAT=$(usex compat)
+
+		-DMZ_BUILD_TESTS=$(usex test)
+		-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=ON
+		-DMZ_ZSTD=$(usex zstd)
+		-DMZ_LIBCOMP=OFF
+
+		# Encryption support options
+		-DMZ_PKCRYPT=ON
+		-DMZ_WZAES=ON
+		-DMZ_OPENSSL=$(usex openssl)
+		# TODO: Re-enable, ideally unconditionally, for arc4random
+		# Revisit when https://github.com/zlib-ng/minizip-ng/pull/648 fixed
+		-DMZ_LIBBSD=ON
+		-DMZ_SIGNING=ON
+
+		# Character conversion options
+		-DMZ_ICONV=ON
+	)
+
+	cmake_src_configure
+}
+
+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)"
+	)
+
+	# 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.
+	cmake_src_test -j1
+}
+
+src_install() {
+	cmake_src_install
+
+	if use compat ; then
+		ewarn "minizip-ng is experimental and replacing the system zlib[minizip] is dangerous"
+		ewarn "Please be careful!"
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/minizip-ng/, sys-libs/minizip-ng/files/
@ 2022-12-31 23:09 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2022-12-31 23:09 UTC (permalink / raw
  To: gentoo-commits

commit:     52a6b343ca0c13bc8f33a3eb582f35ba7f1c926d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 31 23:09:10 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Dec 31 23:09:10 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=52a6b343

sys-libs/minizip-ng: drop 3.0.6-r1

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/minizip-ng/Manifest                       |   1 -
 ...-getrandom-and-arc4random_buf-usage-order.patch |  68 -----------
 .../files/minizip-ng-3.0.6-test-temporary.patch    | 129 ---------------------
 sys-libs/minizip-ng/minizip-ng-3.0.6-r1.ebuild     |  89 --------------
 4 files changed, 287 deletions(-)

diff --git a/sys-libs/minizip-ng/Manifest b/sys-libs/minizip-ng/Manifest
index a313c1c988e6..78b2c05e7c58 100644
--- a/sys-libs/minizip-ng/Manifest
+++ b/sys-libs/minizip-ng/Manifest
@@ -1,3 +1,2 @@
-DIST minizip-ng-3.0.6.tar.gz 642138 BLAKE2B 3faddeef035da0417671ef5578b90ad9ec9a69f376d04fb8095f93e27e3276931ef432e179613e841e754ff6e915e8c631eeaa48795aaa87773e45465bd14afa SHA512 92aaad655e7dbec60ab8075435ccdc72314f75f0516aa4a16094215df2b14b108c2b49cdf6c876e396f0f43f52ad63f52ce7db2e119efe25c55b8b873bef9d4f
 DIST minizip-ng-3.0.7.tar.gz 643065 BLAKE2B e7026a5cc54fac6eba6fd1e79f8d53474966999aec1c24c70ff2207b93314f1e1cf5360841570ace66a30d6178f0057428757c7ba9b2d4bb14feb397142dedcb SHA512 01805ec955514efca32f4beb0e1241e94591d7d1d6119036c55d898a595de038bb18b8a2ffe5dab13101a890d14485aaefdf81680a7c60aa4ab3fd9de63ee991
 DIST minizip-ng-3.0.8.tar.gz 643788 BLAKE2B aa937fe8d0e776c8a00754c7a5eae7769b096d044a1b65b124adc0531b757579d8e0e0f5a4784669d9d94a7ea512625160b8b02f908a29e027f31911adf0f524 SHA512 f9742c5fc54ac08d78d7e942e90a7e7f1bc40a2812e7555570bd152ed441dbc5a004b79d2edf32d3fbda64db493cd1a0512d16deb84c0791d3fc86718e9ad0b1

diff --git a/sys-libs/minizip-ng/files/minizip-ng-3.0.6-Switch-getrandom-and-arc4random_buf-usage-order.patch b/sys-libs/minizip-ng/files/minizip-ng-3.0.6-Switch-getrandom-and-arc4random_buf-usage-order.patch
deleted file mode 100644
index 92db9c05b5d1..000000000000
--- a/sys-libs/minizip-ng/files/minizip-ng-3.0.6-Switch-getrandom-and-arc4random_buf-usage-order.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-https://github.com/zlib-ng/minizip-ng/pull/651
-
-From 1be6ea22e127a99786aefd2896e08bab43ad1333 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Sun, 2 Oct 2022 01:39:17 +0100
-Subject: [PATCH] Switch getrandom() and arc4random_buf() usage order
-
-We need to match the order of inclusions at the top of the file
-otherwise we might end up trying to use arc4random_buf() when
-available (because HAVE_ARC4RANODM_BUF is set) even though
-we hit HAVE_GETRANDOM first above and only included
-<sys/random.h> because of it.
-
-Besides, if getrandom() is available, we should really prefer
-it anyway.
-
-Fixes an implicit function declaration:
-```
-minizip-ng-3.0.6/mz_os_posix.c:124:5: error: implicit declaration of function 'arc4random_buf' [-Werror=implicit-function-declaration]
-```
---- a/mz_os_posix.c
-+++ b/mz_os_posix.c
-@@ -117,7 +117,22 @@ void mz_os_utf8_string_delete(uint8_t **string) {
- 
- /***************************************************************************/
- 
--#if defined(HAVE_ARC4RANDOM_BUF)
-+#if defined(HAVE_GETRANDOM)
-+int32_t mz_os_rand(uint8_t *buf, int32_t size) {
-+    int32_t left = size;
-+    int32_t written = 0;
-+
-+    while (left > 0) {
-+        written = getrandom(buf, left, 0);
-+        if (written < 0)
-+            return MZ_INTERNAL_ERROR;
-+
-+        buf += written;
-+        left -= written;
-+    }
-+    return size - left;
-+}
-+#elif defined(HAVE_ARC4RANDOM_BUF)
- int32_t mz_os_rand(uint8_t *buf, int32_t size) {
-     if (size < 0)
-         return 0;
-@@ -139,21 +154,6 @@ int32_t mz_os_rand(uint8_t *buf, int32_t size) {
-     }
-     return size - left;
- }
--#elif defined(HAVE_GETRANDOM)
--int32_t mz_os_rand(uint8_t *buf, int32_t size) {
--    int32_t left = size;
--    int32_t written = 0;
--
--    while (left > 0) {
--        written = getrandom(buf, left, 0);
--        if (written < 0)
--            return MZ_INTERNAL_ERROR;
--
--        buf += written;
--        left -= written;
--    }
--    return size - left;
--}
- #else
- int32_t mz_os_rand(uint8_t *buf, int32_t size) {
-     static unsigned calls = 0;

diff --git a/sys-libs/minizip-ng/files/minizip-ng-3.0.6-test-temporary.patch b/sys-libs/minizip-ng/files/minizip-ng-3.0.6-test-temporary.patch
deleted file mode 100644
index d38603ac7378..000000000000
--- a/sys-libs/minizip-ng/files/minizip-ng-3.0.6-test-temporary.patch
+++ /dev/null
@@ -1,129 +0,0 @@
-https://github.com/zlib-ng/minizip-ng/issues/623
-https://github.com/zlib-ng/minizip-ng/commit/6261d6f5ec5bd275257354c048f68ad9723c3231
-
-From 6261d6f5ec5bd275257354c048f68ad9723c3231 Mon Sep 17 00:00:00 2001
-From: Nathan Moinvaziri <nathan@solidstatenetworks.com>
-Date: Sat, 11 Jun 2022 10:36:42 -0700
-Subject: [PATCH] Generate test files in binary temp directory.
-
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -804,6 +804,8 @@ if(MZ_BUILD_TESTS AND MZ_BUILD_UNIT_TESTS)
-         endif()
-     endif()
- 
-+    set(TEST_TEMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/Testing/Temporary)
-+
-     add_test(NAME test_cmd COMMAND test_cmd WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
- 
-     function(create_compress_tests EXTRA_NAME EXTRA_ARGS)
-@@ -840,33 +842,43 @@ if(MZ_BUILD_TESTS AND MZ_BUILD_UNIT_TESTS)
-         foreach(INDEX RANGE ${COMPRESS_METHOD_COUNT})
-             list(GET COMPRESS_METHOD_NAMES ${INDEX} COMPRESS_METHOD_NAME)
-             list(GET COMPRESS_METHOD_ARGS ${INDEX} COMPRESS_METHOD_ARG)
-+
-+            set(COMPRESS_METHOD_DEST_DIR
-+                ${TEST_TEMP_DIR}/${COMPRESS_METHOD_NAME}-${EXTRA_NAME})
-+            set(COMPRESS_METHOD_PATH
-+                ${TEST_TEMP_DIR}/${COMPRESS_METHOD_NAME}-${EXTRA_NAME}.zip)
-+
-             add_test(NAME ${COMPRESS_METHOD_NAME}-zip-${EXTRA_NAME}
-                      COMMAND minizip_cmd ${COMPRESS_METHOD_ARG} -o ${EXTRA_ARGS}
--                        result.zip test.c test.h empty.txt random.bin uniform.bin fuzz
-+                        ${COMPRESS_METHOD_PATH}
-+                        test.c test.h empty.txt random.bin uniform.bin fuzz
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-             add_test(NAME ${COMPRESS_METHOD_NAME}-list-${EXTRA_NAME}
--                     COMMAND minizip_cmd -l ${EXTRA_ARGS} result.zip
-+                     COMMAND minizip_cmd -l ${EXTRA_ARGS} ${COMPRESS_METHOD_PATH}
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-             if(NOT MZ_COMPRESS_ONLY)
-                 add_test(NAME ${COMPRESS_METHOD_NAME}-unzip-${EXTRA_NAME}
--                         COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out result.zip
-+                         COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
-+                            -d ${COMPRESS_METHOD_DEST_DIR} ${COMPRESS_METHOD_PATH}
-                          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-             endif()
-             add_test(NAME ${COMPRESS_METHOD_NAME}-append-${EXTRA_NAME}
-                     COMMAND minizip_cmd ${COMPRESS_METHOD_ARG} -a ${EXTRA_ARGS}
--                        result.zip single.txt
-+                        ${COMPRESS_METHOD_PATH} single.txt
-                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-             if(NOT MZ_COMPRESS_ONLY)
-                 add_test(NAME ${COMPRESS_METHOD_NAME}-append-unzip-${EXTRA_NAME}
--                            COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out result.zip
-+                            COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
-+                                -d ${COMPRESS_METHOD_DEST_DIR} ${COMPRESS_METHOD_PATH}
-                             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-             endif()
-             add_test(NAME ${COMPRESS_METHOD_NAME}-erase-${EXTRA_NAME}
--                    COMMAND minizip_cmd -o -e result.zip test.c test.h
-+                    COMMAND minizip_cmd -o -e ${COMPRESS_METHOD_PATH} test.c test.h
-                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-             if(NOT MZ_COMPRESS_ONLY)
-                 add_test(NAME ${COMPRESS_METHOD_NAME}-erase-unzip-${EXTRA_NAME}
--                         COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out result.zip
-+                         COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
-+                            -d ${COMPRESS_METHOD_DEST_DIR} ${COMPRESS_METHOD_PATH}
-                          WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-             endif()
-         endforeach()
-@@ -891,43 +903,49 @@ if(MZ_BUILD_TESTS AND MZ_BUILD_UNIT_TESTS)
-     if(NOT MZ_COMPRESS_ONLY)
-         if(MZ_ZLIB OR MZ_LIBCOMP)
-             add_test(NAME unzip-tiny
--                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out
-+                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
-+                        -d ${TEST_TEMP_DIR}/unzip-tiny
-                         fuzz/unzip_fuzzer_seed_corpus/tiny.zip
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-         endif()
-         if(MZ_BZIP2)
-             add_test(NAME unzip-bzip2
--                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out
-+                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
-+                        -d ${TEST_TEMP_DIR}/unzip-bzip2
-                         fuzz/unzip_fuzzer_seed_corpus/bzip2.zip
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-         endif()
-         if(MZ_LZMA)
-             add_test(NAME unzip-lzma
--                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out
-+                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
-+                        -d ${TEST_TEMP_DIR}/unzip-lzma
-                         fuzz/unzip_fuzzer_seed_corpus/lzma.zip
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-         endif()
-         if(MZ_PKCRYPT)
-             add_test(NAME unzip-pkcrypt
--                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out -p test123
-+                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
-+                        -d ${TEST_TEMP_DIR}/unzip-pkcrypt -p test123
-                         fuzz/unzip_fuzzer_seed_corpus/encrypted_pkcrypt.zip
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-         endif()
-         if(MZ_WZAES)
-             add_test(NAME unzip-wzaes
--                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS} -d out -p test123
-+                     COMMAND minizip_cmd -x -o ${EXTRA_ARGS}
-+                        -d ${TEST_TEMP_DIR}/unzip-wzaes -p test123
-                         fuzz/unzip_fuzzer_seed_corpus/encrypted_wzaes.zip
-                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-         endif()
-     endif()
-     if(NOT MZ_COMPRESS_ONLY AND NOT MZ_DECOMPRESS_ONLY)
-         if(MZ_ZLIB AND NOT MZ_LIBCOMP)
-+            file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/test/random.bin DESTINATION ${TEST_TEMP_DIR})
-             add_test(NAME gz
-                 COMMAND minigzip_cmd random.bin
--                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-+                WORKING_DIRECTORY ${TEST_TEMP_DIR})
-             add_test(NAME ungz
--                COMMAND minigzip_cmd -x -d out random.bin.gz
--                WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
-+                COMMAND minigzip_cmd -x -d ${TEST_TEMP_DIR} random.bin.gz
-+                WORKING_DIRECTORY ${TEST_TEMP_DIR})
-         endif()
-     endif()
- endif()
-

diff --git a/sys-libs/minizip-ng/minizip-ng-3.0.6-r1.ebuild b/sys-libs/minizip-ng/minizip-ng-3.0.6-r1.ebuild
deleted file mode 100644
index cbc57fa9e859..000000000000
--- a/sys-libs/minizip-ng/minizip-ng-3.0.6-r1.ebuild
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright 1999-2022 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
-
-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"
-KEYWORDS="~amd64 ~x86"
-IUSE="compat 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
-	app-arch/xz-utils
-	sys-libs/zlib-ng
-	virtual/libiconv
-	compat? ( !sys-libs/zlib[minizip] )
-	openssl? ( dev-libs/openssl:= )
-	zstd? ( app-arch/zstd:= )
-"
-DEPEND="${RDEPEND}"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-3.0.6-Switch-getrandom-and-arc4random_buf-usage-order.patch
-	"${FILESDIR}"/${P}-test-temporary.patch
-)
-
-src_configure() {
-	local mycmakeargs=(
-		-DMZ_COMPAT=$(usex compat)
-		-DMZ_BUILD_TESTS=$(usex test)
-		-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=ON
-		-DMZ_ZSTD=$(usex zstd)
-		-DMZ_LIBCOMP=OFF
-
-		# Encryption support options
-		-DMZ_PKCRYPT=ON
-		-DMZ_WZAES=ON
-		-DMZ_OPENSSL=$(usex openssl)
-		# TODO: Re-enable, ideally unconditionally, for arc4random
-		# Revisit when https://github.com/zlib-ng/minizip-ng/pull/648 fixed
-		-DMZ_LIBBSD=ON
-		-DMZ_SIGNING=ON
-
-		# Character conversion options
-		-DMZ_ICONV=ON
-	)
-
-	cmake_src_configure
-}
-
-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)"
-	)
-
-	# 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.
-	cmake_src_test -j1
-}
-
-src_install() {
-	cmake_src_install
-
-	if use compat ; then
-		ewarn "minizip-ng is experimental and replacing the system zlib[minizip] is dangerous"
-		ewarn "Please be careful!"
-	fi
-}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/minizip-ng/, sys-libs/minizip-ng/files/
@ 2023-06-16  1:42 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2023-06-16  1:42 UTC (permalink / raw
  To: gentoo-commits

commit:     2ef0a75304631a8a70c71cf24c24fa2158f2c687
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 16 01:41:56 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 16 01:41:56 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ef0a753

sys-libs/minizip-ng: drop 3.0.8, 3.0.9

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/minizip-ng/Manifest                       |  2 -
 .../minizip-ng/files/minizip-3.0.9-strdup.patch    | 37 ---------
 sys-libs/minizip-ng/minizip-ng-3.0.8.ebuild        | 93 ---------------------
 sys-libs/minizip-ng/minizip-ng-3.0.9.ebuild        | 97 ----------------------
 4 files changed, 229 deletions(-)

diff --git a/sys-libs/minizip-ng/Manifest b/sys-libs/minizip-ng/Manifest
index b07993f44640..fb816333dd65 100644
--- a/sys-libs/minizip-ng/Manifest
+++ b/sys-libs/minizip-ng/Manifest
@@ -1,4 +1,2 @@
 DIST minizip-ng-3.0.10.tar.gz 771145 BLAKE2B 6bab59f830b8be929b6293c9408dd70165ffe094a71bcff82eab71f9d077f4d5360f6081e0ca631090810dfc58a81b03926c797e5c156d0f1437df78292a1f09 SHA512 38021137bebb8805279e729e0801ee15133e6379bdd1862d0dea60f13fb1d63402477f3ea9a6c22fc8c85eb13dd9b38d9536680806850060a44a5a9f015fa829
-DIST minizip-ng-3.0.8.tar.gz 643788 BLAKE2B aa937fe8d0e776c8a00754c7a5eae7769b096d044a1b65b124adc0531b757579d8e0e0f5a4784669d9d94a7ea512625160b8b02f908a29e027f31911adf0f524 SHA512 f9742c5fc54ac08d78d7e942e90a7e7f1bc40a2812e7555570bd152ed441dbc5a004b79d2edf32d3fbda64db493cd1a0512d16deb84c0791d3fc86718e9ad0b1
-DIST minizip-ng-3.0.9.tar.gz 646390 BLAKE2B ba823e371dd65788404c8628d1e3de74d28bb86a378eb19b2f9636d96b402e43831238a5296d22febe46c58f2e340d8439ad4117db513b949c9cd99a32fa5df6 SHA512 a52c43d0e208eb6acf56f80804fe99c265baec2a60f6cd80fc9ba160ca3c076e6c118be9108db84728310b14640cab0e0d301d4c763713c90bd344990a43f5fd
 DIST minizip-ng-4.0.0.tar.gz 766989 BLAKE2B c46bccb277ee5c712710aae41a7b46af4d60fb8fecad7489b97fc4475059f5f8cfbb1aa2d3693d25ada90f3089535e0d060c7a918df1d0fd635d57cbc93a317d SHA512 be3a9e9580847d595abbd200ec89a97e38086cab5b34d3a4db1507247ed04f9209290945989b200225ea412ee0e37fb9f1947404d1631d2dfeb5c6dc55ce3d05

diff --git a/sys-libs/minizip-ng/files/minizip-3.0.9-strdup.patch b/sys-libs/minizip-ng/files/minizip-3.0.9-strdup.patch
deleted file mode 100644
index 9cb1dd991b17..000000000000
--- a/sys-libs/minizip-ng/files/minizip-3.0.9-strdup.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-https://github.com/zlib-ng/minizip-ng/pull/682
-
-From 5aaa8bf0c348a27d9a7a0d82d4af26748278828c Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Thu, 16 Mar 2023 23:35:34 +0000
-Subject: [PATCH] CMake: set newer POSIX_C_SOURCE
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Enable POSIX 2008 as it's needed for strdup(), otherwise we get:
-```
-/var/tmp/portage/sys-libs/minizip-ng-3.0.9/work/minizip-ng-3.0.9/mz_os.c: In function ‘mz_dir_make’:
-/var/tmp/portage/sys-libs/minizip-ng-3.0.9/work/minizip-ng-3.0.9/mz_os.c:286:19: error: implicit declaration of function ‘strdup’ [-Werror=implicit-function-declaration]
-  286 |     current_dir = strdup(path);
-      |                   ^~~~~~
-```
-
-The man page for strdup says:
-```
-strdup():
-	_XOPEN_SOURCE >= 500
-	|| /* Since glibc 2.12: */ _POSIX_C_SOURCE >= 200809L
-	|| /* glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
-```
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -455,7 +455,7 @@ endif()
- 
- # Unix specific
- if(UNIX)
--    list(APPEND STDLIB_DEF -D_POSIX_C_SOURCE=200112L)
-+    list(APPEND STDLIB_DEF -D_POSIX_C_SOURCE=200809L)
-     list(APPEND MINIZIP_SRC mz_os_posix.c mz_strm_os_posix.c)
- 
-     if(MZ_PKCRYPT OR MZ_WZAES OR MZ_SIGNING)
-

diff --git a/sys-libs/minizip-ng/minizip-ng-3.0.8.ebuild b/sys-libs/minizip-ng/minizip-ng-3.0.8.ebuild
deleted file mode 100644
index 35459128380a..000000000000
--- a/sys-libs/minizip-ng/minizip-ng-3.0.8.ebuild
+++ /dev/null
@@ -1,93 +0,0 @@
-# Copyright 1999-2023 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
-
-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"
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
-IUSE="compat 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
-	app-arch/xz-utils
-	sys-libs/zlib-ng
-	virtual/libiconv
-	compat? ( !sys-libs/zlib[minizip] )
-	openssl? ( dev-libs/openssl:= )
-	zstd? ( app-arch/zstd:= )
-"
-DEPEND="
-	${RDEPEND}
-	test? ( dev-cpp/gtest )
-"
-
-src_configure() {
-	local mycmakeargs=(
-		-DMZ_COMPAT=$(usex compat)
-
-		-DMZ_BUILD_TESTS=$(usex test)
-		-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=ON
-		-DMZ_ZSTD=$(usex zstd)
-		-DMZ_LIBCOMP=OFF
-
-		# Encryption support options
-		-DMZ_PKCRYPT=ON
-		-DMZ_WZAES=ON
-		-DMZ_OPENSSL=$(usex openssl)
-		-DMZ_LIBBSD=ON
-		-DMZ_SIGNING=ON
-
-		# Character conversion options
-		-DMZ_ICONV=ON
-	)
-
-	cmake_src_configure
-}
-
-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)"
-	)
-
-	# 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.
-	cmake_src_test -j1
-}
-
-src_install() {
-	cmake_src_install
-
-	if use test ; then
-		# Test binaries, bug #874591
-		rm "${ED}"/usr/bin/minigzip || die
-		rm "${ED}"/usr/bin/minizip-ng || die
-	fi
-
-	if use compat ; then
-		ewarn "minizip-ng is experimental and replacing the system zlib[minizip] is dangerous"
-		ewarn "Please be careful!"
-	fi
-}

diff --git a/sys-libs/minizip-ng/minizip-ng-3.0.9.ebuild b/sys-libs/minizip-ng/minizip-ng-3.0.9.ebuild
deleted file mode 100644
index 9817a6cb9ba6..000000000000
--- a/sys-libs/minizip-ng/minizip-ng-3.0.9.ebuild
+++ /dev/null
@@ -1,97 +0,0 @@
-# Copyright 1999-2023 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
-
-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"
-KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"
-IUSE="compat 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
-	app-arch/xz-utils
-	sys-libs/zlib-ng
-	virtual/libiconv
-	compat? ( !sys-libs/zlib[minizip] )
-	openssl? ( dev-libs/openssl:= )
-	zstd? ( app-arch/zstd:= )
-"
-DEPEND="
-	${RDEPEND}
-	test? ( dev-cpp/gtest )
-"
-
-PATCHES=(
-	"${FILESDIR}"/minizip-3.0.9-strdup.patch
-)
-
-src_configure() {
-	local mycmakeargs=(
-		-DMZ_COMPAT=$(usex compat)
-
-		-DMZ_BUILD_TESTS=$(usex test)
-		-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=ON
-		-DMZ_ZSTD=$(usex zstd)
-		-DMZ_LIBCOMP=OFF
-
-		# Encryption support options
-		-DMZ_PKCRYPT=ON
-		-DMZ_WZAES=ON
-		-DMZ_OPENSSL=$(usex openssl)
-		-DMZ_LIBBSD=ON
-		-DMZ_SIGNING=ON
-
-		# Character conversion options
-		-DMZ_ICONV=ON
-	)
-
-	cmake_src_configure
-}
-
-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)"
-	)
-
-	# 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.
-	cmake_src_test -j1
-}
-
-src_install() {
-	cmake_src_install
-
-	if use test ; then
-		# Test binaries, bug #874591
-		rm "${ED}"/usr/bin/minigzip || die
-		rm "${ED}"/usr/bin/minizip-ng || die
-	fi
-
-	if use compat ; then
-		ewarn "minizip-ng is experimental and replacing the system zlib[minizip] is dangerous"
-		ewarn "Please be careful!"
-	fi
-}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/minizip-ng/, sys-libs/minizip-ng/files/
@ 2023-10-06 19:58 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2023-10-06 19:58 UTC (permalink / raw
  To: gentoo-commits

commit:     77feb49d2a880a320412d80de3296e47591ec450
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct  6 19:56:40 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct  6 19:58:42 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77feb49d

sys-libs/minizip-ng: fix musl build + libbsd dep

The missing libbsd dep looks like an oversight from bf1f9945bca502841480115ef59463a20da6e7da.

Closes: https://bugs.gentoo.org/889266
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/minizip-ng-4.0.1-libbsd-overlay.patch    | 16 ++++
 sys-libs/minizip-ng/minizip-ng-4.0.1-r1.ebuild     | 97 ++++++++++++++++++++++
 2 files changed, 113 insertions(+)

diff --git a/sys-libs/minizip-ng/files/minizip-ng-4.0.1-libbsd-overlay.patch b/sys-libs/minizip-ng/files/minizip-ng-4.0.1-libbsd-overlay.patch
new file mode 100644
index 000000000000..c386ae1c2c65
--- /dev/null
+++ b/sys-libs/minizip-ng/files/minizip-ng-4.0.1-libbsd-overlay.patch
@@ -0,0 +1,16 @@
+https://bugs.gentoo.org/889266
+https://gitlab.freedesktop.org/libbsd/libbsd/-/issues/15
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -542,10 +542,10 @@ else()
+ 
+                     if(HAVE_LIBBSD_ARC4RANDOM_BUF)
+                         list(APPEND MINIZIP_DEF -DHAVE_LIBBSD -DHAVE_ARC4RANDOM_BUF)
+-                        list(APPEND MINIZIP_INC ${LIBBSD_INCLUDE_DIRS})
+                         list(APPEND MINIZIP_LIB ${LIBBSD_LIBRARIES})
+                         list(APPEND MINIZIP_LBD ${LIBBSD_LIBRARY_DIRS})
+ 
++                        add_compile_options(${LIBBSD_CFLAGS})
+                         link_directories(${LIBBSD_LIBRARY_DIRS})
+                     endif()
+                 else()

diff --git a/sys-libs/minizip-ng/minizip-ng-4.0.1-r1.ebuild b/sys-libs/minizip-ng/minizip-ng-4.0.1-r1.ebuild
new file mode 100644
index 000000000000..4f3a48149147
--- /dev/null
+++ b/sys-libs/minizip-ng/minizip-ng-4.0.1-r1.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2023 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
+
+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 ~ppc64 ~riscv ~x86"
+IUSE="compat 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}]
+	app-arch/xz-utils
+	dev-libs/libbsd[${MULTILIB_USEDEP}]
+	sys-libs/zlib-ng[${MULTILIB_USEDEP}]
+	virtual/libiconv
+	compat? ( !sys-libs/zlib[minizip] )
+	openssl? ( dev-libs/openssl:=[${MULTILIB_USEDEP}] )
+	zstd? ( app-arch/zstd:=[${MULTILIB_USEDEP}] )
+"
+DEPEND="
+	${RDEPEND}
+	test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-4.0.1-libbsd-overlay.patch
+)
+
+multilib_src_configure() {
+	local mycmakeargs=(
+		-DMZ_COMPAT=$(usex compat)
+
+		-DMZ_BUILD_TESTS=$(usex test)
+		-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=ON
+		-DMZ_ZSTD=$(usex zstd)
+		-DMZ_LIBCOMP=OFF
+
+		# Encryption support options
+		-DMZ_PKCRYPT=ON
+		-DMZ_WZAES=ON
+		-DMZ_OPENSSL=$(usex openssl)
+		-DMZ_LIBBSD=ON
+
+		# Character conversion options
+		-DMZ_ICONV=ON
+	)
+
+	cmake_src_configure
+}
+
+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)"
+	)
+
+	# 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.
+	cmake_src_test -j1
+}
+
+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!"
+	fi
+}


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-06 19:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-31 23:09 [gentoo-commits] repo/gentoo:master commit in: sys-libs/minizip-ng/, sys-libs/minizip-ng/files/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-10-06 19:58 Sam James
2023-06-16  1:42 Sam James
2022-11-19  3:19 Sam James
2022-10-02  1:01 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox