diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-09-21 19:36:25 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-09-21 19:36:25 +0000 |
commit | 1045e92c80c3f9b92cfdb0370a4a724d39c5161d (patch) | |
tree | 53b8921933f2e9cc8944144861ad76b8d0882949 /sys-libs | |
parent | Add back because redmine depends on this specific version. Sigh. Thanks to Mr... (diff) | |
download | gentoo-2-1045e92c80c3f9b92cfdb0370a4a724d39c5161d.tar.gz gentoo-2-1045e92c80c3f9b92cfdb0370a4a724d39c5161d.tar.bz2 gentoo-2-1045e92c80c3f9b92cfdb0370a4a724d39c5161d.zip |
Add USE=static-libs support, and USE=minizip to control building of the minizip code as a library for other apps to link against (like vlc) #383351.
(Portage version: 2.2.0_alpha58/cvs/Linux x86_64)
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/zlib/ChangeLog | 10 | ||||
-rw-r--r-- | sys-libs/zlib/files/zlib-1.2.4-minizip-autotools.patch | 64 | ||||
-rw-r--r-- | sys-libs/zlib/metadata.xml | 3 | ||||
-rw-r--r-- | sys-libs/zlib/zlib-1.2.5.1-r2.ebuild | 97 |
4 files changed, 173 insertions, 1 deletions
diff --git a/sys-libs/zlib/ChangeLog b/sys-libs/zlib/ChangeLog index eb1c72932801..11fae272abf7 100644 --- a/sys-libs/zlib/ChangeLog +++ b/sys-libs/zlib/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for sys-libs/zlib # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/zlib/ChangeLog,v 1.94 2011/09/16 21:40:42 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/zlib/ChangeLog,v 1.95 2011/09/21 19:36:25 vapier Exp $ + +*zlib-1.2.5.1-r2 (21 Sep 2011) + + 21 Sep 2011; Mike Frysinger <vapier@gentoo.org> + +files/zlib-1.2.4-minizip-autotools.patch, +zlib-1.2.5.1-r2.ebuild, + metadata.xml: + Add USE=static-libs support, and USE=minizip to control building of the + minizip code as a library for other apps to link against (like vlc) #383351. *zlib-1.2.5.1-r1 (16 Sep 2011) diff --git a/sys-libs/zlib/files/zlib-1.2.4-minizip-autotools.patch b/sys-libs/zlib/files/zlib-1.2.4-minizip-autotools.patch new file mode 100644 index 000000000000..81a62f0b1d18 --- /dev/null +++ b/sys-libs/zlib/files/zlib-1.2.4-minizip-autotools.patch @@ -0,0 +1,64 @@ +sniped & improved from Fedora + +--- zlib-1.2.4/contrib/minizip/configure.ac ++++ zlib-1.2.4/contrib/minizip/configure.ac +@@ -0,0 +1,12 @@ ++# -*- Autoconf -*- ++# Process this file with autoconf to produce a configure script. ++ ++AC_INIT([minizip], [@ZLIB_VER@], [bugzilla.redhat.com]) ++AC_CONFIG_SRCDIR([minigzip.c]) ++AM_INIT_AUTOMAKE([foreign]) ++LT_INIT ++ ++AC_SUBST([HAVE_UNISTD_H], [0]) ++AC_CHECK_HEADER([unistd.h], [HAVE_UNISTD_H=1], []) ++AC_CONFIG_FILES([Makefile minizip.pc]) ++AC_OUTPUT +--- zlib-1.2.4/contrib/minizip/Makefile.am ++++ zlib-1.2.4/contrib/minizip/Makefile.am +@@ -0,0 +1,28 @@ ++lib_LTLIBRARIES = libminizip.la ++ ++libminizip_la_SOURCES = \ ++ ioapi.c \ ++ mztools.c \ ++ unzip.c \ ++ zip.c ++ ++libminizip_la_CFLAGS = -I../.. -L../.. ++libminizip_la_LDFLAGS = -version-info 1:0:0 -lz ++ ++minizip_includedir = $(includedir)/minizip ++minizip_include_HEADERS = \ ++ crypt.h \ ++ ioapi.h \ ++ mztools.h \ ++ unzip.h \ ++ zip.h ++ ++pkgconfigdir = $(libdir)/pkgconfig ++pkgconfig_DATA = minizip.pc ++ ++EXTRA_PROGRAMS = miniunzip minizip ++ ++miniunzip_SOURCES = miniunz.c ++miniunzip_LDADD = libminizip.la ++ ++minizip_SOURCES = minizip.c ++minizip_LDADD = libminizip.la +--- zlib-1.2.4/contrib/minizip/minizip.pc.in ++++ zlib-1.2.4/contrib/minizip/minizip.pc.in +@@ -0,0 +1,12 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@/minizip ++ ++Name: minizip ++Description: Minizip zip file manipulation library ++Requires: ++Version: @PACKAGE_VERSION@ ++Libs: -L${libdir} -lminizip ++Libs.private: -lz ++Cflags: -I${includedir} diff --git a/sys-libs/zlib/metadata.xml b/sys-libs/zlib/metadata.xml index 96a2d586367d..cfdad4c916fd 100644 --- a/sys-libs/zlib/metadata.xml +++ b/sys-libs/zlib/metadata.xml @@ -2,4 +2,7 @@ <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <herd>base-system</herd> +<use> + <flag name='minizip'>include the minizip library for quick and dirty zip extraction</flag> +</use> </pkgmetadata> diff --git a/sys-libs/zlib/zlib-1.2.5.1-r2.ebuild b/sys-libs/zlib/zlib-1.2.5.1-r2.ebuild new file mode 100644 index 000000000000..4d8fbc704173 --- /dev/null +++ b/sys-libs/zlib/zlib-1.2.5.1-r2.ebuild @@ -0,0 +1,97 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/zlib/zlib-1.2.5.1-r2.ebuild,v 1.1 2011/09/21 19:36:25 vapier Exp $ + +inherit autotools eutils toolchain-funcs + +DESCRIPTION="Standard (de)compression library" +HOMEPAGE="http://www.zlib.net/" +SRC_URI="http://www.gzip.org/zlib/${P}.tar.gz + http://www.zlib.net/current/beta/${P}.tar.gz" + +LICENSE="ZLIB" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" +IUSE="minizip static-libs" + +RDEPEND="!<dev-libs/libxml2-2.7.7" #309623 + +src_unpack() { + unpack ${A} + cd "${S}" + # trust exit status of the compiler rather than stderr #55434 + # -if test "`(...) 2>&1`" = ""; then + # +if (...) 2>/dev/null; then + sed -i 's|\<test "`\([^"]*\) 2>&1`" = ""|\1 2>/dev/null|' configure || die + + epatch "${FILESDIR}"/${P}-version.patch + epatch "${FILESDIR}"/${P}-symlinks.patch + EPATCH_OPTS=-p1 epatch "${FILESDIR}"/${PN}-1.2.4-minizip-autotools.patch + if use minizip ; then + cd contrib/minizip + sed -i "s:@ZLIB_VER@:${PV}:" configure.ac || die + ln -s ../../minigzip.c || die + eautoreconf + fi +} + +usex() { use $1 && echo ${2:-yes} || echo ${3:-no} ; } +echoit() { echo "$@"; "$@"; } +src_compile() { + case ${CHOST} in + *-mingw*|mingw*) + emake -f win32/Makefile.gcc STRIP=true PREFIX=${CHOST}- || die + sed \ + -e 's|@prefix@|/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 + ;; + *) # not an autoconf script, so can't use econf + echoit ./configure --shared --prefix=/usr --libdir=/usr/$(get_libdir) || die + emake || die + ;; + esac + if use minizip ; then + cd contrib/minizip + econf $(use_enable static-libs static) || die + emake || die + fi +} + +src_install() { + case ${CHOST} in + *-mingw*|mingw*) + emake -f win32/Makefile.gcc install \ + BINARY_PATH="${D}/usr/bin" \ + LIBRARY_PATH="${D}/usr/$(get_libdir)" \ + INCLUDE_PATH="${D}/usr/include" \ + SHARED_MODE=1 \ + || die + insinto /usr/share/pkgconfig + doins zlib.pc || die + ;; + + *) + emake install DESTDIR="${D}" LDCONFIG=: || die + gen_usr_ldscript -a z + ;; + esac + + # clean up namespace a little #383179 + # we do it here so we only have to tweak 2 files + sed -i -r 's:\<(O[FN])\>:_Z_\1:g' "${D}"/usr/include/*.h + + dodoc FAQ README ChangeLog doc/*.txt + + if use minizip ; then + cd contrib/minizip + emake install DESTDIR="${D}" || die + dodoc *.txt + fi + + use static-libs || rm -f "${D}"/usr/$(get_libdir)/*.{a,la} +} |