From 4ca156e2d8a5e50b1daeac8a65b6720d0e7a565c Mon Sep 17 00:00:00 2001 From: historic_bruno Date: Sun, 18 Jan 2015 03:31:26 +0000 Subject: [PATCH] Updates build-osx-libs.sh to use wxWidgets 3.0.2. Adds patch to fix wxWidgets build on Yosemite (based on http://trac.wxwidgets.org/changeset/76743), fixes #2924. Removes patch for previous version of wxWidgets. This was SVN commit r16155. --- libraries/osx/build-osx-libs.sh | 6 +- .../osx/patches/wxwidgets-glcanvas-fix.diff | 65 ---------- .../osx/patches/wxwidgets-webkit-fix.diff | 112 ++++++++++++++++++ 3 files changed, 115 insertions(+), 68 deletions(-) delete mode 100644 libraries/osx/patches/wxwidgets-glcanvas-fix.diff create mode 100644 libraries/osx/patches/wxwidgets-webkit-fix.diff diff --git a/libraries/osx/build-osx-libs.sh b/libraries/osx/build-osx-libs.sh index 6ea2784735..21481852f9 100755 --- a/libraries/osx/build-osx-libs.sh +++ b/libraries/osx/build-osx-libs.sh @@ -27,7 +27,7 @@ XML2_VERSION="libxml2-2.9.1" SDL2_VERSION="SDL-2.0.4-9134" BOOST_VERSION="boost_1_52_0" # * wxWidgets 2.9+ is necessary for 64-bit OS X build w/ OpenGL support -WXWIDGETS_VERSION="wxWidgets-3.0.1" +WXWIDGETS_VERSION="wxWidgets-3.0.2" JPEG_VERSION="jpegsrc.v8d" JPEG_DIR="jpeg-8d" # Must match directory name inside source tarball # * libpng was included as part of X11 but that's removed from Mountain Lion @@ -358,8 +358,8 @@ then if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then CONF_OPTS="$CONF_OPTS --with-macosx-version-min=$MIN_OSX_VERSION" fi - # patch to fix Atlas on VMs w/ software rendering (fixed upstream, see http://trac.wxwidgets.org/ticket/16555 ) - (patch -p0 -d.. -i../../patches/wxwidgets-glcanvas-fix.diff && ../configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" $CONF_OPTS && make ${JOBS} && make install) || die "wxWidgets build failed" + # patch to fix wxWidgets build on Yosemite (fixed upstream, see http://trac.wxwidgets.org/ticket/16329 ) + (patch -p0 -d.. -i../../patches/wxwidgets-webkit-fix.diff && ../configure CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" $CONF_OPTS && make ${JOBS} && make install) || die "wxWidgets build failed" popd popd touch .already-built diff --git a/libraries/osx/patches/wxwidgets-glcanvas-fix.diff b/libraries/osx/patches/wxwidgets-glcanvas-fix.diff deleted file mode 100644 index e97232dbcc..0000000000 --- a/libraries/osx/patches/wxwidgets-glcanvas-fix.diff +++ /dev/null @@ -1,65 +0,0 @@ ---- src/osx/cocoa/glcanvas.mm 2014-06-14 14:48:48.000000000 -0700 -+++ src/osx/cocoa/glcanvas.mm 2014-09-22 12:57:10.000000000 -0700 -@@ -81,28 +81,47 @@ - WXGLPixelFormat WXGLChoosePixelFormat(const int *attribList) - { - NSOpenGLPixelFormatAttribute data[512]; -- const NSOpenGLPixelFormatAttribute defaultAttribs[] = -+ -+ unsigned p = 0; -+ data[p++] = NSOpenGLPFAMinimumPolicy; // make _SIZE tags behave more like GLX -+ -+ // Test if we support hardware acceleration, we always want to use it if it -+ // is available and, apparently, in spite of the Apple docs explicitly -+ // saying the contrary: -+ // -+ // If present, this attribute indicates that only hardware-accelerated -+ // renderers are considered. If not present, accelerated renderers are -+ // still preferred. -+ // -+ // hardware acceleration is not always used without it, so we do need to -+ // specify it. But we shouldn't do it if acceleration is really not -+ // available. -+ const NSOpenGLPixelFormatAttribute -+ attrsAccel[] = { NSOpenGLPFAAccelerated, 0 }; -+ if ( WXGLPixelFormat testFormat = [[NSOpenGLPixelFormat alloc] -+ initWithAttributes: attrsAccel] ) - { -- NSOpenGLPFADoubleBuffer, -- NSOpenGLPFAMinimumPolicy, -- NSOpenGLPFAColorSize,(NSOpenGLPixelFormatAttribute)8, -- NSOpenGLPFAAlphaSize,(NSOpenGLPixelFormatAttribute)0, -- NSOpenGLPFADepthSize,(NSOpenGLPixelFormatAttribute)8, -- NSOpenGLPFAAccelerated, // use hardware accelerated context -- (NSOpenGLPixelFormatAttribute)nil -- }; -- -+ // Hardware acceleration is available, use it. -+ data[p++] = NSOpenGLPFAAccelerated; -+ [testFormat release]; -+ } -+ - const NSOpenGLPixelFormatAttribute *attribs; - if ( !attribList ) - { -- attribs = defaultAttribs; -+ // Default attributes -+ data[p++] = NSOpenGLPFADoubleBuffer; -+ data[p++] = NSOpenGLPFAColorSize; -+ data[p++] = (NSOpenGLPixelFormatAttribute)8; -+ data[p++] = NSOpenGLPFAAlphaSize; -+ data[p++] = (NSOpenGLPixelFormatAttribute)0; -+ data[p++] = NSOpenGLPFADepthSize; -+ data[p++] = (NSOpenGLPixelFormatAttribute)8; -+ data[p] = 0; -+ attribs = data; - } - else - { -- unsigned p = 0; -- data[p++] = NSOpenGLPFAMinimumPolicy; // make _SIZE tags behave more like GLX -- data[p++] = NSOpenGLPFAAccelerated; // use hardware accelerated context -- - for ( unsigned arg = 0; attribList[arg] !=0 && p < WXSIZEOF(data); ) - { - switch ( attribList[arg++] ) diff --git a/libraries/osx/patches/wxwidgets-webkit-fix.diff b/libraries/osx/patches/wxwidgets-webkit-fix.diff new file mode 100644 index 0000000000..f4766b6311 --- /dev/null +++ b/libraries/osx/patches/wxwidgets-webkit-fix.diff @@ -0,0 +1,112 @@ +Index: include/wx/defs.h +=================================================================== +--- include/wx/defs.h ++++ include/wx/defs.h +@@ -3091,4 +3091,5 @@ + DECLARE_WXCOCOA_OBJC_CLASS(NSSet); + DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext); ++DECLARE_WXCOCOA_OBJC_CLASS(UIWebView); + + typedef WX_UIWindow WXWindow; +@@ -3096,6 +3097,13 @@ + typedef WX_EAGLContext WXGLContext; + typedef WX_NSString* WXGLPixelFormat; +- +-#endif ++typedef WX_UIWebView OSXWebViewPtr; ++ ++#endif ++ ++#if wxOSX_USE_COCOA_OR_CARBON ++DECLARE_WXCOCOA_OBJC_CLASS(WebView); ++typedef WX_WebView OSXWebViewPtr; ++#endif ++ + + #endif /* __WXMAC__ */ +Index: include/wx/html/webkit.h +=================================================================== +--- include/wx/html/webkit.h ++++ include/wx/html/webkit.h +@@ -19,5 +19,4 @@ + + #include "wx/control.h" +-DECLARE_WXCOCOA_OBJC_CLASS(WebView); + + // ---------------------------------------------------------------------------- +@@ -108,5 +107,5 @@ + wxString m_pageTitle; + +- WX_WebView m_webView; ++ OSXWebViewPtr m_webView; + + // we may use this later to setup our own mouse events, +Index: include/wx/osx/webview_webkit.h +=================================================================== +--- include/wx/osx/webview_webkit.h ++++ include/wx/osx/webview_webkit.h +@@ -158,5 +158,5 @@ + wxString m_pageTitle; + +- wxObjCID m_webView; ++ OSXWebViewPtr m_webView; + + // we may use this later to setup our own mouse events, +Index: src/osx/webview_webkit.mm +=================================================================== +--- src/osx/webview_webkit.mm ++++ src/osx/webview_webkit.mm +@@ -442,7 +442,7 @@ + if ( !m_webView ) + return; + +- [(WebView*)m_webView goBack]; ++ [m_webView goBack]; + } + + void wxWebViewWebKit::GoForward() +@@ -450,7 +450,7 @@ + if ( !m_webView ) + return; + +- [(WebView*)m_webView goForward]; ++ [m_webView goForward]; + } + + void wxWebViewWebKit::Reload(wxWebViewReloadFlags flags) +@@ -849,7 +849,7 @@ + if ( !m_webView ) + return; + +- [(WebView*)m_webView cut:m_webView]; ++ [m_webView cut:m_webView]; + } + + void wxWebViewWebKit::Copy() +@@ -857,7 +857,7 @@ + if ( !m_webView ) + return; + +- [(WebView*)m_webView copy:m_webView]; ++ [m_webView copy:m_webView]; + } + + void wxWebViewWebKit::Paste() +@@ -865,7 +865,7 @@ + if ( !m_webView ) + return; + +- [(WebView*)m_webView paste:m_webView]; ++ [m_webView paste:m_webView]; + } + + void wxWebViewWebKit::DeleteSelection() +@@ -873,7 +873,7 @@ + if ( !m_webView ) + return; + +- [(WebView*)m_webView deleteSelection]; ++ [m_webView deleteSelection]; + } + + bool wxWebViewWebKit::HasSelection() const