Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 729940 - sys-libs/zlib-1.2.11-r2 prefix keywording
Summary: sys-libs/zlib-1.2.11-r2 prefix keywording
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Keywording (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: KEYWORDREQ, PullRequest
Depends on:
Blocks:
 
Reported: 2020-06-27 20:09 UTC by Kent Fredric (IRC: kent\n) (RETIRED)
Modified: 2020-12-26 20:14 UTC (History)
2 users (show)

See Also:
Package list:
sys-libs/zlib-1.2.11-r2 ~amd64-linux ~m68k-mint ~ppc-aix ~ppc-macos ~sparc-solaris ~sparc64-solaris ~x64-cygwin ~x64-macos ~x64-solaris ~x86-linux ~x86-macos ~x86-solaris
Runtime testing required: No
nattka: sanity-check+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-06-27 20:09:14 UTC
- dev-lang/perl uses sys-libs/zlib
- dev-lang/perl presently includes keywords:
  
~amd64-linux ~m68k-mint ~ppc-aix ~ppc-macos ~sparc-solaris ~sparc64-solaris ~x64-cygwin ~x64-macos ~x64-solaris ~x86-linux ~x86-macos ~x86-solaris

So subsequently, sys-libs/zlib should also.
Comment 1 Fabian Groffen gentoo-dev 2020-08-02 15:06:31 UTC
@base-system: these are the diffs we need (excluding keywords) for zlib:

index b43e10d3609..38bf184f03b 100644
--- a/sys-libs/zlib/zlib-1.2.11-r2.ebuild
+++ b/sys-libs/zlib/zlib-1.2.11-r2.ebuild
@@ -6,11 +6,17 @@ AUTOTOOLS_AUTO_DEPEND="no"
 
 inherit autotools toolchain-funcs multilib multilib-minimal usr-ldscript
 
+CYGWINPATCHES=(
+       "https://github.com/cygwinports/zlib/raw/22a3462cae33a82ad966ea0a7d6cbe8fc1368fec/1.2.11-gzopen_w.patch"
+       "https://github.com/cygwinports/zlib/raw/22a3462cae33a82ad966ea0a7d6cbe8fc1368fec/1.2.7-minizip-cygwin.patch"
+)
+
 DESCRIPTION="Standard (de)compression library"
 HOMEPAGE="https://zlib.net/"
 SRC_URI="https://zlib.net/${P}.tar.gz
        http://www.gzip.org/zlib/${P}.tar.gz
-       http://www.zlib.net/current/beta/${P}.tar.gz"
+       http://www.zlib.net/current/beta/${P}.tar.gz
+       elibc_Cygwin? ( ${CYGWINPATCHES[*]} )"
 
 LICENSE="ZLIB"
 SLOT="0/1" # subslot = SONAME
@@ -24,13 +30,29 @@ src_prepare() {
        epatch "${FILESDIR}"/${PN}-1.2.11-fix-deflateParams-usage.patch
        epatch "${FILESDIR}"/${PN}-1.2.11-minizip-drop-crypt-header.patch #658536
 
+       local p
+       use elibc_Cygwin &&
+       for p in "${CYGWINPATCHES[@]}"; do
+               epatch "${DISTDIR}/${p##*/}"
+       done
+
        if use minizip ; then
                cd contrib/minizip || die
                eautoreconf
        fi
 
        case ${CHOST} in
-       *-mingw*|mingw*)
+       *-cygwin*)
+               # do not use _wopen, is a mingw symbol only
+               sed -i -e '/define WIDECHAR/d' "${S}"/gzguts.h
+               # zlib1.dll is the mingw name, need cygz.dll
+               # cygz.dll is loaded by toolchain, put into subdir
+               sed -i -e 's|zlib1.dll|win32/cygz.dll|' win32/Makefile.gcc || die
+               ;;
+       esac
+
+       case ${CHOST} in
+       *-mingw*|mingw*|*-cygwin*)
                # uses preconfigured Makefile rather than configure script
                multilib_copy_sources
                ;;
@@ -41,12 +63,12 @@ echoit() { echo "$@"; "$@"; }
 
 multilib_src_configure() {
        case ${CHOST} in
-       *-mingw*|mingw*)
+       *-mingw*|mingw*|*-cygwin*)
                ;;
        *)      # not an autoconf script, so can't use econf
                local uname=$("${EPREFIX}"/usr/share/gnuconfig/config.sub "${CHOST}" | cut -d- -f3) #347167
                echoit "${S}"/configure \
-                       --shared \
+                       $(tc-is-static-only && echo "--static" || echo "--shared") \
                        --prefix="${EPREFIX}/usr" \
                        --libdir="${EPREFIX}/usr/$(get_libdir)" \
                        ${uname:+--uname=${uname}} \
@@ -65,10 +87,10 @@ multilib_src_configure() {
 
 multilib_src_compile() {
        case ${CHOST} in
-       *-mingw*|mingw*)
+       *-mingw*|mingw*|*-cygwin*)
                emake -f win32/Makefile.gcc STRIP=true PREFIX=${CHOST}-
                sed \
-                       -e 's|@prefix@|/usr|g' \
+                       -e 's|@prefix@|'"${EPREFIX}"'/usr|g' \
                        -e 's|@exec_prefix@|${prefix}|g' \
                        -e 's|@libdir@|${exec_prefix}/'$(get_libdir)'|g' \
                        -e 's|@sharedlibdir@|${exec_prefix}/'$(get_libdir)'|g' \
@@ -91,7 +113,7 @@ sed_macros() {
 
 multilib_src_install() {
        case ${CHOST} in
-       *-mingw*|mingw*)
+       *-mingw*|mingw*|*-cygwin*)
                emake -f win32/Makefile.gcc install \
                        BINARY_PATH="${ED}/usr/bin" \
                        LIBRARY_PATH="${ED}/usr/$(get_libdir)" \

Please give us your questions/comments regarding these changes.

Thanks!
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-11-27 23:52:03 UTC
@base-system: ping, look ok?
Comment 3 Larry the Git Cow gentoo-dev 2020-12-26 20:14:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7f9cc1a14669e3d592e50ee8ad8ccc33ac1d692

commit e7f9cc1a14669e3d592e50ee8ad8ccc33ac1d692
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2020-12-13 11:38:51 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2020-12-26 20:14:51 +0000

    sys-libs/zlib: sync with ::prefix
    
    Bring the prefix-only changes to the main tree.
    Affected prefix platforms: cygwin/mingw.
    
    Closes: https://bugs.gentoo.org/729940
    Package-Manager: Portage-3.0.12-prefix, Repoman-3.0.2
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/zlib/Manifest              |  2 ++
 sys-libs/zlib/zlib-1.2.11-r3.ebuild | 40 +++++++++++++++++++++++++++++--------
 2 files changed, 34 insertions(+), 8 deletions(-)