I change zlib to zlib-ng.
In this case hashcat compilation fails with an error "minizip/ioapi.h: File not found".
Steps to Reproduce:
1. Install zlib-ng:
USE="-compat" emerge sys-apps/zlib-ng
emerge -C sys-apps/zlib
USE="compat" emerge -1 sys-apps/zlib-ng
echo "*sys-apps/zlib-ng" >> /etc/portage/profile/packages
echo "sys-libs/zlib-1.2.11-r4" >> /etc/portage/profile/package.provided
2. Recompile hashcat:
emerge -1 hascat
Got an errors like:
include/ext_lzma.h:12:10: Fatal error: minizip/ioapi.h: File not found
Problem in hardcoded variable "USE_SYSTEM_ZLIB=0" at "src_compile" stage.
zlib-ng doesn't have minizip support, so it's not a drop-in replacement for anything needing zlib[minizip]
there's minizip-ng (not in tree) but it was kind of messy last time I looked at it
Either way, since you're essentially using package.provided to remove the minizip dep that hashcat is requesting, I can't really consider this a bug.
Created attachment 725878 [details, diff]
Patch for app-crypt/hashcat-6.2.1-r1.ebuild.patch to improve system-zlib use flag
system-zlib use flag needs to compile hashcat with sys-libs/zlib-ng.
Normally, zlib[minizip] library hardcoded in hashcat. And hashcat can not be compiled. if system-wide library zlib changed to zlib-ng.
minizip use flag is hardcoded in hashcat ebuild.
Switching it off in zlib package does not resolve problem.
I’m not convinced that’s a fix. The real “fix” is we package the ng version of minizip.
Created attachment 725881 [details, diff]
Improve system-zlib use flag
Patch improve system-zlib use flag, which allow to compile hashcat with zlib-ng.
Hashcat hardcoded with minizip feature from zlib library (https://github.com/hashcat/hashcat/issues/2895).
Hashcat always compiled with system-wide zlib library, as configured in ebuild in USE_SYSTEM_ZLIB=1 variable at src_compile stage.
If zlib changed to zlib-ng, than hashcat compilation fails without minizip features, which not supported in zlib-ng. But hashcat may be compiled with inbound zlib library, which support minizip features. "system-zlib" use flag allow to control this behaviour.
> I’m not convinced that’s a fix. The real “fix” is we package the ng version of minizip.
minizip-ng has no "ioapi.h" file and can not be replacement for zlib[minizip] in easy way.
But "system-zlib" use flag - is easy way to allow hashcat compilation with both sys-libs/zlib and sys-libs/zlib-ng.
Then an option could be to have zlib provide only minizip and be made to coexist with zlib-ng.
There are a lot of packages that need minizip, and making them use bundled deps is going backward with this, hashcat shouldn't do this.
Created attachment 725884 [details]
Ebuild for sys-libs/minizip-ng-3.0.2.ebuild
> There are a lot of packages that need minizip
At thist time, no minizip neither minizip-ng package even not exists in portage.
But zlib-ng is package for real usage.
So, I need to choise something one: use zlib-ng or use hashcat.
I want to use all: zlib-ng and hashcat.
And I need to use them now - not in the future, when minizip/minizip-ng appears in portage and hashcat can be compiled with them in combination with zlib-ng.
Use zlib-ng as system-wide zlib library, and hashcat with inbound copliled zlib[minizip] library - is way for me at now.
I agree, that separate minizip/minizip-ng library - is more efficiency way to resolve such source code conflicts. But in some case usage zlib-ng as system wide library and zlib[minizip] compiled into an application - is a feature. And hardcoded USE_SYSTEM_ZLIB=0 disable this feature.
If you have an alternative solution to compile hashcat simulteniously with system-wide zlib-ng library - please, give me it.
* Chage: And hardcoded USE_SYSTEM_ZLIB=1 disable this feature.
Created attachment 725887 [details]
Ebuild for sys-libs/minizip-ng-3.0.2.ebuild
Created attachment 725950 [details, diff]
Patch for hashcat-6.2.1-r1, which improve system-zlib and system-unzip use flags
Created attachment 727026 [details, diff]
Improve "system-zlib" use flag.
hashcat can't be compiled with zlib-ng library.
This flag allow do use zlib library from hashcat source code in systems, which use sys-libs/zlib-ng, instead of sys-libs/zlib.
Please, update ebuild in portage.
New minizip-ng library does not contains ioapi interface, which used in hashcat code.
Details at https://github.com/zlib-ng/minizip-ng/issues/447
Installed minizip-ng package can not help to resolve bug.
At now, the single way to compile hashcat with system-wide zlib-ng library - by using local zlib library.
So, untill authors of hascat code do not implement supporting of zlib-ng/minizip-ng libraries, then system-zlib use flag must be realized in hashcat ebuild.