[81481] trunk/dports/x11/xinit
jeremyhu at macports.org
jeremyhu at macports.org
Sun Jul 31 09:13:12 PDT 2011
Revision: 81481
http://trac.macports.org/changeset/81481
Author: jeremyhu at macports.org
Date: 2011-07-31 09:13:12 -0700 (Sun, 31 Jul 2011)
Log Message:
-----------
xinit: Build fix for Tiger, #30483
Modified Paths:
--------------
trunk/dports/x11/xinit/Portfile
Added Paths:
-----------
trunk/dports/x11/xinit/files/0001-darwin-Buildfix-for-Tiger-which-doesn-t-have-posix_s.patch
Modified: trunk/dports/x11/xinit/Portfile
===================================================================
--- trunk/dports/x11/xinit/Portfile 2011-07-31 16:08:41 UTC (rev 81480)
+++ trunk/dports/x11/xinit/Portfile 2011-07-31 16:13:12 UTC (rev 81481)
@@ -31,6 +31,10 @@
depends_lib port:xorg-libX11
+patchfiles \
+ 0001-darwin-Buildfix-for-Tiger-which-doesn-t-have-posix_s.patch
+patch.pre_args -p1
+
configure.args --with-launchd-id-prefix=org.macports
configure.args-append RAWCPP=${configure.cpp}
Added: trunk/dports/x11/xinit/files/0001-darwin-Buildfix-for-Tiger-which-doesn-t-have-posix_s.patch
===================================================================
--- trunk/dports/x11/xinit/files/0001-darwin-Buildfix-for-Tiger-which-doesn-t-have-posix_s.patch (rev 0)
+++ trunk/dports/x11/xinit/files/0001-darwin-Buildfix-for-Tiger-which-doesn-t-have-posix_s.patch 2011-07-31 16:13:12 UTC (rev 81481)
@@ -0,0 +1,58 @@
+From 727706ffda344a1a752df296cd230ff3fb3940a5 Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston <jeremyhu at apple.com>
+Date: Sun, 31 Jul 2011 09:11:01 -0700
+Subject: [PATCH] darwin: Buildfix for Tiger which doesn't have posix_spawn
+
+Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
+---
+ launchd/user_startx/launchd_startx.c | 22 +++++++++++++++++++++-
+ 1 files changed, 21 insertions(+), 1 deletions(-)
+
+diff --git a/launchd/user_startx/launchd_startx.c b/launchd/user_startx/launchd_startx.c
+index e3fae76..f83cd61 100644
+--- a/launchd/user_startx/launchd_startx.c
++++ b/launchd/user_startx/launchd_startx.c
+@@ -34,11 +34,19 @@
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <assert.h>
+-#include <spawn.h>
+ #include <sys/wait.h>
+ #include <string.h>
+ #include <stdlib.h>
+
++/* Using MIN_REQUIRED instead of MAX_ALLOWED logic due to posix_spawn not
++ * being marked with availability macros until 10.7
++ */
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
++#include <spawn.h>
++#else
++#include <errno.h>
++#endif
++
+ #include "console_redirect.h"
+
+ int main(int argc, char **argv, char **envp) {
+@@ -56,7 +64,19 @@ int main(int argc, char **argv, char **envp) {
+ xi_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO);
+ xi_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO);
+
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
+ assert(posix_spawnp(&child, argv[1], NULL, NULL, &argv[1], envp) == 0);
++#else
++ switch(child = fork()) {
++ case -1:
++ perror("fork");
++ return errno;
++ case 0:
++ return execvp(argv[1], &argv[1]);
++ default:
++ break;
++ }
++#endif
+
+ wait4(child, &pstat, 0, (struct rusage *)0);
+
+--
+1.7.6
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110731/ccdacc45/attachment.html>
More information about the macports-changes
mailing list