From a3dbada1077fc124928e13dcddd4f4f2fcac66d4 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 10 Dec 2016 18:57:09 +0100 Subject: [PATCH] wxmac: fix build with clang-3.8 --- pkgs/development/libraries/wxmac/default.nix | 47 ++++++++++++++-- pkgs/development/libraries/wxmac/wx.patch | 59 -------------------- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 42 insertions(+), 66 deletions(-) delete mode 100644 pkgs/development/libraries/wxmac/wx.patch diff --git a/pkgs/development/libraries/wxmac/default.nix b/pkgs/development/libraries/wxmac/default.nix index e5d680501f0..f4e71424833 100644 --- a/pkgs/development/libraries/wxmac/default.nix +++ b/pkgs/development/libraries/wxmac/default.nix @@ -1,7 +1,7 @@ -{ stdenv, fetchurl -, expat, libiconv, libjpeg, libpng, libtiff, zlib -, setfile, rez, derez -, AGL, Cocoa, Kernel, QuickTime +{ stdenv, fetchurl, fetchpatch, expat, libiconv, libjpeg, libpng, libtiff, zlib +# darwin only attributes +, derez, rez, setfile +, AGL, Cocoa, Kernel }: with stdenv.lib; @@ -15,11 +15,46 @@ stdenv.mkDerivation rec { sha256 = "346879dc554f3ab8d6da2704f651ecb504a22e9d31c17ef5449b129ed711585d"; }; - patches = [ ./wx.patch ]; + patches = + [ # Use std::abs() from instead of abs() from to avoid problems + # with abiguous overloads for clang-3.8 and gcc6. + (fetchpatch { + name = "patch-stc-abs.diff"; + url = https://github.com/wxWidgets/wxWidgets/commit/73e9e18ea09ffffcaac50237def0d9728a213c02.patch; + sha256 = "0w5whmfzm8waw62jmippming0zffa9064m5b3aw5nixph21rlcvq"; + }) + + # Various fixes related to Yosemite. Revisit in next stable release. + # Please keep an eye on http://trac.wxwidgets.org/ticket/16329 as well + # Theoretically the above linked patch should still be needed, but it isn't. + # Try to find out why. + (fetchpatch { + name = "patch-yosemite.diff"; + url = https://raw.githubusercontent.com/Homebrew/formula-patches/bbf4995/wxmac/patch-yosemite.diff; + sha256 = "0ss66z2a79v976mvlrskyj1zmkyaz8hbwm98p29bscfvcx5845jb"; + }) + + # Remove uncenessary includes + # http://trac.wxwidgets.org/changeset/f6a2d1caef5c6d412c84aa900cb0d3990b350938/git-wxWidgets + (fetchpatch { + name = "patch-quicktime-removal.diff"; + url = https://raw.githubusercontent.com/Homebrew/formula-patches/bbf4995/wxmac/patch-quicktime-removal.diff; + sha256 = "0mzvdk8r70p9s1wj7qzdsqmdrlxlf2dalh9gqs8xjkqq2666yp0y"; + }) + + # Patch for wxOSXPrintData, custom paper not applied + # http://trac.wxwidgets.org/ticket/16959 + (fetchpatch { + name = "wxPaperCustomPatch.patch"; + url = http://trac.wxwidgets.org/raw-attachment/ticket/16959/wxPaperCustomPatch.patch; + sha256 = "0xgscv86f8dhggn9n8bhlq9wlj3ydsicgy9v35sraxyma18cbjvl"; + }) + ]; buildInputs = [ expat libiconv libjpeg libpng libtiff zlib - Cocoa Kernel QuickTime setfile rez derez + derez rez setfile + Cocoa Kernel ]; propagatedBuildInputs = [ AGL ]; diff --git a/pkgs/development/libraries/wxmac/wx.patch b/pkgs/development/libraries/wxmac/wx.patch deleted file mode 100644 index 622e22d1fdb..00000000000 --- a/pkgs/development/libraries/wxmac/wx.patch +++ /dev/null @@ -1,59 +0,0 @@ -diff --git a/include/wx/defs.h b/include/wx/defs.h -index 397ddd7..d128083 100644 ---- a/include/wx/defs.h -+++ b/include/wx/defs.h -@@ -3169,12 +3169,20 @@ DECLARE_WXCOCOA_OBJC_CLASS(UIImage); - DECLARE_WXCOCOA_OBJC_CLASS(UIEvent); - DECLARE_WXCOCOA_OBJC_CLASS(NSSet); - DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext); -+DECLARE_WXCOCOA_OBJC_CLASS(UIWebView); - - typedef WX_UIWindow WXWindow; - typedef WX_UIView WXWidget; - typedef WX_EAGLContext WXGLContext; - typedef WX_NSString* WXGLPixelFormat; - -+typedef WX_UIWebView OSXWebViewPtr; -+ -+#endif -+ -+#if wxOSX_USE_COCOA_OR_CARBON -+DECLARE_WXCOCOA_OBJC_CLASS(WebView); -+typedef WX_WebView OSXWebViewPtr; - #endif - - #endif /* __WXMAC__ */ -diff --git a/include/wx/html/webkit.h b/include/wx/html/webkit.h -index 8700367..f805099 100644 ---- a/include/wx/html/webkit.h -+++ b/include/wx/html/webkit.h -@@ -18,7 +18,6 @@ - #endif - - #include "wx/control.h" --DECLARE_WXCOCOA_OBJC_CLASS(WebView); - - // ---------------------------------------------------------------------------- - // Web Kit Control -@@ -107,7 +106,7 @@ private: - wxString m_currentURL; - wxString m_pageTitle; - -- WX_WebView m_webView; -+ OSXWebViewPtr m_webView; - - // we may use this later to setup our own mouse events, - // so leave it in for now. -diff --git a/include/wx/osx/webview_webkit.h b/include/wx/osx/webview_webkit.h -index 803f8b0..438e532 100644 ---- a/include/wx/osx/webview_webkit.h -+++ b/include/wx/osx/webview_webkit.h -@@ -158,7 +158,7 @@ private: - wxWindowID m_windowID; - wxString m_pageTitle; - -- wxObjCID m_webView; -+ OSXWebViewPtr m_webView; - - // we may use this later to setup our own mouse events, - // so leave it in for now. diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e8b7341cd39..c18b2f4539d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9612,7 +9612,7 @@ in }; wxmac = callPackage ../development/libraries/wxmac { - inherit (darwin.apple_sdk.frameworks) AGL Cocoa Kernel QuickTime; + inherit (darwin.apple_sdk.frameworks) AGL Cocoa Kernel; inherit (darwin.stubs) setfile rez derez; };