commit:     ede657b970d1deee8305dbefaf5651c37aea115c
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 24 08:15:56 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Jun 24 08:15:56 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ede657b9

media-libs/gd: add upstream fix for building under OS X #583584

 media-libs/gd/files/gd-2.2.2-osx-libtool.patch | 37 ++++++++++++++++++++++++++
 media-libs/gd/gd-2.2.2.ebuild                  |  4 +++
 2 files changed, 41 insertions(+)

diff --git a/media-libs/gd/files/gd-2.2.2-osx-libtool.patch 
b/media-libs/gd/files/gd-2.2.2-osx-libtool.patch
new file mode 100644
index 0000000..4d20f33
--- /dev/null
+++ b/media-libs/gd/files/gd-2.2.2-osx-libtool.patch
@@ -0,0 +1,37 @@
+https://bugs.gentoo.org/583584
+https://github.com/libgd/libgd/issues/241
+
+From dd6615fd138e53656a7883015d4a6b2d02292b26 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <[email protected]>
+Date: Sat, 21 May 2016 15:00:53 -0400
+Subject: [PATCH] libtool: rework revision to fix OS X breakage
+
+It seems the OS X linker restricts the revision field to 8 bits.
+Rework how we calculate that value and pack it in closer to fit.
+It might produce some collisions if we get to like 2.2.8, but oh
+well ... this field doesn't need to be super exact.
+
+Fixes #214 and fixes #241.
+---
+ configure.ac | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/configure
++++ b/configure
+@@ -2460,7 +2460,12 @@ AC_SUBST(GDLIB_VERSION)
+ # See 
http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info
+ 
+ GDLIB_LT_CURRENT=3
++# This is the version where the soname (current above) changes.  We use it
++# to reset the revision base back to zero.  It's a bit of a pain, but some
++# systems restrict the revision range below to [0..255] (like OS X).
++GDLIB_PREV_MAJOR=2
++GDLIB_PREV_MINOR=2
+-GDLIB_LT_REVISION=$(printf '%i%02i%02i' $GDLIB_MAJOR $GDLIB_MINOR 
$GDLIB_REVISION)
++GDLIB_LT_REVISION=$(( ((GDLIB_MAJOR - GDLIB_PREV_MAJOR) << 6) | ((GDLIB_MINOR 
- GDLIB_PREV_MINOR) << 3) | GDLIB_REVISION ))
+ GDLIB_LT_AGE=0
+ 
+ 
+-- 
+2.8.2
+

diff --git a/media-libs/gd/gd-2.2.2.ebuild b/media-libs/gd/gd-2.2.2.ebuild
index 9571241..e7f8742 100644
--- a/media-libs/gd/gd-2.2.2.ebuild
+++ b/media-libs/gd/gd-2.2.2.ebuild
@@ -30,6 +30,10 @@ DEPEND="${RDEPEND}
 
 S="${WORKDIR}/lib${P}"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-osx-libtool.patch #583584
+)
+
 src_prepare() {
        default
        elibtoolize  # for shared library on Solaris

Reply via email to