From 430e334b81b59b1910e65998870f3b0a3428fefa Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 19 Feb 2024 07:15:31 +0000 Subject: [PATCH] media-libs/libpng: Sync with Gentoo It's from Gentoo commit 4ec729bc254a08d7e50bc297dba0cd316fd63f80. --- .../portage-stable/media-libs/libpng/Manifest | 1 + .../libpng-1.6.41-png_check_sig-abi.patch | 94 +++++++++++++++++++ .../media-libs/libpng/libpng-1.6.41-r1.ebuild | 74 +++++++++++++++ ...png-1.6.41.ebuild => libpng-1.6.42.ebuild} | 0 4 files changed, 169 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/media-libs/libpng/files/libpng-1.6.41-png_check_sig-abi.patch create mode 100644 sdk_container/src/third_party/portage-stable/media-libs/libpng/libpng-1.6.41-r1.ebuild rename sdk_container/src/third_party/portage-stable/media-libs/libpng/{libpng-1.6.41.ebuild => libpng-1.6.42.ebuild} (100%) diff --git a/sdk_container/src/third_party/portage-stable/media-libs/libpng/Manifest b/sdk_container/src/third_party/portage-stable/media-libs/libpng/Manifest index 956b4ca675..528217b275 100644 --- a/sdk_container/src/third_party/portage-stable/media-libs/libpng/Manifest +++ b/sdk_container/src/third_party/portage-stable/media-libs/libpng/Manifest @@ -2,3 +2,4 @@ DIST libpng-1.6.40-apng-apng.patch.gz 10330 BLAKE2B e2a5ff10ebaf75019d20edb148ea DIST libpng-1.6.40-libpng-apng-apng.patch.gz 10815 BLAKE2B 47b09d730d6be1d481ab48e511068a38fc3448339aaeab1d8ad21f26de6cb79006c64785de2e0514ff820a75101c0010b84cce923d10e8f6198e4e99916d08f2 SHA512 373cc9f0df15f7c77c0a59ddaac22374cfae37174b63a642e68e3a17a6d0bb1015399d771998c7eb6b356b634f157f0009743f4cc659f3b8e480a9533010ef9c DIST libpng-1.6.40.tar.xz 1021332 BLAKE2B 4dd2df57791ca68cc31ba966b9176ecb37458572c60eef34e31ff0d3266d25ad6ea9d2e8cae6bfaf7932b5c7bc231047d3ed139b3464304c41cc4d89611f5ba8 SHA512 a2ec37c529bf80f3fee3798191d080d06e14d6a1ffecd3c1a02845cb9693b5e308a1d82598a376101f9312d989d19f1fb6735b225d4b0b9f1b73f9f8a3edb17f DIST libpng-1.6.41.tar.xz 1035328 BLAKE2B 43d8d1c563d9df46b663f706dca9563e31e6e47a2809a77a5d059de8cfa348721054df724d08ac24ef4717ffc101989941127df2d026c9537532375d9b432b68 SHA512 046d0328255572ee2ccab7e751ed457b07e0aedc72474c2f4675a8303e628de3ef8afa1a00c60d768eb788546d1cda1e8b800b2497d9c352694faba6dde2c5b4 +DIST libpng-1.6.42.tar.xz 1035484 BLAKE2B 8a8895b673ff90416a00c9ff775d7bdc38ab1ab0d83fd6e70cfffea2ed78bd42896950a64bf48ad9a00ea50d8c5d5702975b0bae7bb3300d4de4c82b334e513e SHA512 a9e8641f79ebc811e8e1e94c4966737f8d0f3aef33c86834c419ca76050567891c065899c3bc0c945c59b5d50c5ff7d693cc51089d06efe92e71ae8014fa157c diff --git a/sdk_container/src/third_party/portage-stable/media-libs/libpng/files/libpng-1.6.41-png_check_sig-abi.patch b/sdk_container/src/third_party/portage-stable/media-libs/libpng/files/libpng-1.6.41-png_check_sig-abi.patch new file mode 100644 index 0000000000..d2913b062f --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/media-libs/libpng/files/libpng-1.6.41-png_check_sig-abi.patch @@ -0,0 +1,94 @@ +https://bugs.gentoo.org/923298 +https://github.com/pnggroup/libpng/commit/ac944e2b364cff96e8458110c2ad06a63f8543b3 + +From ac944e2b364cff96e8458110c2ad06a63f8543b3 Mon Sep 17 00:00:00 2001 +From: Cosmin Truta +Date: Mon, 29 Jan 2024 15:30:10 +0200 +Subject: [PATCH] Fix a regression introduced in "chore: Clean up the return + statements" + +This fixes commit 27e548af2518ff8d278b45c40d11ad1bdd68eaa0. + +The macro `png_check_sig` has been deprecated and remained untested +for decades. And yet, somehow it escaped from all past API cleanups. + +Also update the libpng manual. + +Reported-by: Matthieu Darbois +--- a/libpng-manual.txt ++++ b/libpng-manual.txt +@@ -357,7 +357,7 @@ Customizing libpng. + return ERROR; + } + +- is_png = !png_sig_cmp(header, 0, number); ++ is_png = (png_sig_cmp(header, 0, number) == 0); + if (!is_png) + { + return NOT_PNG; +@@ -4692,7 +4692,7 @@ deprecated since libpng-1.0.16 and libpng-1.2.6. + The function + png_check_sig(sig, num) + was replaced with +- !png_sig_cmp(sig, 0, num) ++ png_sig_cmp(sig, 0, num) == 0 + It has been deprecated since libpng-0.90. + + The function +@@ -4756,8 +4756,8 @@ png_get_mmx_bitdepth_threshold(), png_get_mmx_rowbytes_threshold(), + png_set_asm_flags(), and png_mmx_supported() + + We removed the obsolete png_check_sig(), png_memcpy_check(), and +-png_memset_check() functions. Instead use !png_sig_cmp(), memcpy(), +-and memset(), respectively. ++png_memset_check() functions. Instead use png_sig_cmp() == 0, ++memcpy(), and memset(), respectively. + + The function png_set_gray_1_2_4_to_8() was removed. It has been + deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with +--- a/libpng.3 ++++ b/libpng.3 +@@ -876,7 +876,7 @@ Customizing libpng. + return ERROR; + } + +- is_png = !png_sig_cmp(header, 0, number); ++ is_png = (png_sig_cmp(header, 0, number) == 0); + if (!is_png) + { + return NOT_PNG; +@@ -5211,7 +5211,7 @@ deprecated since libpng-1.0.16 and libpng-1.2.6. + The function + png_check_sig(sig, num) + was replaced with +- !png_sig_cmp(sig, 0, num) ++ png_sig_cmp(sig, 0, num) == 0 + It has been deprecated since libpng-0.90. + + The function +@@ -5275,8 +5275,8 @@ png_get_mmx_bitdepth_threshold(), png_get_mmx_rowbytes_threshold(), + png_set_asm_flags(), and png_mmx_supported() + + We removed the obsolete png_check_sig(), png_memcpy_check(), and +-png_memset_check() functions. Instead use !png_sig_cmp(), memcpy(), +-and memset(), respectively. ++png_memset_check() functions. Instead use png_sig_cmp() == 0, ++memcpy(), and memset(), respectively. + + The function png_set_gray_1_2_4_to_8() was removed. It has been + deprecated since libpng-1.0.18 and 1.2.9, when it was replaced with +--- a/png.h ++++ b/png.h +@@ -914,9 +914,9 @@ PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, size_t start, + size_t num_to_check)); + + /* Simple signature checking function. This is the same as calling +- * png_check_sig(sig, n) := (png_sig_cmp(sig, 0, n) != 0). ++ * png_check_sig(sig, n) := (png_sig_cmp(sig, 0, n) == 0). + */ +-#define png_check_sig(sig, n) (png_sig_cmp((sig), 0, (n)) != 0) ++#define png_check_sig(sig, n) (png_sig_cmp((sig), 0, (n)) == 0) /* DEPRECATED */ + + /* Allocate and initialize png_ptr struct for reading, and any other memory. */ + PNG_EXPORTA(4, png_structp, png_create_read_struct, + diff --git a/sdk_container/src/third_party/portage-stable/media-libs/libpng/libpng-1.6.41-r1.ebuild b/sdk_container/src/third_party/portage-stable/media-libs/libpng/libpng-1.6.41-r1.ebuild new file mode 100644 index 0000000000..e82599595c --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/media-libs/libpng/libpng-1.6.41-r1.ebuild @@ -0,0 +1,74 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit libtool multilib-minimal + +APNG_REPO=libpng-apng # sometimes libpng-apng is more up to date +APNG_VERSION="1.6.40" +DESCRIPTION="Portable Network Graphics library" +HOMEPAGE="http://www.libpng.org/" +SRC_URI=" + mirror://sourceforge/${PN}/${P}.tar.xz + apng? ( + mirror://sourceforge/${APNG_REPO}/${PN}$(ver_rs 1-2 '' $(ver_cut 1-2 ${APNG_VERSION}))/${PV}/${PN}-${APNG_VERSION}-apng.patch.gz -> ${PN}-${APNG_VERSION}-${APNG_REPO}-apng.patch.gz + mirror://sourceforge/${APNG_REPO}/${PN}$(ver_rs 1-2 '' $(ver_cut 1-2 ${APNG_VERSION}))/${PN}-${APNG_VERSION}-apng.patch.gz -> ${PN}-${APNG_VERSION}-${APNG_REPO}-apng.patch.gz + ) +" + +LICENSE="libpng2" +SLOT="0/16" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="apng cpu_flags_arm_neon cpu_flags_x86_sse static-libs test" +RESTRICT="!test? ( test )" + +RDEPEND=">=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]" +DEPEND="${RDEPEND}" + +DOCS=( ANNOUNCE CHANGES libpng-manual.txt README TODO ) + +PATCHES=( + "${FILESDIR}"/${P}-png_check_sig-abi.patch +) + +src_prepare() { + default + + if use apng; then + case ${APNG_REPO} in + apng) + eapply -p0 "${WORKDIR}"/${PN}-${APNG_VERSION}-${APNG_REPO}-apng.patch + ;; + libpng-apng) + eapply "${WORKDIR}"/${PN}-${APNG_VERSION}-${APNG_REPO}-apng.patch + ;; + *) + die "Unknown APNG_REPO!" + ;; + esac + + # Don't execute symbols check with apng patch, bug #378111 + sed -i -e '/^check/s:scripts/symbols.chk::' Makefile.in || die + fi + + elibtoolize +} + +multilib_src_configure() { + local myeconfargs=( + $(multilib_native_enable tools) + $(use_enable test tests) + $(use_enable cpu_flags_arm_neon arm-neon) + $(use_enable cpu_flags_x86_sse intel-sse) + $(use_enable static-libs static) + ) + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +multilib_src_install_all() { + default + + find "${ED}" \( -type f -o -type l \) -name '*.la' -delete || die +} diff --git a/sdk_container/src/third_party/portage-stable/media-libs/libpng/libpng-1.6.41.ebuild b/sdk_container/src/third_party/portage-stable/media-libs/libpng/libpng-1.6.42.ebuild similarity index 100% rename from sdk_container/src/third_party/portage-stable/media-libs/libpng/libpng-1.6.41.ebuild rename to sdk_container/src/third_party/portage-stable/media-libs/libpng/libpng-1.6.42.ebuild