[56844] trunk/dports/x11/xinit
jeremyhu at macports.org
jeremyhu at macports.org
Wed Sep 2 10:49:05 PDT 2009
Revision: 56844
http://trac.macports.org/changeset/56844
Author: jeremyhu at macports.org
Date: 2009-09-02 10:49:05 -0700 (Wed, 02 Sep 2009)
Log Message:
-----------
xinit: Use the new --with-launchd-id-prefix option rather than reinplace-fu
Modified Paths:
--------------
trunk/dports/x11/xinit/Portfile
Added Paths:
-----------
trunk/dports/x11/xinit/files/launchd_prefix.patch
Removed Paths:
-------------
trunk/dports/x11/xinit/files/sl.patch
Modified: trunk/dports/x11/xinit/Portfile
===================================================================
--- trunk/dports/x11/xinit/Portfile 2009-09-02 17:12:31 UTC (rev 56843)
+++ trunk/dports/x11/xinit/Portfile 2009-09-02 17:49:05 UTC (rev 56844)
@@ -4,7 +4,7 @@
name xinit
version 1.1.1
-revision 4
+revision 5
categories x11
platforms darwin
maintainers jeremyhu
@@ -38,19 +38,13 @@
use_autoreconf yes
autoreconf.args -fvi
-patchfiles sl.patch
+patchfiles launchd_prefix.patch
patch.args -p1
-post-patch {
- reinplace "s|org.x|org.macports|" ${worksrcpath}/privileged_startx/org.x.privileged_startx.plist.cpp
- reinplace "s|org.x|org.macports|" ${worksrcpath}/privileged_startx/privileged_startx_types.h
- reinplace "s|org.x|org.macports|" ${worksrcpath}/privileged_startx/server.c
- reinplace "s|org.x|org.macports|" ${worksrcpath}/startx.cpp
-}
+configure.args --with-launchd-id-prefix=org.macports
post-destroot {
- file delete -force ${destroot}/Library/LaunchAgents/org.x.startx.plist
- move ${destroot}/Library/LaunchDaemons/org.x.privileged_startx.plist ${destroot}/Library/LaunchDaemons/org.macports.privileged_startx.plist
+ file delete -force ${destroot}/Library/LaunchAgents/org.macports.startx.plist
xinstall -d ${destroot}${prefix}/lib/X11/xinit/xinitrc.d
eval xinstall -m 755 [glob ${filespath}/xinitrc.d/*.sh] ${destroot}${prefix}/lib/X11/xinit/xinitrc.d
Added: trunk/dports/x11/xinit/files/launchd_prefix.patch
===================================================================
--- trunk/dports/x11/xinit/files/launchd_prefix.patch (rev 0)
+++ trunk/dports/x11/xinit/files/launchd_prefix.patch 2009-09-02 17:49:05 UTC (rev 56844)
@@ -0,0 +1,288 @@
+diff --git xinit-1.1.1/Makefile.am xinit-1.1.1/Makefile.am
+index 0d831f3..a9ae6c1 100644
+--- xinit-1.1.1/Makefile.am
++++ xinit-1.1.1/Makefile.am
+@@ -24,7 +24,7 @@ XINITDIR = $(libdir)/X11/xinit
+ bin_PROGRAMS = xinit
+ bin_SCRIPTS = startx
+
+-xinit_CFLAGS = $(XINIT_CFLAGS) -DXINITDIR=\"$(XINITDIR)\" -DBINDIR=\"$(bindir)\"
++AM_CFLAGS = $(XINIT_CFLAGS) -DXINITDIR=\"$(XINITDIR)\" -DBINDIR=\"$(bindir)\"
+ xinit_LDADD = $(XINIT_LIBS)
+
+ xinit_SOURCES = \
+@@ -56,10 +56,14 @@ CPP_FILES_FLAGS = \
+ -DXINITDIR=$(XINITDIR) $(PROGCPPDEFS) -DLIBDIR=$(libdir) \
+ -DSHELL_CMD=$(SHELL_CMD) $(STARTX_COOKIE_FLAGS) \
+ -D__libexecdir__="$(libexecdir)" \
+- -D__bindir__="$(bindir)"
++ -D__bindir__="$(bindir)" \
++ -DLAUNCHD_ID_PREFIX=\"$(launchdidprefix)\"
+
+ if LAUNCHD
+-launchagents_PRE = org.x.startx.plist.cpp
++$(launchdidprefix).startx.plist.cpp: org.x.startx.plist.cpp
++ cp $< $@
++
++launchagents_PRE = $(launchdidprefix).startx.plist.cpp
+ launchagents_DATA = $(launchagents_PRE:plist.cpp=plist)
+
+ SUBDIRS = privileged_startx
+@@ -77,6 +81,6 @@ EXTRA_DIST = xinitrc.cpp startx.cpp org.x.startx.plist.cpp $(appman_PRE) \
+ .PHONY: ChangeLog
+
+ ChangeLog:
+- (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
++ $(CHANGELOG_CMD)
+
+ dist-hook: ChangeLog
+diff --git xinit-1.1.1/configure.ac xinit-1.1.1/configure.ac
+index 78b8827..7f354f9 100644
+--- xinit-1.1.1/configure.ac
++++ xinit-1.1.1/configure.ac
+@@ -25,6 +25,10 @@ AC_INIT(xinit,[1.1.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]
+ AM_INIT_AUTOMAKE([dist-bzip2])
+ AM_MAINTAINER_MODE
+
++# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
++m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
++XORG_MACROS_VERSION(1.2)
++
+ AM_CONFIG_HEADER(config.h)
+
+ AC_PROG_CC
+@@ -41,6 +45,8 @@ AC_CHECK_FUNCS([killpg])
+
+ m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
+
++XORG_CWARNFLAGS
++
+ # Build options
+ DEFAULT_XRDB=xrdb
+ DEFAULT_XMODMAP=xmodmap
+@@ -99,6 +105,9 @@ AC_ARG_WITH(launchagents-dir, AS_HELP_STRING([--with-launchagents-dir=PATH], [
+ AC_ARG_WITH(launchdaemons-dir, AS_HELP_STRING([--with-launchdaemons-dir=PATH], [Path to launchd's LaunchDaemonss directory (default: /Library/LaunchDaemons)]),
+ [ launchdaemonsdir="${withval}" ],
+ [ launchdaemonsdir="/Library/LaunchDaemons" ])
++AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Prefix to use for launchd identifiers (default: org.x)]),
++ [ launchdidprefix="${withval}" ],
++ [ launchdidprefix="org.x" ])
+
+ if test "x$LAUNCHD" = "xauto"; then
+ unset LAUNCHD
+@@ -117,8 +126,11 @@ else
+ launchagentsdir=""
+ launchdaemonsdir=""
+ fi
++
++AC_DEFINE_UNQUOTED(LAUNCHD_ID_PREFIX, "$launchdidprefix", [Prefix to use for launchd identifiers])
+ AC_SUBST([launchagentsdir])
+ AC_SUBST([launchdaemonsdir])
++AC_SUBST([launchdidprefix])
+ AM_CONDITIONAL(LAUNCHD, [test "x$LAUNCHD" = "xyes"])
+ AM_CONDITIONAL(TIGER_LAUNCHD, [test "x$TIGER_LAUNCHD" = "xyes"])
+
+@@ -131,6 +143,7 @@ case $host_os in
+ ;;
+ esac
+
++XINIT_CFLAGS="$CWARNFLAGS $XINIT_CFLAGS"
+ AC_SUBST(XINIT_CFLAGS)
+ AC_SUBST(XINIT_LIBS)
+
+@@ -184,6 +197,7 @@ AC_DEFINE(XORG, 1, [Define if you have Xorg X server])
+
+ XORG_MANPAGE_SECTIONS
+ XORG_RELEASE_VERSION
++XORG_CHANGELOG
+
+ AC_OUTPUT([Makefile])
+ AC_OUTPUT([privileged_startx/Makefile])
+diff --git xinit-1.1.1/privileged_startx/Makefile.am xinit-1.1.1/privileged_startx/Makefile.am
+index 2d68544..453f6e7 100644
+--- xinit-1.1.1/privileged_startx/Makefile.am
++++ xinit-1.1.1/privileged_startx/Makefile.am
+@@ -34,7 +34,7 @@ xinitrc_PROGRAMS = privileged_startx
+ privstartx_SCRIPTS = 10-tmpdirs 20-font_cache
+
+ AM_CPPFLAGS = -DXINITDIR=\"$(xinitrcdir)\" -DSCRIPTDIR=\"$(privstartxdir)\" -DBINDIR=\"$(bindir)\"
+-CPP_FILES_FLAGS = -DXINITDIR="$(xinitrcdir)" -DSCRIPTDIR="$(privstartxdir)" -DBINDIR="$(bindir)"
++CPP_FILES_FLAGS = -DXINITDIR="$(xinitrcdir)" -DSCRIPTDIR="$(privstartxdir)" -DBINDIR="$(bindir)" -DLAUNCHD_ID_PREFIX="$(launchdidprefix)"
+
+ if TIGER_LAUNCHD
+ CPP_FILES_FLAGS += -DTIGER_LAUNCHD
+@@ -55,7 +55,10 @@ BUILT_SOURCES = \
+ privileged_startxServer.h \
+ privileged_startx.h
+
+-launchdaemons_PRE = org.x.privileged_startx.plist.cpp
++$(launchdidprefix).privileged_startx.plist.cpp: org.x.privileged_startx.plist.cpp
++ cp $< $@
++
++launchdaemons_PRE = $(launchdidprefix).privileged_startx.plist.cpp
+ launchdaemons_DATA = $(launchdaemons_PRE:plist.cpp=plist)
+
+ 10-tmpdirs: 10-tmpdirs.cpp Makefile
+diff --git xinit-1.1.1/privileged_startx/org.x.privileged_startx.plist.cpp xinit-1.1.1/privileged_startx/org.x.privileged_startx.plist.cpp
+index 7400cc4..02e1cce 100644
+--- xinit-1.1.1/privileged_startx/org.x.privileged_startx.plist.cpp
++++ xinit-1.1.1/privileged_startx/org.x.privileged_startx.plist.cpp
+@@ -3,7 +3,7 @@
+ <plist version="1.0">
+ <dict>
+ <key>Label</key>
+- <string>org.x.privileged_startx</string>
++ <string>LAUNCHD_ID_PREFIX.privileged_startx</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>XINITDIR/privileged_startx</string>
+@@ -16,7 +16,7 @@
+ #else
+ <key>MachServices</key>
+ <dict>
+- <key>org.x.privileged_startx</key>
++ <key>LAUNCHD_ID_PREFIX.privileged_startx</key>
+ <true/>
+ </dict>
+ <key>TimeOut</key>
+diff --git xinit-1.1.1/privileged_startx/privileged_startx_types.h xinit-1.1.1/privileged_startx/privileged_startx_types.h
+index fef7195..8928e64 100644
+--- xinit-1.1.1/privileged_startx/privileged_startx_types.h
++++ xinit-1.1.1/privileged_startx/privileged_startx_types.h
+@@ -1,6 +1,10 @@
+ #ifndef _PRIV_STARTX_TYPES_H_
+ #define _PRIV_STARTX_TYPES_H_
+
+-#define BOOTSTRAP_NAME "org.x.privileged_startx"
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#define BOOTSTRAP_NAME LAUNCHD_ID_PREFIX".privileged_startx"
+
+ #endif
+diff --git xinit-1.1.1/privileged_startx/server.c xinit-1.1.1/privileged_startx/server.c
+index 6dd4f2b..ee508db 100644
+--- xinit-1.1.1/privileged_startx/server.c
++++ xinit-1.1.1/privileged_startx/server.c
+@@ -26,6 +26,10 @@
+ * prior written authorization.
+ */
+
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
+ #include <mach/mach.h>
+ #include <mach/mach_error.h>
+ #include <servers/bootstrap.h>
+@@ -153,7 +157,7 @@ int server_main(const char *dir) {
+
+ mp = launch_data_get_machport(svc);
+ #else
+- mp = checkin_or_register("org.x.privileged_startx");
++ mp = checkin_or_register(LAUNCHD_ID_PREFIX".privileged_startx");
+ #endif
+
+ if (mp == MACH_PORT_NULL) {
+diff --git xinit-1.1.1/startx.cpp xinit-1.1.1/startx.cpp
+index 8a44965..664f120 100644
+--- xinit-1.1.1/startx.cpp
++++ xinit-1.1.1/startx.cpp
+@@ -85,7 +85,7 @@ serverargs=""
+ #ifdef __APPLE__
+
+ if [ "x$X11_PREFS_DOMAIN" = x ] ; then
+- X11_PREFS_DOMAIN="org.x.X11"
++ X11_PREFS_DOMAIN=LAUNCHD_ID_PREFIX".X11"
+ fi
+
+ XCOMM Initialize defaults (this will cut down on "safe" error messages)
+@@ -162,13 +162,13 @@ while [ x"$1" != x ]; do
+ XCOMM '' required to prevent cpp from treating "/*" as a C comment.
+ /''*|\./''*)
+ if [ "$whoseargs" = "client" ]; then
+- if [ x"$clientargs" = x ]; then
++ if [ x"$client" = x ] && [ x"$clientargs" = x ]; then
+ client="$1"
+ else
+ clientargs="$clientargs $1"
+ fi
+ else
+- if [ x"$serverargs" = x ]; then
++ if [ x"$server" = x ] && [ x"$serverargs" = x ]; then
+ server="$1"
+ else
+ serverargs="$serverargs $1"
+@@ -279,7 +279,7 @@ if [ x"$enable_xauth" = x1 ] ; then
+ xauth -q -f "$xserverauthfile" << EOF
+ add :$dummy . $mcookie
+ EOF
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__CYGWIN__)
+ serverargs=${serverargs}" -auth '"${xserverauthfile}"'"
+ #else
+ serverargs=${serverargs}" -auth "${xserverauthfile}
+@@ -313,13 +313,14 @@ else
+ fi
+ #else
+
+-#ifdef __APPLE__
++#if defined(__APPLE__) || defined(__CYGWIN__)
+ eval XINIT \"$client\" $clientargs -- \"$server\" $display $serverargs
+ #else
+ XINIT "$client" $clientargs -- "$server" $display $serverargs
+ #endif
+
+ #endif
++retval=$?
+
+ if [ x"$enable_xauth" = x1 ] ; then
+ if [ x"$removelist" != x ]; then
+@@ -347,3 +348,6 @@ screenrestore
+ #if defined(sun)
+ kbd_mode -a
+ #endif
++
++exit $retval
++
+diff --git xinit-1.1.1/xinit.c xinit-1.1.1/xinit.c
+index d25de9d..814d286 100644
+--- xinit-1.1.1/xinit.c
++++ xinit-1.1.1/xinit.c
+@@ -62,7 +62,7 @@ in this Software without prior written authorization from The Open Group.
+
+ #ifdef __APPLE__
+ #include <AvailabilityMacros.h>
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
+ #include <vproc.h>
+ #endif
+ #endif
+@@ -258,7 +258,7 @@ main(int argc, char *argv[], char *envp[])
+ int start_of_client_args, start_of_server_args;
+ struct sigaction sa;
+ #ifdef __APPLE__
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
+ vproc_transaction_t vt;
+ #endif
+ #endif
+@@ -440,7 +440,7 @@ main(int argc, char *argv[], char *envp[])
+ signal(SIGUSR1, sigUsr1);
+
+ #ifdef __APPLE__
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
+ vt = vproc_transaction_begin(NULL);
+ #endif
+ #endif
+@@ -455,7 +455,7 @@ main(int argc, char *argv[], char *envp[])
+ }
+
+ #ifdef __APPLE__
+-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
+ vproc_transaction_end(NULL, vt);
+ #endif
+ #endif
Deleted: trunk/dports/x11/xinit/files/sl.patch
===================================================================
--- trunk/dports/x11/xinit/files/sl.patch 2009-09-02 17:12:31 UTC (rev 56843)
+++ trunk/dports/x11/xinit/files/sl.patch 2009-09-02 17:49:05 UTC (rev 56844)
@@ -1,139 +0,0 @@
-diff --git xinit-1.1.1/Makefile.am xinit-1.1.1/Makefile.am
-index 0d831f3..951d51a 100644
---- xinit-1.1.1/Makefile.am
-+++ xinit-1.1.1/Makefile.am
-@@ -24,7 +24,7 @@ XINITDIR = $(libdir)/X11/xinit
- bin_PROGRAMS = xinit
- bin_SCRIPTS = startx
-
--xinit_CFLAGS = $(XINIT_CFLAGS) -DXINITDIR=\"$(XINITDIR)\" -DBINDIR=\"$(bindir)\"
-+AM_CFLAGS = $(XINIT_CFLAGS) -DXINITDIR=\"$(XINITDIR)\" -DBINDIR=\"$(bindir)\"
- xinit_LDADD = $(XINIT_LIBS)
-
- xinit_SOURCES = \
-@@ -77,6 +77,6 @@ EXTRA_DIST = xinitrc.cpp startx.cpp org.x.startx.plist.cpp $(appman_PRE) \
- .PHONY: ChangeLog
-
- ChangeLog:
-- (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
-+ $(CHANGELOG_CMD)
-
- dist-hook: ChangeLog
-diff --git xinit-1.1.1/configure.ac xinit-1.1.1/configure.ac
-index 78b8827..7e2fb82 100644
---- xinit-1.1.1/configure.ac
-+++ xinit-1.1.1/configure.ac
-@@ -25,6 +25,10 @@ AC_INIT(xinit,[1.1.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]
- AM_INIT_AUTOMAKE([dist-bzip2])
- AM_MAINTAINER_MODE
-
-+# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
-+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
-+XORG_MACROS_VERSION(1.2)
-+
- AM_CONFIG_HEADER(config.h)
-
- AC_PROG_CC
-@@ -41,6 +45,8 @@ AC_CHECK_FUNCS([killpg])
-
- m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])
-
-+XORG_CWARNFLAGS
-+
- # Build options
- DEFAULT_XRDB=xrdb
- DEFAULT_XMODMAP=xmodmap
-@@ -131,6 +137,7 @@ case $host_os in
- ;;
- esac
-
-+XINIT_CFLAGS="$CWARNFLAGS $XINIT_CFLAGS"
- AC_SUBST(XINIT_CFLAGS)
- AC_SUBST(XINIT_LIBS)
-
-@@ -184,6 +191,7 @@ AC_DEFINE(XORG, 1, [Define if you have Xorg X server])
-
- XORG_MANPAGE_SECTIONS
- XORG_RELEASE_VERSION
-+XORG_CHANGELOG
-
- AC_OUTPUT([Makefile])
- AC_OUTPUT([privileged_startx/Makefile])
-diff --git xinit-1.1.1/startx.cpp xinit-1.1.1/startx.cpp
-index 8a44965..943fa78 100644
---- xinit-1.1.1/startx.cpp
-+++ xinit-1.1.1/startx.cpp
-@@ -162,13 +162,13 @@ while [ x"$1" != x ]; do
- XCOMM '' required to prevent cpp from treating "/*" as a C comment.
- /''*|\./''*)
- if [ "$whoseargs" = "client" ]; then
-- if [ x"$clientargs" = x ]; then
-+ if [ x"$client" = x ] && [ x"$clientargs" = x ]; then
- client="$1"
- else
- clientargs="$clientargs $1"
- fi
- else
-- if [ x"$serverargs" = x ]; then
-+ if [ x"$server" = x ] && [ x"$serverargs" = x ]; then
- server="$1"
- else
- serverargs="$serverargs $1"
-@@ -279,7 +279,7 @@ if [ x"$enable_xauth" = x1 ] ; then
- xauth -q -f "$xserverauthfile" << EOF
- add :$dummy . $mcookie
- EOF
--#ifdef __APPLE__
-+#if defined(__APPLE__) || defined(__CYGWIN__)
- serverargs=${serverargs}" -auth '"${xserverauthfile}"'"
- #else
- serverargs=${serverargs}" -auth "${xserverauthfile}
-@@ -313,7 +313,7 @@ else
- fi
- #else
-
--#ifdef __APPLE__
-+#if defined(__APPLE__) || defined(__CYGWIN__)
- eval XINIT \"$client\" $clientargs -- \"$server\" $display $serverargs
- #else
- XINIT "$client" $clientargs -- "$server" $display $serverargs
-diff --git xinit-1.1.1/xinit.c xinit-1.1.1/xinit.c
-index d25de9d..814d286 100644
---- xinit-1.1.1/xinit.c
-+++ xinit-1.1.1/xinit.c
-@@ -62,7 +62,7 @@ in this Software without prior written authorization from The Open Group.
-
- #ifdef __APPLE__
- #include <AvailabilityMacros.h>
--#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
- #include <vproc.h>
- #endif
- #endif
-@@ -258,7 +258,7 @@ main(int argc, char *argv[], char *envp[])
- int start_of_client_args, start_of_server_args;
- struct sigaction sa;
- #ifdef __APPLE__
--#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
- vproc_transaction_t vt;
- #endif
- #endif
-@@ -440,7 +440,7 @@ main(int argc, char *argv[], char *envp[])
- signal(SIGUSR1, sigUsr1);
-
- #ifdef __APPLE__
--#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
- vt = vproc_transaction_begin(NULL);
- #endif
- #endif
-@@ -455,7 +455,7 @@ main(int argc, char *argv[], char *envp[])
- }
-
- #ifdef __APPLE__
--#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
-+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
- vproc_transaction_end(NULL, vt);
- #endif
- #endif
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090902/726f6219/attachment-0001.html>
More information about the macports-changes
mailing list