commit:     c86aad600713909bf09a46ff9dba170c9b16df36
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Apr  6 03:34:07 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Apr  6 18:18:26 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c86aad60

media-libs/libsdl: disable (some) broken features on Darwin

We can't get all the way there, but some features
can't be built right now for sure, so let's
disable those.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/libsdl/libsdl-1.2.15_p20210224.ebuild | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/media-libs/libsdl/libsdl-1.2.15_p20210224.ebuild 
b/media-libs/libsdl/libsdl-1.2.15_p20210224.ebuild
index 4b61e3b581f..65181ee97dc 100644
--- a/media-libs/libsdl/libsdl-1.2.15_p20210224.ebuild
+++ b/media-libs/libsdl/libsdl-1.2.15_p20210224.ebuild
@@ -74,11 +74,34 @@ HTML_DOCS=( {docs,VisualC}.html 
docs/{html,images,index.html} )
 
 src_prepare() {
        default
+
+       if $(tc-is-gcc) && [[ ${CHOST} == *-darwin* ]] ; then
+               # GCC at least has no idea what -fpascal-strings is
+               sed -i -e '/EXTRA_CFLAGS="$EXTRA_CFLAGS -fpascal-strings"/d' 
configure.ac || die
+               # We have trouble building against Frameworks with GCC for now 
(no Blocks support, etc)
+               # error: unknown type name ‘CGImageSourceAnimationBlock’
+               sed -i \
+                       -e '/EXTRA_CFLAGS="$EXTRA_CFLAGS 
-DTARGET_API_MAC_CARBON"/d' \
+                       -e '/EXTRA_CFLAGS="$EXTRA_CFLAGS 
-DTARGET_API_MAC_OSX"/d' \
+                       configure.ac || die
+       fi
+
        AT_M4DIR="${EPREFIX}/usr/share/aclocal acinclude" eautoreconf
 }
 
 multilib_src_configure() {
        local myconf=
+
+       if $(tc-is-gcc) && [[ ${CHOST} == *-darwin* ]] ; then
+               # We can't build against Cocoa because we lack Blocks + 
Objective C++ support in
+               # GCC (for now)
+               use video && myconf="${myconf} --disable-video-cocoa"
+               # CD support drags in audio
+               myconf="${myconf} --disable-cdrom"
+       else
+               myconf="${myconf} --enable-cdrom"
+       fi
+
        if use !x86 && use !x86-linux ; then
                myconf="${myconf} --disable-nasm"
        else
@@ -96,7 +119,6 @@ multilib_src_configure() {
                --disable-arts \
                --disable-esd \
                --enable-events \
-               --enable-cdrom \
                --enable-threads \
                --enable-timers \
                --enable-file \

Reply via email to