pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/misc/tmux Tmux is a "terminal multiplexer", it enables...
details: https://anonhg.NetBSD.org/pkgsrc/rev/61b09e1ff06c
branches: trunk
changeset: 555650:61b09e1ff06c
user: hasso <hasso%pkgsrc.org@localhost>
date: Fri Mar 06 12:16:17 2009 +0000
description:
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.
Brought in from pkgsrc-wip (PR 40497) where it was maintained by
Fulvio Ciriaco.
diffstat:
misc/tmux/DESCR | 4 +
misc/tmux/Makefile | 24 ++++++
misc/tmux/PLIST | 3 +
misc/tmux/distinfo | 9 ++
misc/tmux/patches/patch-aa | 81 +++++++++++++++++++++
misc/tmux/patches/patch-ab | 15 ++++
misc/tmux/patches/patch-ac | 168 +++++++++++++++++++++++++++++++++++++++++++++
misc/tmux/patches/patch-ad | 19 +++++
8 files changed, 323 insertions(+), 0 deletions(-)
diffs (truncated from 355 to 300 lines):
diff -r 8c897d62b141 -r 61b09e1ff06c misc/tmux/DESCR
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/tmux/DESCR Fri Mar 06 12:16:17 2009 +0000
@@ -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 -r 8c897d62b141 -r 61b09e1ff06c misc/tmux/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/tmux/Makefile Fri Mar 06 12:16:17 2009 +0000
@@ -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@localhost
+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 -r 8c897d62b141 -r 61b09e1ff06c misc/tmux/PLIST
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/tmux/PLIST Fri Mar 06 12:16:17 2009 +0000
@@ -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 -r 8c897d62b141 -r 61b09e1ff06c misc/tmux/distinfo
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/tmux/distinfo Fri Mar 06 12:16:17 2009 +0000
@@ -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 -r 8c897d62b141 -r 61b09e1ff06c misc/tmux/patches/patch-aa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/tmux/patches/patch-aa Fri Mar 06 12:16:17 2009 +0000
@@ -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 -r 8c897d62b141 -r 61b09e1ff06c misc/tmux/patches/patch-ab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/tmux/patches/patch-ab Fri Mar 06 12:16:17 2009 +0000
@@ -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 -r 8c897d62b141 -r 61b09e1ff06c misc/tmux/patches/patch-ac
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/tmux/patches/patch-ac Fri Mar 06 12:16:17 2009 +0000
@@ -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@localhost>
++ *
++ * 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 *
Home |
Main Index |
Thread Index |
Old Index