[45746] trunk/dports/sysutils/screen
digdog at macports.org
digdog at macports.org
Tue Jan 20 22:20:51 PST 2009
Revision: 45746
http://trac.macports.org/changeset/45746
Author: digdog at macports.org
Date: 2009-01-20 22:20:49 -0800 (Tue, 20 Jan 2009)
Log Message:
-----------
1. Add +universal support (build ok, x86 execute ok, ppc execute notsure)
2. Apply Apple's screen patches (should fix screen breaks after logoff/logon on leopard)
3. #2 included Apple's private header file from launchd, copied from launchd.macosforge.org
4. Remove old osdef.h.in patch
Modified Paths:
--------------
trunk/dports/sysutils/screen/Portfile
Added Paths:
-----------
trunk/dports/sysutils/screen/files/patch-Makefile.in
trunk/dports/sysutils/screen/files/patch-config.h.in
trunk/dports/sysutils/screen/files/patch-configure
trunk/dports/sysutils/screen/files/patch-screen.c
trunk/dports/sysutils/screen/files/patch-window.c
Removed Paths:
-------------
trunk/dports/sysutils/screen/files/patch-osdef.h.in
Modified: trunk/dports/sysutils/screen/Portfile
===================================================================
--- trunk/dports/sysutils/screen/Portfile 2009-01-21 04:52:22 UTC (rev 45745)
+++ trunk/dports/sysutils/screen/Portfile 2009-01-21 06:20:49 UTC (rev 45746)
@@ -4,7 +4,7 @@
name screen
version 4.0.3
-revision 1
+revision 2
homepage http://www.gnu.org/software/screen/
description Screen manager with VT100/ANSI terminal emulation
long_description Screen is a full-screen window manager that multiplexes a physical \
@@ -22,15 +22,13 @@
ftp://ftp.uni-erlangen.de/pub/utilities/screen/ \
http://www.cis.nctu.edu.tw/~is85005/dports/screen/:encoding
-universal_variant no
-
# The file '18' above is a fix for UTF8-to-Big5HKSCS encoding translation.
# Reference: http://freebsd.sinica.edu.tw/~statue/index.php?file=20020513
distfiles-append 18:encoding
checksums ${distname}${extract.suffix} md5 8506fd205028a96c741e4037de6e3c42 \
18 md5 e5c53546a5c4968bd7e807c88e6b2198
-patchfiles patch-maxargs patch-windowsize patch-pty.c patch-wrp_vertical_split
+patchfiles patch-maxargs patch-windowsize patch-wrp_vertical_split
depends_lib port:ncurses
extract.only ${distname}${extract.suffix}
@@ -50,7 +48,16 @@
system "tic ${workpath}/${distname}/terminfo/screeninfo.src"
}
-platform darwin { patchfiles-append patch-osdef.h.in }
+platform darwin {
+ # These patches are based on http://www.opensource.apple.com/darwinsource/10.5.6/screen-12/patches/
+ # The vproc_priv.h is the private header from launchd, used in Apple's screen patches
+ # We copied the header file from http://launchd.macosforge.org/trac/browser/trunk/launchd/src/vproc_priv.h, r23776
+ master_sites-append http://www.cis.nctu.edu.tw/~is85005/dports/screen/r23776/:launchd_priv_header
+ distfiles-append vproc_priv.h:launchd_priv_header
+ checksums-append vproc_priv.h md5 50800817fa688e7e6ae379cd599f15ca
+ post-extract { file copy ${distpath}/vproc_priv.h ${workpath}/${distname} }
+ patchfiles-append patch-Makefile.in patch-config.h.in patch-configure patch-pty.c patch-window.c patch-screen.c
+}
post-install {
ui_msg "===============================================================================\n"
Added: trunk/dports/sysutils/screen/files/patch-Makefile.in
===================================================================
--- trunk/dports/sysutils/screen/files/patch-Makefile.in (rev 0)
+++ trunk/dports/sysutils/screen/files/patch-Makefile.in 2009-01-21 06:20:49 UTC (rev 45746)
@@ -0,0 +1,11 @@
+--- Makefile.in.orig 2009-01-21 11:55:43.000000000 +0800
++++ Makefile.in 2009-01-21 11:56:33.000000000 +0800
+@@ -122,7 +122,7 @@
+ sh $(srcdir)/tty.sh tty.c
+
+ comm.h: comm.c comm.sh config.h
+- AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
++ AWK=$(AWK) srcdir=${srcdir} sh $(srcdir)/comm.sh
+
+ osdef.h: osdef.sh config.h osdef.h.in
+ CPP="$(CPP) $(CPPFLAGS)" srcdir=${srcdir} sh $(srcdir)/osdef.sh
Added: trunk/dports/sysutils/screen/files/patch-config.h.in
===================================================================
--- trunk/dports/sysutils/screen/files/patch-config.h.in (rev 0)
+++ trunk/dports/sysutils/screen/files/patch-config.h.in 2009-01-21 06:20:49 UTC (rev 45746)
@@ -0,0 +1,28 @@
+--- config.h.in.orig 2009-01-21 11:58:54.000000000 +0800
++++ config.h.in 2009-01-21 12:01:53.000000000 +0800
+@@ -208,14 +208,14 @@
+ * If screen is installed with permissions to update /etc/utmp (such
+ * as if it is installed set-uid root), define UTMPOK.
+ */
+-#define UTMPOK
++#undef UTMPOK
+
+ /* Set LOGINDEFAULT to one (1)
+ * if you want entries added to /etc/utmp by default, else set it to
+ * zero (0).
+ * LOGINDEFAULT will be one (1) whenever LOGOUTOK is undefined!
+ */
+-#define LOGINDEFAULT 1
++#undef LOGINDEFAULT
+
+ /* Set LOGOUTOK to one (1)
+ * if you want the user to be able to log her/his windows out.
+@@ -231,7 +231,7 @@
+ * Set CAREFULUTMP to one (1) if you want that users have at least one
+ * window per screen session logged in.
+ */
+-#define LOGOUTOK 1
++#undef LOGOUTOK
+ #undef CAREFULUTMP
+
+
Added: trunk/dports/sysutils/screen/files/patch-configure
===================================================================
--- trunk/dports/sysutils/screen/files/patch-configure (rev 0)
+++ trunk/dports/sysutils/screen/files/patch-configure 2009-01-21 06:20:49 UTC (rev 45746)
@@ -0,0 +1,22 @@
+--- configure.orig 2009-01-21 12:02:42.000000000 +0800
++++ configure 2009-01-21 12:04:58.000000000 +0800
+@@ -5572,7 +5572,7 @@
+
+ #include <time.h> /* to get time_t on SCO */
+ #include <sys/types.h>
+-#if defined(SVR4) && !defined(DGUX)
++#if (defined(SVR4) || defined(__APPLE__)) && !defined(DGUX)
+ #include <utmpx.h>
+ #define utmp utmpx
+ #else
+@@ -5581,6 +5581,10 @@
+ #ifdef __hpux
+ #define pututline _pututline
+ #endif
++#ifdef __APPLE__
++#define pututline pututxline
++#define getutent getutxent
++#endif
+
+ int
+ main ()
Deleted: trunk/dports/sysutils/screen/files/patch-osdef.h.in
===================================================================
--- trunk/dports/sysutils/screen/files/patch-osdef.h.in 2009-01-21 04:52:22 UTC (rev 45745)
+++ trunk/dports/sysutils/screen/files/patch-osdef.h.in 2009-01-21 06:20:49 UTC (rev 45746)
@@ -1,68 +0,0 @@
---- osdef.h.in Tue Oct 29 23:22:33 2002
-+++ osdef.h.in.dports Tue Oct 29 23:37:25 2002
-@@ -87,16 +87,16 @@
- extern int setresuid __P((int, int, int));
- extern int setresgid __P((int, int, int));
- # else
--extern int setreuid __P((int, int));
--extern int setregid __P((int, int));
-+extern int setreuid __P((uid_t, uid_t));
-+extern int setregid __P((gid_t, gid_t));
- # endif
- #endif
- #ifdef HAVE_SETEUID
--extern int seteuid __P((int));
--extern int setegid __P((int));
-+extern int seteuid __P((uid_t));
-+extern int setegid __P((gid_t));
- #endif
-
--extern char *crypt __P((char *, char *));
-+extern char *crypt __P((const char *, const char *));
- extern int putenv __P((char *));
-
- extern int tgetent __P((char *, char *));
-@@ -115,26 +115,26 @@
-
- extern int kill __P((int, int));
-
--extern int getpid __P((void));
--extern int getuid __P((void));
--extern int geteuid __P((void));
--extern int getgid __P((void));
--extern int getegid __P((void));
-+extern pid_t getpid __P((void));
-+extern uid_t getuid __P((void));
-+extern uid_t geteuid __P((void));
-+extern gid_t getgid __P((void));
-+extern gid_t getegid __P((void));
- struct passwd; /* for getpwuid __P */
- extern struct passwd *getpwuid __P((int));
- extern struct passwd *getpwnam __P((char *));
- extern int isatty __P((int));
--extern int chown __P((char *, int, int));
-+extern int chown __P((const char *, uid_t, gid_t));
- extern int rename __P((char *, char *));
-
- extern int gethostname __P((char *, int));
--extern int lseek __P((int, int, int));
-+extern off_t lseek __P((int, off_t, int));
- extern void exit __P((int));
- extern char *getwd __P((char *));
- extern char *getenv __P((char *));
- extern time_t time __P((time_t *));
-
--extern char *getpass __P((char *));
-+extern char *getpass __P((const char *));
- extern char *getlogin __P((void));
- extern char *ttyname __P((int));
-
-@@ -148,7 +148,7 @@
- extern void free __P((char *));
-
- #ifdef NAMEDPIPE
--extern int mknod __P((char *, int, int));
-+extern int mknod __P((const char *, mode_t, dev_t));
- #else
- struct sockaddr; /* for connect __P */
- extern int socket __P((int, int, int));
Added: trunk/dports/sysutils/screen/files/patch-screen.c
===================================================================
--- trunk/dports/sysutils/screen/files/patch-screen.c (rev 0)
+++ trunk/dports/sysutils/screen/files/patch-screen.c 2009-01-21 06:20:49 UTC (rev 45746)
@@ -0,0 +1,26 @@
+--- screen.c.orig 2009-01-21 12:06:11.000000000 +0800
++++ screen.c 2009-01-21 12:08:27.000000000 +0800
+@@ -101,6 +101,11 @@
+
+ #include "logfile.h" /* islogfile, logfflush */
+
++#ifdef __APPLE__
++#include <vproc.h>
++#include "vproc_priv.h"
++#endif
++
+ #ifdef DEBUG
+ FILE *dfp;
+ #endif
+@@ -1211,6 +1216,11 @@
+ freopen("/dev/null", "w", stderr);
+ debug("-- screen.back debug started\n");
+
++#ifdef __APPLE__
++ if (_vprocmgr_move_subset_to_user(real_uid, "Background") != NULL)
++ errx(1, "can't migrate to background session");
++#endif
++
+ /*
+ * This guarantees that the session owner is listed, even when we
+ * start detached. From now on we should not refer to 'LoginName'
Added: trunk/dports/sysutils/screen/files/patch-window.c
===================================================================
--- trunk/dports/sysutils/screen/files/patch-window.c (rev 0)
+++ trunk/dports/sysutils/screen/files/patch-window.c 2009-01-21 06:20:49 UTC (rev 45746)
@@ -0,0 +1,49 @@
+--- window.c.orig 2009-01-21 12:09:29.000000000 +0800
++++ window.c 2009-01-21 12:14:04.000000000 +0800
+@@ -25,6 +25,7 @@
+ #include <sys/stat.h>
+ #include <signal.h>
+ #include <fcntl.h>
++#include <unistd.h>
+ #ifndef sun
+ # include <sys/ioctl.h>
+ #endif
+@@ -1387,6 +1388,38 @@
+ return pid;
+ }
+
++#ifdef RUN_LOGIN
++/*
++ * All of the logic to maintain utmpx is now built into /usr/bin/login, so
++ * all we need to do is call it, and pass the shell command to it.
++ */
++extern char *LoginName;
++
++static int
++run_login(const char *path, char *const argv[], char *const envp[])
++{
++ const char *shargs[MAXARGS + 1 + 3];
++ const char **fp, **tp;
++
++ if (access(path, X_OK) < 0)
++ return -1;
++ shargs[0] = "login";
++ shargs[1] = (*argv[0] == '-') ? "-pfq" : "-pflq";
++ shargs[2] = LoginName;
++ shargs[3] = path;
++ fp = (const char **)argv + 1;
++ tp = shargs + 4;
++ /* argv has already been check for length */
++ while ((*tp++ = *fp++) != NULL) {}
++ /* shouldn't return unless there was an error */
++ return (execve("/usr/bin/login", (char *const*)shargs, envp));
++}
++
++/* replace the following occurrences of execve() with run_login() */
++#define execve run_login
++
++#endif /* RUN_LOGIN */
++
+ void
+ execvpe(prog, args, env)
+ char *prog, **args, **env;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090120/3d68e0cf/attachment-0001.html>
More information about the macports-changes
mailing list