[113631] trunk/dports/graphics/wxWidgets-3.0

mojca at macports.org mojca at macports.org
Thu Nov 21 04:28:53 PST 2013


Revision: 113631
          https://trac.macports.org/changeset/113631
Author:   mojca at macports.org
Date:     2013-11-21 04:28:53 -0800 (Thu, 21 Nov 2013)
Log Message:
-----------
wxWigets-3.0: remove a patch that fails on 10.5 (#41420)

Modified Paths:
--------------
    trunk/dports/graphics/wxWidgets-3.0/Portfile

Added Paths:
-----------
    trunk/dports/graphics/wxWidgets-3.0/files/patch-src-osx-cocoa-utils.mm.diff

Removed Paths:
-------------
    trunk/dports/graphics/wxWidgets-3.0/files/patch-upstream-nonbundled.diff

Modified: trunk/dports/graphics/wxWidgets-3.0/Portfile
===================================================================
--- trunk/dports/graphics/wxWidgets-3.0/Portfile	2013-11-21 12:25:32 UTC (rev 113630)
+++ trunk/dports/graphics/wxWidgets-3.0/Portfile	2013-11-21 12:28:53 UTC (rev 113631)
@@ -73,9 +73,15 @@
 
 patch.dir           ${worksrcpath}/..
 
-patchfiles-append   patch-configure.diff \
-                    patch-upstream-nonbundled.diff
+patchfiles-append   patch-configure.diff
 
+if {${os.major} > 10} {
+    # the patch doesn't work on 10.5, but it's still better to have working wxWidgets with a flaw
+    # than not bing able to compile it at all
+    patchfiles-append \
+                    patch-src-osx-cocoa-utils.mm.diff
+}
+
 post-patch {
     reinplace "s|@@PREFIX@@|${prefix}|g" ${patch.dir}/configure
 }
@@ -115,11 +121,13 @@
                             rmd160  936858d5856adde043d107164b1b53d3209eb76d \
                             sha256  c892f257b151726a70886c7cffda51554b48b8e9cc7cfcc962d6988c5fe81856
 
-    patchfiles-delete       patch-configure.diff \
-                            patch-upstream-nonbundled.diff
+    patchfiles-delete       patch-configure.diff
     patchfiles-append       patch-configure295.diff \
                             patch-upstream-src-osx-cocoa-textctrl.mm.diff \
                             patch-upstream-src-osx-cocoa-window.mm.diff
+    if {${os.major} > 10} {
+        patchfiles-delete   patch-src-osx-cocoa-utils.mm.diff
+    }
 
     post-destroot {
         # copy a subset of wxPython to wxWidgets to prevent a conflict

Copied: trunk/dports/graphics/wxWidgets-3.0/files/patch-src-osx-cocoa-utils.mm.diff (from rev 113518, trunk/dports/graphics/wxWidgets-3.0/files/patch-upstream-nonbundled.diff)
===================================================================
--- trunk/dports/graphics/wxWidgets-3.0/files/patch-src-osx-cocoa-utils.mm.diff	                        (rev 0)
+++ trunk/dports/graphics/wxWidgets-3.0/files/patch-src-osx-cocoa-utils.mm.diff	2013-11-21 12:28:53 UTC (rev 113631)
@@ -0,0 +1,104 @@
+http://trac.wxwidgets.org/changeset/75142
+
+This patch is in trunk, but not in 3.0.0.
+It also doesn't work on 10.5, so the problem of non-bundled applications still exists on 10.5.
+
+--- src/osx/cocoa/utils.mm.orig
++++ src/osx/cocoa/utils.mm
+@@ -255,6 +255,50 @@ void wxBell()
+ }
+ @end
+ 
++
++// more on bringing non-bundled apps to the foreground
++// https://devforums.apple.com/thread/203753
++
++#if 0
++
++// one possible solution is also quoted here
++// from http://stackoverflow.com/questions/7596643/when-calling-transformprocesstype-the-app-menu-doesnt-show-up
++
++ at interface wxNSNonBundledAppHelper : NSObject {
++
++}
++
+++ (void)transformToForegroundApplication;
++
++ at end
++
++ at implementation wxNSNonBundledAppHelper
++
+++ (void)transformToForegroundApplication {
++    for (NSRunningApplication * app in [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.apple.finder"]) {
++        [app activateWithOptions:NSApplicationActivateIgnoringOtherApps];
++        break;
++    }
++    [self performSelector:@selector(transformStep2) withObject:nil afterDelay:0.1];
++}
++
+++ (void)transformStep2
++{
++    ProcessSerialNumber psn = { 0, kCurrentProcess };
++    (void) TransformProcessType(&psn, kProcessTransformToForegroundApplication);
++
++    [self performSelector:@selector(transformStep3) withObject:nil afterDelay:0.1];
++}
++
+++ (void)transformStep3
++{
++    [[NSRunningApplication currentApplication] activateWithOptions:NSApplicationActivateIgnoringOtherApps];
++}
++
++ at end
++
++#endif
++
+ // here we subclass NSApplication, for the purpose of being able to override sendEvent.
+ @interface wxNSApplication : NSApplication
+ {
+@@ -276,6 +320,24 @@ void wxBell()
+     return self;
+ }
+ 
++- (void) transformToForegroundApplication {
++    ProcessSerialNumber psn = { 0, kCurrentProcess };
++    TransformProcessType(&psn, kProcessTransformToForegroundApplication);
++
++    if ( UMAGetSystemVersion() < 0x1090 )
++    {
++        [self deactivate];
++        [self activateIgnoringOtherApps:YES];
++    }
++    else
++    {
++        [[NSRunningApplication currentApplication] activateWithOptions:
++            (NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)];
++    }
++}
++
++
++
+ /* This is needed because otherwise we don't receive any key-up events for command-key
+  combinations (an AppKit bug, apparently)			*/
+ - (void)sendEvent:(NSEvent *)anEvent
+@@ -311,6 +373,20 @@ bool wxApp::DoInitGui()
+     if (!sm_isEmbedded)
+     {
+         [wxNSApplication sharedApplication];
++
++        if ( OSXIsGUIApplication() )
++        {
++            CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle() ) ;
++            CFStringRef path = CFURLCopyFileSystemPath ( url , kCFURLPOSIXPathStyle ) ;
++            CFRelease( url ) ;
++            wxString app = wxCFStringRef(path).AsString(wxLocale::GetSystemEncoding());
++
++            // workaround is only needed for non-bundled apps
++            if ( !app.EndsWith(".app") )
++            {
++                [(wxNSApplication*) [wxNSApplication sharedApplication] transformToForegroundApplication];
++            }
++        }
+ 
+         appcontroller = OSXCreateAppController();
+         [NSApp setDelegate:appcontroller];

Deleted: trunk/dports/graphics/wxWidgets-3.0/files/patch-upstream-nonbundled.diff
===================================================================
--- trunk/dports/graphics/wxWidgets-3.0/files/patch-upstream-nonbundled.diff	2013-11-21 12:25:32 UTC (rev 113630)
+++ trunk/dports/graphics/wxWidgets-3.0/files/patch-upstream-nonbundled.diff	2013-11-21 12:28:53 UTC (rev 113631)
@@ -1,101 +0,0 @@
-http://trac.wxwidgets.org/changeset/75142
-
---- src/osx/cocoa/utils.mm.orig
-+++ src/osx/cocoa/utils.mm
-@@ -255,6 +255,50 @@ void wxBell()
- }
- @end
- 
-+
-+// more on bringing non-bundled apps to the foreground
-+// https://devforums.apple.com/thread/203753
-+
-+#if 0
-+
-+// one possible solution is also quoted here
-+// from http://stackoverflow.com/questions/7596643/when-calling-transformprocesstype-the-app-menu-doesnt-show-up
-+
-+ at interface wxNSNonBundledAppHelper : NSObject {
-+
-+}
-+
-++ (void)transformToForegroundApplication;
-+
-+ at end
-+
-+ at implementation wxNSNonBundledAppHelper
-+
-++ (void)transformToForegroundApplication {
-+    for (NSRunningApplication * app in [NSRunningApplication runningApplicationsWithBundleIdentifier:@"com.apple.finder"]) {
-+        [app activateWithOptions:NSApplicationActivateIgnoringOtherApps];
-+        break;
-+    }
-+    [self performSelector:@selector(transformStep2) withObject:nil afterDelay:0.1];
-+}
-+
-++ (void)transformStep2
-+{
-+    ProcessSerialNumber psn = { 0, kCurrentProcess };
-+    (void) TransformProcessType(&psn, kProcessTransformToForegroundApplication);
-+
-+    [self performSelector:@selector(transformStep3) withObject:nil afterDelay:0.1];
-+}
-+
-++ (void)transformStep3
-+{
-+    [[NSRunningApplication currentApplication] activateWithOptions:NSApplicationActivateIgnoringOtherApps];
-+}
-+
-+ at end
-+
-+#endif
-+
- // here we subclass NSApplication, for the purpose of being able to override sendEvent.
- @interface wxNSApplication : NSApplication
- {
-@@ -276,6 +320,24 @@ void wxBell()
-     return self;
- }
- 
-+- (void) transformToForegroundApplication {
-+    ProcessSerialNumber psn = { 0, kCurrentProcess };
-+    TransformProcessType(&psn, kProcessTransformToForegroundApplication);
-+
-+    if ( UMAGetSystemVersion() < 0x1090 )
-+    {
-+        [self deactivate];
-+        [self activateIgnoringOtherApps:YES];
-+    }
-+    else
-+    {
-+        [[NSRunningApplication currentApplication] activateWithOptions:
-+            (NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)];
-+    }
-+}
-+
-+
-+
- /* This is needed because otherwise we don't receive any key-up events for command-key
-  combinations (an AppKit bug, apparently)			*/
- - (void)sendEvent:(NSEvent *)anEvent
-@@ -311,6 +373,20 @@ bool wxApp::DoInitGui()
-     if (!sm_isEmbedded)
-     {
-         [wxNSApplication sharedApplication];
-+
-+        if ( OSXIsGUIApplication() )
-+        {
-+            CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle() ) ;
-+            CFStringRef path = CFURLCopyFileSystemPath ( url , kCFURLPOSIXPathStyle ) ;
-+            CFRelease( url ) ;
-+            wxString app = wxCFStringRef(path).AsString(wxLocale::GetSystemEncoding());
-+
-+            // workaround is only needed for non-bundled apps
-+            if ( !app.EndsWith(".app") )
-+            {
-+                [(wxNSApplication*) [wxNSApplication sharedApplication] transformToForegroundApplication];
-+            }
-+        }
- 
-         appcontroller = OSXCreateAppController();
-         [NSApp setDelegate:appcontroller];
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20131121/21fab487/attachment-0001.html>


More information about the macports-changes mailing list