summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter van den Abeele <pvdabeel@gentoo.org>2004-07-11 03:47:33 +0000
committerPieter van den Abeele <pvdabeel@gentoo.org>2004-07-11 03:47:33 +0000
commit4fa816fd42abd24a16160e2962a29d1afce5269a (patch)
tree5b390c596c585ca0078202a916f4a69bc9b8aeec /media-libs/libpng
parentremove -* from keywords (diff)
downloadhistorical-4fa816fd42abd24a16160e2962a29d1afce5269a.tar.gz
historical-4fa816fd42abd24a16160e2962a29d1afce5269a.tar.bz2
historical-4fa816fd42abd24a16160e2962a29d1afce5269a.zip
Stable on Mac OS X - Patching was required: implemented missing strnlen
Diffstat (limited to 'media-libs/libpng')
-rw-r--r--media-libs/libpng/files/macos.patch17
-rw-r--r--media-libs/libpng/libpng-1.2.5-r7.ebuild15
2 files changed, 31 insertions, 1 deletions
diff --git a/media-libs/libpng/files/macos.patch b/media-libs/libpng/files/macos.patch
new file mode 100644
index 000000000000..f6ed524e9b98
--- /dev/null
+++ b/media-libs/libpng/files/macos.patch
@@ -0,0 +1,17 @@
+--- libpng-1.2.5/pngerror.c.orig Sun Jul 11 05:43:34 2004
++++ libpng-1.2.5/pngerror.c Sun Jul 11 05:43:45 2004
+@@ -23,6 +23,14 @@
+ png_default_warning PNGARG((png_structp png_ptr,
+ png_const_charp warning_message));
+
++size_t strnlen(const char *s, size_t limit)
++{
++ size_t len = 0;
++ while ((len < limit) && (*s++))
++ len++;
++ return len;
++}
++
+ /* This function is called whenever there is a fatal error. This function
+ * should not be changed. If there is a need to handle errors differently,
+ * you should supply a replacement error function and use png_set_error_fn()
diff --git a/media-libs/libpng/libpng-1.2.5-r7.ebuild b/media-libs/libpng/libpng-1.2.5-r7.ebuild
index fe68e8d7f0df..23a1c4a47595 100644
--- a/media-libs/libpng/libpng-1.2.5-r7.ebuild
+++ b/media-libs/libpng/libpng-1.2.5-r7.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/libpng/libpng-1.2.5-r7.ebuild,v 1.1 2004/07/07 14:37:03 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/libpng/libpng-1.2.5-r7.ebuild,v 1.2 2004/07/11 03:47:33 pvdabeel Exp $
inherit flag-o-matic eutils gcc
@@ -19,7 +19,10 @@ src_unpack() {
unpack ${A}
cd ${S}
+
epatch ${FILESDIR}/${P}-gentoo.diff
+
+ use macos && epatch ${FILESDIR}/macos.patch # implements strnlen
[ "`gcc-version`" == "3.2" ] && replace-cpu-flags i586 k6 k6-2 k6-3
[ "`gcc-version`" == "3.3" ] && replace-cpu-flags i586 k6 k6-2 k6-3
@@ -31,6 +34,16 @@ src_unpack() {
-e "s:prefix=/usr/local:prefix=/usr:" \
-e "s:OBJSDLL = :OBJSDLL = -lz -lm :" \
scripts/makefile.linux > Makefile
+
+ if use macos; then
+ einfo "Patching the source for Mac OS X / Darwin compatibility"
+ sed \
+ -e "s:ZLIBLIB=.*:ZLIBLIB=/usr/lib:" \
+ -e "s:ZLIBINC=.*:ZLIBINC=/usr/include:" \
+ -e "s:-O3:${CFLAGS}:" \
+ -e "s:prefix=/usr/local:prefix=/usr:" \
+ scripts/makefile.darwin > Makefile
+ fi
}
src_compile() {