commit:     e4b9c7bfe522a0bfa760db822effe83046024d3e
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  9 18:18:13 2019 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sat Mar  9 18:18:13 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4b9c7bf

media-libs/gd: fix build for systems without SSE support

Bug: https://github.com/libgd/libgd/issues/242
Closes: https://bugs.gentoo.org/603360
Closes: https://bugs.gentoo.org/587992
Closes: https://bugs.gentoo.org/632076
Closes: https://bugs.gentoo.org/608730
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 media-libs/gd/gd-2.2.5-r2.ebuild | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/media-libs/gd/gd-2.2.5-r2.ebuild b/media-libs/gd/gd-2.2.5-r2.ebuild
index 799f5b0382a..636cf3398f4 100644
--- a/media-libs/gd/gd-2.2.5-r2.ebuild
+++ b/media-libs/gd/gd-2.2.5-r2.ebuild
@@ -3,7 +3,7 @@
 
 EAPI="7"
 
-inherit autotools multilib-minimal
+inherit autotools flag-o-matic multilib-minimal
 
 DESCRIPTION="Graphics library for fast image creation"
 HOMEPAGE="https://libgd.org/ https://www.boutell.com/gd/";
@@ -16,7 +16,7 @@ 
SRC_URI="https://github.com/libgd/libgd/releases/download/${P}/lib${P}.tar.xz
 LICENSE="gd IJG HPND BSD"
 SLOT="2/3"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 
~sh sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux 
~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
-IUSE="fontconfig jpeg png static-libs test tiff truetype webp xpm zlib"
+IUSE="cpu_flags_x86_sse fontconfig jpeg png static-libs test tiff truetype 
webp xpm zlib"
 
 # fontconfig has prefixed font paths, details see bug #518970
 REQUIRED_USE="prefix? ( fontconfig )"
@@ -59,6 +59,13 @@ src_prepare() {
 }
 
 multilib_src_configure() {
+       # bug 603360, 
https://github.com/libgd/libgd/blob/fd06f7f83c5e78bf5b7f5397746b4e5ee4366250/docs/README.TESTING#L65
+       if use cpu_flags_x86_sse ; then
+               append-cflags -msse -mfpmath=sse
+       else
+               append-cflags -ffloat-store
+       fi
+
        # we aren't actually {en,dis}abling X here ... the configure
        # script uses it just to add explicit -I/-L paths which we
        # don't care about on Gentoo systems.

Reply via email to