public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libzip/, dev-libs/libzip/files/
Date: Sat, 23 Nov 2024 14:51:55 +0000 (UTC)	[thread overview]
Message-ID: <1732373430.2c6c6c8ef64fdc3dc45475c91190f4d231ed3052.sam@gentoo> (raw)

commit:     2c6c6c8ef64fdc3dc45475c91190f4d231ed3052
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 23 14:46:24 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 23 14:50:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2c6c6c8e

dev-libs/libzip: add 1.11.2

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

 dev-libs/libzip/Manifest                           |   1 +
 .../libzip/files/libzip-1.11.2-nullability.patch   |  96 ++++++++++++++++
 dev-libs/libzip/libzip-1.11.2.ebuild               | 123 +++++++++++++++++++++
 3 files changed, 220 insertions(+)

diff --git a/dev-libs/libzip/Manifest b/dev-libs/libzip/Manifest
index 01ddc1b30655..0ce5516d5423 100644
--- a/dev-libs/libzip/Manifest
+++ b/dev-libs/libzip/Manifest
@@ -1 +1,2 @@
+DIST libzip-1.11.2.tar.xz 787300 BLAKE2B 84b41a4dfb5f61404972314021ee5de153199747d8724bbc86adb982fdcea74ede67fac03523081a12e463c33e25441037beb1f6312f93f0c011471c3b150c72 SHA512 e80afcff8a65d614c4e7087223e8afafe0b1c6799d6f1d04d1a3735d37a63d134ec2335fe87923a27f0845ee71062da444fe7a6c8a4458827333a52d9dee8166
 DIST libzip-1.9.2.tar.xz 763980 BLAKE2B ceeca4dccbe7552f7f545b00ea44b342398d18eb996e39045b9d6efafe50f8890333ddf220c86b59f5ab2849420eb76761c42b16de8b174629f53e327f9e83e7 SHA512 82cb2533c25b5b540aa73856c958750d32eeceb192cce257eded15b396a24652041c8531f20366ac4c2dc6b7c0310c558d19c12b611576eccb07cfbaf98120b5

diff --git a/dev-libs/libzip/files/libzip-1.11.2-nullability.patch b/dev-libs/libzip/files/libzip-1.11.2-nullability.patch
new file mode 100644
index 000000000000..e0ca4185617f
--- /dev/null
+++ b/dev-libs/libzip/files/libzip-1.11.2-nullability.patch
@@ -0,0 +1,96 @@
+https://bugs.gentoo.org/830231
+https://github.com/nih-at/libzip/issues/253
+https://github.com/nih-at/libzip/commit/e29f28b4fe66ef24e205678dc29f65d693c649eb
+
+From e29f28b4fe66ef24e205678dc29f65d693c649eb Mon Sep 17 00:00:00 2001
+From: Dieter Baron <dillo@nih.at>
+Date: Fri, 22 Nov 2024 11:32:32 +0100
+Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20hardcode=20=5FNullable=20suppor?=
+ =?UTF-8?q?t=20in=20zip.h.?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Based on and closes #253.
+---
+ CMakeLists.txt | 11 -----------
+ config.h.in    |  1 -
+ lib/zip.h      |  9 +++++++++
+ zipconf.h.in   |  2 --
+ 6 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 23e0f0fd8..3d5fa1bc8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -192,10 +192,6 @@ check_c_source_compiles("#include <sys/ioctl.h>
+ #include <linux/fs.h>
+ int main(int argc, char *argv[]) { unsigned long x = FICLONERANGE; }" HAVE_FICLONERANGE)
+ 
+-check_c_source_compiles("
+-int foo(char * _Nullable bar);
+-int main(int argc, char *argv[]) { }" HAVE_NULLABLE)
+-
+ test_big_endian(WORDS_BIGENDIAN)
+ 
+ find_package(ZLIB 1.1.2 REQUIRED)
+@@ -458,13 +454,6 @@ elseif(LONG_LONG_LIBZIP EQUAL 8)
+   set(ZIP_UINT64_T "unsigned long long")
+ endif()
+ 
+-if(HAVE_NULLABLE)
+-  set(ZIP_NULLABLE_DEFINES)
+-else()
+-  set(ZIP_NULLABLE_DEFINES "#define _Nullable
+-#define _Nonnull")
+-endif()
+-
+ # write out config file
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/zipconf.h.in ${PROJECT_BINARY_DIR}/zipconf.h)
+diff --git a/config.h.in b/config.h.in
+index 90a324285..09d42384d 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -41,7 +41,6 @@
+ #cmakedefine HAVE_MEMCPY_S
+ #cmakedefine HAVE_MBEDTLS
+ #cmakedefine HAVE_MKSTEMP
+-#cmakedefine HAVE_NULLABLE
+ #cmakedefine HAVE_OPENSSL
+ #cmakedefine HAVE_SETMODE
+ #cmakedefine HAVE_SNPRINTF
+diff --git a/lib/zip.h b/lib/zip.h
+index 14064062f..c2a8a8b46 100644
+--- a/lib/zip.h
++++ b/lib/zip.h
+@@ -34,6 +34,15 @@
+   IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ 
++#if defined(__has_feature)
++  #if !__has_feature(nullability)
++    #define _Nullable
++    #define _Nonnull
++  #endif
++#else
++  #define _Nullable
++  #define _Nonnull
++#endif
+ 
+ #ifdef __cplusplus
+ extern "C" {
+diff --git a/zipconf.h.in b/zipconf.h.in
+index b88ed267f..04dce7184 100644
+--- a/zipconf.h.in
++++ b/zipconf.h.in
+@@ -15,8 +15,6 @@
+ 
+ #cmakedefine ZIP_STATIC
+ 
+-${ZIP_NULLABLE_DEFINES}
+-
+ ${LIBZIP_TYPES_INCLUDE}
+ 
+ typedef ${ZIP_INT8_T} zip_int8_t;
+

diff --git a/dev-libs/libzip/libzip-1.11.2.ebuild b/dev-libs/libzip/libzip-1.11.2.ebuild
new file mode 100644
index 000000000000..df692d7df5cc
--- /dev/null
+++ b/dev-libs/libzip/libzip-1.11.2.ebuild
@@ -0,0 +1,123 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake multibuild flag-o-matic
+
+DESCRIPTION="Library for manipulating zip archives"
+HOMEPAGE="https://nih.at/libzip/"
+SRC_URI="https://www.nih.at/libzip/${P}.tar.xz"
+
+LICENSE="BSD"
+SLOT="0/5"
+KEYWORDS="~amd64"
+IUSE="bzip2 gnutls lzma mbedtls ssl static-libs test tools zstd"
+REQUIRED_USE="test? ( tools )"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+	sys-libs/zlib
+	bzip2? ( app-arch/bzip2:= )
+	lzma? ( app-arch/xz-utils )
+	ssl? (
+		gnutls? (
+			dev-libs/nettle:=
+			>=net-libs/gnutls-3.6.5:=
+		)
+		!gnutls? (
+			mbedtls? ( net-libs/mbedtls:= )
+			!mbedtls? ( dev-libs/openssl:= )
+		)
+	)
+	zstd? ( >=app-arch/zstd-1.4.0:= )
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+	test? ( dev-util/nihtest )
+"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-nullability.patch
+)
+
+pkg_setup() {
+	# Upstream doesn't support building dynamic & static
+	# simultaneously: https://github.com/nih-at/libzip/issues/76
+	MULTIBUILD_VARIANTS=( shared $(usev static-libs) )
+}
+
+src_configure() {
+	append-lfs-flags
+	myconfigure() {
+		local mycmakeargs=(
+			-DBUILD_OSSFUZZ=OFF
+			-DBUILD_EXAMPLES=OFF # nothing is installed
+			-DENABLE_COMMONCRYPTO=OFF # not in tree
+			-DENABLE_BZIP2=$(usex bzip2)
+			-DENABLE_LZMA=$(usex lzma)
+			-DENABLE_ZSTD=$(usex zstd)
+		)
+		if [[ ${MULTIBUILD_VARIANT} = static-libs ]]; then
+			mycmakeargs+=(
+				-DBUILD_DOC=OFF
+				-DBUILD_EXAMPLES=OFF
+				-DBUILD_SHARED_LIBS=OFF
+				-DBUILD_TOOLS=OFF
+			)
+		else
+			mycmakeargs+=(
+				-DBUILD_DOC=ON
+				-DBUILD_REGRESS=$(usex test)
+				-DBUILD_TOOLS=$(usex tools)
+			)
+		fi
+
+		if use ssl; then
+			if use gnutls; then
+				mycmakeargs+=(
+					-DENABLE_GNUTLS=$(usex gnutls)
+					-DENABLE_MBEDTLS=OFF
+					-DENABLE_OPENSSL=OFF
+				)
+			elif use mbedtls; then
+				mycmakeargs+=(
+					-DENABLE_GNUTLS=OFF
+					-DENABLE_MBEDTLS=$(usex mbedtls)
+					-DENABLE_OPENSSL=OFF
+				)
+			else
+				mycmakeargs+=(
+					-DENABLE_GNUTLS=OFF
+					-DENABLE_MBEDTLS=OFF
+					-DENABLE_OPENSSL=ON
+				)
+			fi
+		else
+			mycmakeargs+=(
+				-DENABLE_GNUTLS=OFF
+				-DENABLE_MBEDTLS=OFF
+				-DENABLE_OPENSSL=OFF
+			)
+		fi
+		cmake_src_configure
+	}
+
+	multibuild_foreach_variant myconfigure
+}
+
+src_compile() {
+	multibuild_foreach_variant cmake_src_compile
+}
+
+src_test() {
+	run_tests() {
+		[[ ${MULTIBUILD_VARIANT} = shared ]] && cmake_src_test
+	}
+
+	multibuild_foreach_variant run_tests
+}
+
+src_install() {
+	multibuild_foreach_variant cmake_src_install
+}


             reply	other threads:[~2024-11-23 14:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-23 14:51 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-07-17 15:56 [gentoo-commits] repo/gentoo:master commit in: dev-libs/libzip/, dev-libs/libzip/files/ Andreas Sturmlechner
2025-06-09  2:21 Sam James
2025-03-04 22:32 Andreas Sturmlechner
2021-09-08  6:23 Andreas Sturmlechner
2020-04-09 23:51 Andreas Sturmlechner
2020-01-26 13:04 Andreas Sturmlechner
2019-04-04  0:09 Andreas Sturmlechner
2019-02-09 20:58 Andreas Sturmlechner
2017-10-23 23:33 Andreas Sturmlechner
2017-08-04 18:14 Andreas Sturmlechner
2017-07-30 20:46 Andreas Sturmlechner
2017-03-17 18:47 Andreas Sturmlechner
2017-03-17 18:47 Andreas Sturmlechner
2016-05-31 21:00 Chris Reffett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1732373430.2c6c6c8ef64fdc3dc45475c91190f4d231ed3052.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox