commit:     7542625a5493f983e6b90ba9bdb3fe427b31c374
Author:     YOSHIOKA Takuma <lo48576 <AT> hard-wi <DOT> red>
AuthorDate: Sun Dec  1 13:39:54 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Dec  1 14:55:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7542625a

media-gfx/oxipng: relax libdeflate version requirement

Signed-off-by: YOSHIOKA Takuma <lo48576 <AT> hard-wi.red>
Closes: https://github.com/gentoo/gentoo/pull/39539
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...later-1.20.0-relax-libdeflate-sys-version.patch | 13 ++++++++++++
 media-gfx/oxipng/oxipng-9.1.2-r2.ebuild            | 23 +++++++++++++++-------
 2 files changed, 29 insertions(+), 7 deletions(-)

diff --git 
a/media-gfx/oxipng/files/libdeflater-1.20.0-relax-libdeflate-sys-version.patch 
b/media-gfx/oxipng/files/libdeflater-1.20.0-relax-libdeflate-sys-version.patch
new file mode 100644
index 000000000000..a7435085aa4f
--- /dev/null
+++ 
b/media-gfx/oxipng/files/libdeflater-1.20.0-relax-libdeflate-sys-version.patch
@@ -0,0 +1,13 @@
+diff --git a/build.rs b/build.rs
+index 9c5f169589aa..14f79d18d5f7 100644
+--- a/build.rs
++++ b/build.rs
+@@ -9,7 +9,7 @@ fn main() {
+     if pkg_config::Config::new()
+         .print_system_libs(false)
+         .cargo_metadata(true)
+-        .exactly_version("1.20")
++        .atleast_version("1.20")
+         .probe("libdeflate")
+         .is_ok()
+     {

diff --git a/media-gfx/oxipng/oxipng-9.1.2-r2.ebuild 
b/media-gfx/oxipng/oxipng-9.1.2-r2.ebuild
index 5785f78a218e..d225fadafc14 100644
--- a/media-gfx/oxipng/oxipng-9.1.2-r2.ebuild
+++ b/media-gfx/oxipng/oxipng-9.1.2-r2.ebuild
@@ -110,13 +110,8 @@ SLOT="0"
 KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
 PATCHES=( "${FILESDIR}/oxipng-9.1.2-use-system-libdeflate.patch" )
 
-BDEPEND="
-       virtual/pkgconfig"
-# Any API/ABI-compatible versions (other than 1.20) would be ok for 
app-arch/libdeflate,
-# but in such case the build script of libdeflate_sys should be patched.
-# See 
<https://github.com/adamkewley/libdeflater/pull/32#issuecomment-1971198374>.
-DEPEND="
-       ~app-arch/libdeflate-1.20"
+BDEPEND="virtual/pkgconfig"
+DEPEND=">=app-arch/libdeflate-1.20:="
 RDEPEND="${DEPEND}"
 
 # rust does not use *FLAGS from make.conf, silence portage warning
@@ -125,6 +120,20 @@ QA_FLAGS_IGNORED="usr/bin/${PN}"
 QA_PRESTRIPPED="usr/bin/${PN}"
 
 src_prepare() {
+       # Relax the version restriction of libdeflate.
+       # https://bugs.gentoo.org/944285
+       #
+       # Any API/ABI-compatible versions would be ok for app-arch/libdeflate, 
but
+       # in such case the build script of libdeflate_sys should be patched to 
pick
+       # even if the system library is newer.
+       # See 
<https://github.com/adamkewley/libdeflater/pull/32#issuecomment-1971198374>.
+       #
+       # Also, don't forget updating `DEPNED` and `RDEPEND` in sync, or 
libdeflater
+       # crate will fail to pick system library and silently use the bundled
+       # version of libdeflate.
+       ( cd "${WORKDIR}"/cargo_home/gentoo/libdeflate-sys-1.20.0 && \
+               eapply 
"${FILESDIR}"/libdeflater-1.20.0-relax-libdeflate-sys-version.patch )
+
        # Remove the linker configs (in `.cargo/config.toml`) specific to 
GitHub CI.
        # https://bugs.gentoo.org/924946
        rm -rv "${S}/.cargo/config.toml" || die

Reply via email to