summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/tmux/DESCR4
-rw-r--r--misc/tmux/Makefile24
-rw-r--r--misc/tmux/PLIST3
-rw-r--r--misc/tmux/distinfo9
-rw-r--r--misc/tmux/patches/patch-aa81
-rw-r--r--misc/tmux/patches/patch-ab15
-rw-r--r--misc/tmux/patches/patch-ac168
-rw-r--r--misc/tmux/patches/patch-ad19
8 files changed, 323 insertions, 0 deletions
diff --git a/misc/tmux/DESCR b/misc/tmux/DESCR
new file mode 100644
index 00000000000..21003060375
--- /dev/null
+++ b/misc/tmux/DESCR
@@ -0,0 +1,4 @@
+Tmux is a "terminal multiplexer", it enables a number of terminals
+(or windows) to be accessed and controlled from a single terminal.
+Tmux is intended to be a simple, modern, BSD-licensed alternative
+to programs such as GNU screen.
diff --git a/misc/tmux/Makefile b/misc/tmux/Makefile
new file mode 100644
index 00000000000..d59b5c2fd47
--- /dev/null
+++ b/misc/tmux/Makefile
@@ -0,0 +1,24 @@
+# $NetBSD: Makefile,v 1.1.1.1 2009/03/06 12:16:17 hasso Exp $
+
+DISTNAME= tmux-0.7
+PKGREVISION= 1
+CATEGORIES= misc
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=tmux/}
+
+MAINTAINER= hasso@NetBSD.org
+HOMEPAGE= http://tmux.sourceforge.net/
+COMMENT= BSD-licensed terminal multiplexer (GNU Screen alternative)
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+NO_CONFIGURE= yes
+USE_NCURSES= yes
+
+INSTALL_MAKE_FLAGS+= \
+ INSTALL_MAN=${INSTALL_MAN:Q} \
+ INSTALL_MAN_DIR=${INSTALL_PROGRAM_DIR:Q} \
+ INSTALL_PROGRAM_DIR=${INSTALL_PROGRAM_DIR:Q} \
+ INSTALL_PROGRAM=${INSTALL_PROGRAM:Q}
+
+.include "../../devel/ncurses/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/misc/tmux/PLIST b/misc/tmux/PLIST
new file mode 100644
index 00000000000..ea3ed12c0e0
--- /dev/null
+++ b/misc/tmux/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2009/03/06 12:16:17 hasso Exp $
+bin/tmux
+man/man1/tmux.1
diff --git a/misc/tmux/distinfo b/misc/tmux/distinfo
new file mode 100644
index 00000000000..a6280532f42
--- /dev/null
+++ b/misc/tmux/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1.1.1 2009/03/06 12:16:17 hasso Exp $
+
+SHA1 (tmux-0.7.tar.gz) = 11c27de5de98367ea2c94ea70ef098e5e70eeead
+RMD160 (tmux-0.7.tar.gz) = 81f60d21230b995651e91e18e587d484e40f6c96
+Size (tmux-0.7.tar.gz) = 163951 bytes
+SHA1 (patch-aa) = 8144db4780da4731b88666a75759211cb7c5a633
+SHA1 (patch-ab) = 0de94fd65799bbf1447fbc204e8d6885bcd08aae
+SHA1 (patch-ac) = 305dd0b74ad7b8a07de529f52a93dcb889c5578e
+SHA1 (patch-ad) = 83155287cee869f9b44885e0f662001e0875da3a
diff --git a/misc/tmux/patches/patch-aa b/misc/tmux/patches/patch-aa
new file mode 100644
index 00000000000..63cc655e312
--- /dev/null
+++ b/misc/tmux/patches/patch-aa
@@ -0,0 +1,81 @@
+$NetBSD: patch-aa,v 1.1.1.1 2009/03/06 12:16:17 hasso Exp $
+
+Do not add -W* flags to CFLAGS.
+NetBSD has not got strtonum(3) and strnvis(3) so use the compat/
+alternatives.
+Add settings for Darwin, obtained from GNUmakefile.
+Do not use rough install(1) commands, use cleaner INSTALL_* ones.
+
+--- Makefile.orig 2009-02-07 00:36:34.000000000 -0800
++++ Makefile
+@@ -46,10 +46,10 @@ SRCS= tmux.c server.c server-msg.c serve
+ options.c options-cmd.c paste.c colour.c utf8.c clock.c \
+ tty.c tty-term.c tty-keys.c tty-write.c util.c names.c \
+ osdep-unknown.c osdep-openbsd.c osdep-freebsd.c osdep-linux.c \
+- osdep-darwin.c attributes.c
++ osdep-darwin.c osdep-netbsd.c attributes.c
+
+ CC?= cc
+-INCDIRS+= -I. -I- -I/usr/local/include
++INCDIRS+= -I. -I/usr/local/include
+ CFLAGS+= -DMETA="'${META}'"
+ .ifdef PROFILE
+ # Don't use ccache
+@@ -64,10 +64,10 @@ CFLAGS+= -DBUILD="\"$(VERSION) ($(DATE))
+ CFLAGS+= -DBUILD="\"$(VERSION)\""
+ .endif
+ #CFLAGS+= -pedantic -std=c99
+-CFLAGS+= -Wno-long-long -Wall -W -Wnested-externs -Wformat=2
+-CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
+-CFLAGS+= -Wwrite-strings -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
+-CFLAGS+= -Wundef -Wbad-function-cast -Winline -Wcast-align
++#CFLAGS+= -Wno-long-long -Wall -W -Wnested-externs -Wformat=2
++#CFLAGS+= -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
++#CFLAGS+= -Wwrite-strings -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
++#CFLAGS+= -Wundef -Wbad-function-cast -Winline -Wcast-align
+
+ PREFIX?= /usr/local
+ INSTALLDIR= install -d
+@@ -80,6 +80,14 @@ LDFLAGS+= -pg
+ .endif
+ LIBS+= -lutil -lncurses
+
++# Darwin
++.if ${OS} == "Darwin"
++INCDIRS+= -Icompat
++SRCS+= compat/strtonum.c compat/bsd-poll.c compat/vis.c
++CFLAGS+= -DNO_STRTONUM -DNO_SETRESUID -DNO_SETRESGID -DNO_SETPROCTITLE \
++ -DNO_QUEUE_H -DNO_TREE_H -DBROKEN_POLL
++.endif
++
+ # FreeBSD and DragonFly
+ .if ${OS} == "FreeBSD" || ${OS} == "DragonFly"
+ INCDIRS+= -Icompat
+@@ -88,6 +96,15 @@ CFLAGS+= -DUSE_LIBUTIL_H -DNO_QUEUE_H -D
+ LIBS+= -lcrypt
+ .endif
+
++# NetBSD
++.if ${OS} == "NetBSD"
++INCDIRS+= -Icompat
++SRCS+= compat/strtonum.c compat/vis.c
++LIBS+= -lcrypt
++CFLAGS+=-DNO_STRTONUM
++.endif
++
++
+ OBJS= ${SRCS:S/.c/.o/:S/.y/.o/}
+
+ DISTDIR= ${PROG}-${VERSION}
+@@ -134,7 +151,7 @@ update-index.html:
+ sed "s/%%VERSION%%/${VERSION}/g" index.html.in >index.html
+
+ install: all
+- ${INSTALLDIR} ${DESTDIR}${PREFIX}/bin
+- ${INSTALLBIN} ${PROG} ${DESTDIR}${PREFIX}/bin/${PROG}
+- ${INSTALLDIR} ${DESTDIR}${PREFIX}/man/man1
+- ${INSTALLMAN} ${PROG}.1 ${DESTDIR}${PREFIX}/man/man1/
++ ${INSTALL_PROGRAM_DIR} ${DESTDIR}${PREFIX}/bin
++ ${INSTALL_PROGRAM} ${PROG} ${DESTDIR}${PREFIX}/bin/${PROG}
++ ${INSTALL_MAN_DIR} ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
++ ${INSTALL_MAN} ${PROG}.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/
diff --git a/misc/tmux/patches/patch-ab b/misc/tmux/patches/patch-ab
new file mode 100644
index 00000000000..d5dbbb32434
--- /dev/null
+++ b/misc/tmux/patches/patch-ab
@@ -0,0 +1,15 @@
+$NetBSD: patch-ab,v 1.1.1.1 2009/03/06 12:16:17 hasso Exp $
+
+NetBSD is supported via osdep-netbsd.c.
+
+--- osdep-unknown.c.orig 2009-01-20 23:17:53.000000000 +0100
++++ osdep-unknown.c
+@@ -17,7 +17,7 @@
+ */
+
+ #if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__linux__) && \
+- !defined(__APPLE__)
++ !defined(__APPLE__) && !defined(__NetBSD__)
+
+ #include <sys/types.h>
+
diff --git a/misc/tmux/patches/patch-ac b/misc/tmux/patches/patch-ac
new file mode 100644
index 00000000000..fcc1e8a76b7
--- /dev/null
+++ b/misc/tmux/patches/patch-ac
@@ -0,0 +1,168 @@
+$NetBSD: patch-ac,v 1.1.1.1 2009/03/06 12:16:17 hasso Exp $
+
+get_argv0() and get_proc_argv0() functions for NetBSD.
+
+--- osdep-netbsd.c.orig 2009-02-22 16:30:11.000000000 +0100
++++ osdep-netbsd.c
+@@ -0,0 +1,161 @@
++/*
++ * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
++ *
++ * Permission to use, copy, modify, and distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
++ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#ifdef __NetBSD__
++
++#include <sys/param.h>
++#include <sys/proc.h>
++#include <sys/stat.h>
++#include <sys/sysctl.h>
++#include <sys/user.h>
++
++#include <err.h>
++#include <errno.h>
++#include <stdint.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++
++char *get_argv0(int, char *);
++char *get_proc_argv0(pid_t);
++
++#define nitems(_a) (sizeof((_a)) / sizeof((_a)[0]))
++
++#define is_runnable(p) \
++ ((p)->p_stat == LSRUN || (p)->p_stat == SIDL)
++#define is_stopped(p) \
++ ((p)->p_stat == LSSTOP || (p)->p_stat == SZOMB)
++
++char *
++get_argv0(int fd, char *tty)
++{
++ int mib[4] = { CTL_KERN, KERN_PROC2, KERN_PROC_PGRP, 0 };
++ struct stat sb;
++ size_t len;
++ struct kinfo_proc2 *buf, *newbuf, *p, *bestp;
++ char *procname;
++ u_int i;
++
++ buf = NULL;
++
++ if (stat(tty, &sb) == -1)
++ return (NULL);
++ if ((mib[3] = tcgetpgrp(fd)) == -1)
++ return (NULL);
++
++retry:
++ if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) == -1)
++ return (NULL);
++ len = (len * 5) / 4;
++
++ if ((newbuf = realloc(buf, len)) == NULL) {
++ free(buf);
++ return (NULL);
++ }
++ buf = newbuf;
++
++ if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) == -1) {
++ if (errno == ENOMEM)
++ goto retry;
++ free(buf);
++ return (NULL);
++ }
++
++ bestp = NULL;
++ for (i = 0; i < len / sizeof (struct kinfo_proc); i++) {
++ if (buf[i].p_tdev != sb.st_rdev)
++ continue;
++ p = &buf[i];
++ if (bestp == NULL) {
++ bestp = p;
++ continue;
++ }
++
++ if (is_runnable(p) && !is_runnable(bestp))
++ bestp = p;
++ else if (!is_runnable(p) && is_runnable(bestp))
++ continue;
++
++ if (!is_stopped(p) && is_stopped(bestp))
++ bestp = p;
++ else if (is_stopped(p) && !is_stopped(bestp))
++ continue;
++
++ if (p->p_estcpu > bestp->p_estcpu)
++ bestp = p;
++ else if (p->p_estcpu < bestp->p_estcpu)
++ continue;
++
++ if (p->p_slptime < bestp->p_slptime)
++ bestp = p;
++ else if (p->p_slptime > bestp->p_slptime)
++ continue;
++
++ if (strcmp(p->p_comm, p->p_comm) < 0)
++ bestp = p;
++ else if (strcmp(p->p_comm, p->p_comm) > 0)
++ continue;
++
++ if (p->p_pid > bestp->p_pid)
++ bestp = p;
++ }
++ if (bestp != NULL) {
++ procname = get_proc_argv0(bestp->p_pid);
++ if (procname == NULL || *procname == '\0') {
++ free(procname);
++ procname = strdup(bestp->p_comm);
++ }
++ } else
++ procname = NULL;
++
++
++ free(buf);
++ return (procname);
++}
++
++char *
++get_proc_argv0(pid_t pid)
++{
++ int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ARGS, 0 };
++ size_t size, size2;
++ char *args, *args2, *procname;
++
++ mib[3] = pid;
++ procname = NULL;
++
++ args = NULL;
++ size = 128;
++ while (size < SIZE_MAX / 2) {
++ size *= 2;
++ if ((args2 = realloc(args, size)) == NULL)
++ break;
++ args = args2;
++ size2 = size;
++ if (sysctl(mib, 4, args, &size2, NULL, 0) == -1) {
++ if (errno == ENOMEM)
++ continue;
++ break;
++ }
++ if (size2 > 0 && *args != '\0')
++ procname = strdup(args);
++ break;
++ }
++ free(args);
++
++ return (procname);
++}
++
++#endif
diff --git a/misc/tmux/patches/patch-ad b/misc/tmux/patches/patch-ad
new file mode 100644
index 00000000000..28cff2e86f6
--- /dev/null
+++ b/misc/tmux/patches/patch-ad
@@ -0,0 +1,19 @@
+$NetBSD: patch-ad,v 1.1.1.1 2009/03/06 12:16:17 hasso Exp $
+
+get_argv0() function prototype is:
+
+ char *get_argv0(int, char *);
+
+so respect it in order to build on unknown platforms.
+
+--- osdep-unknown.c.orig 2009-02-18 09:36:41 +0200
++++ osdep-unknown.c 2009-02-18 09:37:30 +0200
+@@ -24,7 +24,7 @@
+ #include "tmux.h"
+
+ char *
+-get_argv0(unused pid_t pgrp)
++get_argv0(unused int fd, unused char *tty)
+ {
+ return (NULL);
+ }