[82088] trunk/dports/devel/allegro
jmr at macports.org
jmr at macports.org
Sun Aug 7 10:23:54 PDT 2011
Revision: 82088
http://trac.macports.org/changeset/82088
Author: jmr at macports.org
Date: 2011-08-07 10:23:53 -0700 (Sun, 07 Aug 2011)
Log Message:
-----------
allegro: fix detection and handling of lack of GUI session
Modified Paths:
--------------
trunk/dports/devel/allegro/Portfile
Added Paths:
-----------
trunk/dports/devel/allegro/files/patch-main.m.diff
trunk/dports/devel/allegro/files/patch-system.m.diff
Modified: trunk/dports/devel/allegro/Portfile
===================================================================
--- trunk/dports/devel/allegro/Portfile 2011-08-07 17:21:43 UTC (rev 82087)
+++ trunk/dports/devel/allegro/Portfile 2011-08-07 17:23:53 UTC (rev 82088)
@@ -23,6 +23,8 @@
sha1 ae0c15d2cb6b0337ef388dc98cefc620883720df \
rmd160 a6f6a03d6748230dfb5f306d1a05ef45ffa49f42
+patchfiles patch-main.m.diff patch-system.m.diff
+
configure.args-append -DINFODIR=share/info -DDOCDIR=share/doc
post-destroot {
Added: trunk/dports/devel/allegro/files/patch-main.m.diff
===================================================================
--- trunk/dports/devel/allegro/files/patch-main.m.diff (rev 0)
+++ trunk/dports/devel/allegro/files/patch-main.m.diff 2011-08-07 17:23:53 UTC (rev 82088)
@@ -0,0 +1,15 @@
+--- src/macosx/main.m.orig 2009-11-22 12:32:27.000000000 +1100
++++ src/macosx/main.m 2011-08-08 03:08:54.000000000 +1000
+@@ -269,8 +269,11 @@ int main(int argc, char *argv[])
+ __crt0_argc = argc;
+ __crt0_argv = argv;
+
+- if (!osx_bootstrap_ok()) /* not safe to use NSApplication */
++ if (!osx_bootstrap_ok()) {
++ /* not safe to use NSApplication */
+ call_user_main();
++ return 0;
++ }
+
+ [NSApplication sharedApplication];
+
Added: trunk/dports/devel/allegro/files/patch-system.m.diff
===================================================================
--- trunk/dports/devel/allegro/files/patch-system.m.diff (rev 0)
+++ trunk/dports/devel/allegro/files/patch-system.m.diff 2011-08-07 17:23:53 UTC (rev 82088)
@@ -0,0 +1,31 @@
+--- src/macosx/system.m.orig 2009-11-22 12:17:42.000000000 +1100
++++ src/macosx/system.m 2011-08-08 01:01:52.000000000 +1000
+@@ -386,13 +386,26 @@ int osx_bootstrap_ok(void)
+ mach_port_t bp;
+ kern_return_t ret;
+ CFMachPortRef cfport;
++ CFDictionaryRef sessiondict;
+
+ /* If have tested once, just return that answer */
+ if (_ok >= 0)
+ return _ok;
++ /* check for window server session */
++ sessiondict = CGSessionCopyCurrentDictionary();
++ if (!sessiondict) {
++ return (_ok = 0);
++ } else {
++ CFRelease(sessiondict);
++ }
++
+ cfport = CFMachPortCreate(NULL, NULL, NULL, NULL);
+- task_get_bootstrap_port(mach_task_self(), &bp);
+- ret = bootstrap_register(bp, "bootstrap-ok-test", CFMachPortGetPort(cfport));
++ if (!cfport)
++ return (_ok = 0);
++ ret = task_get_bootstrap_port(mach_task_self(), &bp);
++ if (ret == ERR_SUCCESS) {
++ ret = bootstrap_register(bp, "bootstrap-ok-test", CFMachPortGetPort(cfport));
++ }
+ CFRelease(cfport);
+ _ok = (ret == KERN_SUCCESS) ? 1 : 0;
+ return _ok;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110807/646232d7/attachment-0001.html>
More information about the macports-changes
mailing list