diff options
Diffstat (limited to 'sys-libs/zlib')
-rw-r--r-- | sys-libs/zlib/Manifest | 3 | ||||
-rw-r--r-- | sys-libs/zlib/zlib-1.3.ebuild | 185 |
2 files changed, 188 insertions, 0 deletions
diff --git a/sys-libs/zlib/Manifest b/sys-libs/zlib/Manifest index aa129be4281a..ad3788856d79 100644 --- a/sys-libs/zlib/Manifest +++ b/sys-libs/zlib/Manifest @@ -4,5 +4,8 @@ AUX zlib-1.2.13-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch 1870 AUX zlib-1.2.13-use-LDFLAGS-in-configure.patch 2650 BLAKE2B 3cfae2b0658534aab64f7969d86307bf96724f4ec847e378c2f87b6b9e43c00bae96845d1c3405d5d913d2005e9f18f53923329ad1cfd73e9395f94d035e275f SHA512 77499165a934d171c7d4bbd177f3cfa2e57db8923c61222a48734f8d3879245ed91fe2b900b3a429db89e098a4d4fcd9f3b6f2c1c3a86f761e1b33b56a73987d DIST zlib-1.2.13.tar.xz 1296496 BLAKE2B cefcd25989ce27e7d339af2a88455fcf64f6f5e647bedb0f05a45e4370a885fe45a60c023aa63e79b8ecf20ed3254d0052245f33f5769aca2838b42242be14a8 SHA512 9e7ac71a1824855ae526506883e439456b74ac0b811d54e94f6908249ba8719bec4c8d7672903c5280658b26cb6b5e93ecaaafe5cdc2980c760fa196773f0725 DIST zlib-1.2.13.tar.xz.asc 235 BLAKE2B 29206175f06b4e36960fc6b9403101f55c1f5b768e1921ce1402217bc85978b9fba1a4130db2df5c148b6a1c947148372be20ff8c4ce337c6f2541b42fef7274 SHA512 ca5decebe9572e77e88bac5c5119bfda7e222ed3944e4692510ae70fb5f01d8694b59a6878472b84e6b61d2d1682d94473b6312832afa520a2a23293572ea621 +DIST zlib-1.3.tar.xz 1295740 BLAKE2B 5fe0f32339267348a313f23a21e9588bdb180b7415be303c85f5f169444d019e5f176ef7322f6e64297c360acc2a6041c50e2f66d1860e5c392d8970990f176a SHA512 3868ac4da5842dd36c9dad794930675b9082ce15cbd099ddb79c0f6bd20a24aa8f33a123f378f26fe0ae02d91f31f2994dccaac565cedeaffed7b315e6ded2a2 +DIST zlib-1.3.tar.xz.asc 235 BLAKE2B 5fe6ce952699a19e848d0a6e6c3622f934340068fdcd29afb35c74f3c8ae66d04de644800d10b38c743bb2f4852ba28f1a97313cb0e6e6f9b804cbca5289ebbb SHA512 8f3ce5c21938d6abc7e121d2939648a0ce2dc01a8ab4eb001d44eb159935dd0b4f5b5e371b3ecfc0ceb23689e2cefe002065968908503cde15b1bba08aff9db6 EBUILD zlib-1.2.13-r1.ebuild 4678 BLAKE2B 9498146403a409cdf259955307713c952a3633cb25f429a0547f58396dc3d535267b15d15426a0ef798c42406c60e0afce1318bbab31743fa633a2ffc47e53a5 SHA512 02d899d6b9f62af3f820cd13df634687a2358270b48e74f091343ec3181554b4c41e0a910e8fafc3d2d826db8f0a3d5becf7854eab92d75528211f5859fbc1bf +EBUILD zlib-1.3.ebuild 4798 BLAKE2B 8599b2345505370b8f12736e3d0613aabdecd50689158297453879598c65d540257ad9af10357c2f1b6139349eb8d276375b9d342fe427cfc79343a956d0a648 SHA512 c82cf61ec2af38875bef66704add68a11ad036a1bc41c48b1a1e6a5307c0c011fa343a023b42e67287a387a4c67ee736128195d7f85154fa67840f5ff93cd47d MISC metadata.xml 494 BLAKE2B a4a57a4153aefc189e407bcb8ce84f7c94581cc66967f69097087da7e6ff48d2de683b919fb00445d095c47ef39d31e01590f8c989ce0e5e01474e73ee2a0565 SHA512 a7e0160c127b3c2a6afe99e95992d9dbd017061303759c299ec38800efd6a9e11a35ae850c23c77c09c8833cd9d61ac1267f6becadf9c22437ee35e4304400c9 diff --git a/sys-libs/zlib/zlib-1.3.ebuild b/sys-libs/zlib/zlib-1.3.ebuild new file mode 100644 index 000000000000..6dbffd69d64f --- /dev/null +++ b/sys-libs/zlib/zlib-1.3.ebuild @@ -0,0 +1,185 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Worth keeping an eye on 'develop' branch upstream for possible backports. +AUTOTOOLS_AUTO_DEPEND="no" +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/madler.asc +inherit autotools edo multilib-minimal flag-o-matic toolchain-funcs usr-ldscript verify-sig + +DESCRIPTION="Standard (de)compression library" +HOMEPAGE="https://zlib.net/" +SRC_URI=" + https://zlib.net/${P}.tar.xz + https://zlib.net/fossils/${P}.tar.xz + https://zlib.net/current/beta/${P}.tar.xz + https://github.com/madler/zlib/releases/download/v${PV}/${P}.tar.xz + verify-sig? ( + https://zlib.net/${P}.tar.xz.asc + https://github.com/madler/zlib/releases/download/v${PV}/${P}.tar.xz.asc + ) +" + +LICENSE="ZLIB" +SLOT="0/1" # subslot = SONAME +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="minizip static-libs" + +RDEPEND="!sys-libs/zlib-ng[compat]" +DEPEND="${RDEPEND}" +BDEPEND=" + minizip? ( ${AUTOTOOLS_DEPEND} ) + verify-sig? ( sec-keys/openpgp-keys-madler ) +" + +PATCHES=( + # Don't install unexpected & unused crypt.h header (which would clash with other pkgs) + # Pending upstream. bug #658536 + "${FILESDIR}"/${PN}-1.2.11-minizip-drop-crypt-header.patch + + # Respect AR, RANLIB, NM during build. Pending upstream. bug #831628 + "${FILESDIR}"/${PN}-1.2.11-configure-fix-AR-RANLIB-NM-detection.patch + + # Respect LDFLAGS during configure tests. Pending upstream + "${FILESDIR}"/${PN}-1.2.13-use-LDFLAGS-in-configure.patch + + # Fix building on sparc with older binutils, we pass it in ebuild instead + "${FILESDIR}"/${PN}-1.2.13-Revert-Turn-off-RWX-segment-warnings-on-sparc-system.patch +) + +src_prepare() { + default + + if use minizip ; then + cd contrib/minizip || die + eautoreconf + fi + + case ${CHOST} in + *-mingw*|mingw*) + # Uses preconfigured Makefile rather than configure script + multilib_copy_sources + + ;; + esac +} + +multilib_src_configure() { + # We pass manually instead of relying on the configure script/makefile + # because it would pass it even for older binutils. + use sparc && append-flags $(test-flags-CCLD -Wl,--no-warn-rwx-segments) + + # ideally we want !tc-ld-is-bfd for best future-proofing, but it needs + # https://github.com/gentoo/gentoo/pull/28355 + # mold needs this too but right now tc-ld-is-mold is also not available + if tc-ld-is-lld; then + append-ldflags -Wl,--undefined-version + fi + + case ${CHOST} in + *-mingw*|mingw*) + ;; + + *) + # bug #347167 + local uname=$("${BROOT}"/usr/share/gnuconfig/config.sub "${CHOST}" | cut -d- -f3) + + local myconf=( + --shared + --prefix="${EPREFIX}/usr" + --libdir="${EPREFIX}/usr/$(get_libdir)" + ${uname:+--uname=${uname}} + ) + + # Not an autoconf script, so can't use econf + edo "${S}"/configure "${myconf[@]}" + + ;; + esac + + if use minizip ; then + local minizipdir="contrib/minizip" + mkdir -p "${BUILD_DIR}/${minizipdir}" || die + + cd ${minizipdir} || die + ECONF_SOURCE="${S}/${minizipdir}" econf $(use_enable static-libs static) + fi +} + +multilib_src_compile() { + case ${CHOST} in + *-mingw*|mingw*) + emake -f win32/Makefile.gcc STRIP=true PREFIX=${CHOST}- + sed \ + -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' \ + -e 's|@includedir@|${prefix}/include|g' \ + -e 's|@VERSION@|'${PV}'|g' \ + zlib.pc.in > zlib.pc || die + ;; + + *) + emake + + ;; + esac + + use minizip && emake -C contrib/minizip +} + +sed_macros() { + # Clean up namespace a little, bug #383179 + # We do it here so we only have to tweak 2 files + sed -i -r 's:\<(O[FN])\>:_Z_\1:g' "$@" || die +} + +multilib_src_install() { + case ${CHOST} in + *-mingw*|mingw*) + emake -f win32/Makefile.gcc install \ + BINARY_PATH="${ED}/usr/bin" \ + LIBRARY_PATH="${ED}/usr/$(get_libdir)" \ + INCLUDE_PATH="${ED}/usr/include" \ + SHARED_MODE=1 + + # Overwrites zlib.pc created from win32/Makefile.gcc, bug #620136 + insinto /usr/$(get_libdir)/pkgconfig + doins zlib.pc + + ;; + + *) + emake install DESTDIR="${D}" LDCONFIG=: + gen_usr_ldscript -a z + + ;; + esac + + sed_macros "${ED}"/usr/include/*.h + + if use minizip ; then + emake -C contrib/minizip install DESTDIR="${D}" + sed_macros "${ED}"/usr/include/minizip/*.h + + # This might not exist if slibtool is used. + # bug #816756 + rm -f "${ED}"/usr/$(get_libdir)/libminizip.la || die + fi + + if ! use static-libs ; then + # bug #419645 + rm "${ED}"/usr/$(get_libdir)/libz.a || die + fi +} + +multilib_src_install_all() { + dodoc FAQ README ChangeLog doc/*.txt + + if use minizip ; then + dodoc contrib/minizip/*.txt + doman contrib/minizip/*.1 + fi +} |