Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 873952

Summary: games-emulation/dolphin: use sys-libs/zlib-ng, sys-libs/minizip-ng
Product: Gentoo Linux Reporter: Sam James <sam>
Component: Current packagesAssignee: Michał Górny <mgorny>
Status: CONFIRMED ---    
Severity: normal CC: games, kilgorephotoshop, mturcot, negril.nx+gentoo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=671900
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 807226    
Bug Blocks:    
Attachments: fix minizip-ng[-compat] detection

Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-02 03:06:05 UTC
I've now packaged sys-libs/minizip-ng and sys-libs/zlib-ng is keyworded.

Please adjust the dolphin ebuild to use them. Thanks!
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2022-10-02 09:40:38 UTC
Upstream is forcing bundled zlib-ng... which makes zero sense given they're also using external minizip-ng x_x.
Comment 2 Samuel Bauer 2022-10-04 15:18:35 UTC
1/ Dolphin requires sys-libs/minizip-ng[compat] which is still masked

unmasking does not resolve things here as it forbids sys-libs/zlib[minizip] required by other packages.

2/ notice to unbundle zlib-ng
sed -i -e 's/add_subdirectory(Externals\/zlib-ng)/find_package(PkgConfig REQUIRED)\npkg_check_modules(zlib-ng z-ng)/' CMakeLists.txt
sed -i -e 's/ZLIB::ZLIB/z-ng/' $(find -name CMakeLists.txt -exec grep -l ZLIB::ZLIB '{}' '+') || die

Yet it still fails as mz_compat.h is missing (c.f.: 1).
Comment 3 Samuel Bauer 2022-10-04 15:24:23 UTC
In my local package for minizip-ng, I didn't mask compat, and didn't notice any issue using it with zlib[minizip]

However I tested without installing zlib-ng and using only the bundled version as at the point I tested minizip-ng was only a local ebuild and I didn't want to un-keyword zlib-ng
Comment 4 Samuel Bauer 2022-10-04 15:39:07 UTC
Oh, my draft for minizip-ng also included:

-DCMAKE_INSTALL_INCLUDEDIR=/usr/include/minizip-ng # do not mix up with libzip
-DMZ_PROJECT_SUFFIX=-ng # Force -ng suffix even with compat
Comment 5 Samuel Bauer 2022-10-04 15:55:12 UTC
Maybe zlib-ng should also allow to set -ng suffix even when using compat mode

So both zlibg-ng, minizip-ng, and zlib[minizip] can be installed altogether without collision.
Preferred version will remain sys-libs/zlib, but build system for any package may be tweaked to choose which zlib/minizip to use.
Comment 6 Samuel Bauer 2022-10-04 16:46:34 UTC
Sorry to be so verbose, but I did further test and couldn't apply -ng prefix when in compat mode for zlib-ng

So I just reverted my view and linked to zlib:
sed -i -e 's/add_subdirectory(Externals\/zlib-ng)/find_package(PkgConfig REQUIRED)\npkg_check_modules(zlib z)/' CMakeLists.txt
sed -i -e 's/ZLIB::ZLIB/z/' $(find -name CMakeLists.txt -exec grep -l ZLIB::ZLIB '{}' '+') || die

and tweaked minizip-ng to use -ng prefix even in compat mode: comment#4
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-16 23:35:10 UTC
(In reply to Samuel Bauer from comment #4)
> Oh, my draft for minizip-ng also included:
> 
> -DCMAKE_INSTALL_INCLUDEDIR=/usr/include/minizip-ng # do not mix up with
> libzip
> -DMZ_PROJECT_SUFFIX=-ng # Force -ng suffix even with compat

The problem is, it's legitimate to want it to replace the system minizip, but it's not something we're encouraging yet.

So, I guess we want to do.. two builds?

1. Systemwide minizip (conflicts with zlib[minizip])
2. minizip-ng mode (USE=compat but install to -ng prefix)

Or do we do 3 builds?
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-19 03:12:06 UTC
*** Bug 850568 has been marked as a duplicate of this bug. ***
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-19 03:12:14 UTC
*** Bug 880207 has been marked as a duplicate of this bug. ***
Comment 10 Paul Zander 2023-06-27 19:55:06 UTC
Created attachment 864741 [details, diff]
fix minizip-ng[-compat] detection

One could take inspiration from https://github.com/dolphin-emu/dolphin/blob/master/Externals/zlib-ng/CMakeLists.txt to fix zlib-ng detection.