diff options
author | leot <leot@pkgsrc.org> | 2018-11-28 14:45:19 +0000 |
---|---|---|
committer | leot <leot@pkgsrc.org> | 2018-11-28 14:45:19 +0000 |
commit | 5311e4602d0b10b19ccbd29bc03a6dd78ba7e00a (patch) | |
tree | 77aee95f7408069e61373fcd3d78c627c105afc3 | |
parent | 857ccb012874dfcf8fbe75cafebe2a33b044bf10 (diff) | |
download | pkgsrc-5311e4602d0b10b19ccbd29bc03a6dd78ba7e00a.tar.gz |
tmux: Add support for pane_current_path variable in NetBSD
Implement osdep_get_cwd() by using mount_procfs(8) in order to add
support for pane_current_path variable in NetBSD.
Bump PKGREVISION
-rw-r--r-- | misc/tmux/Makefile | 3 | ||||
-rw-r--r-- | misc/tmux/distinfo | 3 | ||||
-rw-r--r-- | misc/tmux/patches/patch-osdep-netbsd.c | 43 |
3 files changed, 47 insertions, 2 deletions
diff --git a/misc/tmux/Makefile b/misc/tmux/Makefile index 9ae65d07cc0..ae5fdc56e81 100644 --- a/misc/tmux/Makefile +++ b/misc/tmux/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.46 2018/10/21 21:22:47 leot Exp $ +# $NetBSD: Makefile,v 1.47 2018/11/28 14:45:19 leot Exp $ DISTNAME= tmux-2.8 +PKGREVISION= 1 CATEGORIES= misc MASTER_SITES= ${MASTER_SITE_GITHUB:=tmux/} GITHUB_RELEASE= ${PKGVERSION_NOREV} diff --git a/misc/tmux/distinfo b/misc/tmux/distinfo index 2018d8de8d6..10320f0ab72 100644 --- a/misc/tmux/distinfo +++ b/misc/tmux/distinfo @@ -1,8 +1,9 @@ -$NetBSD: distinfo,v 1.37 2018/10/21 21:22:47 leot Exp $ +$NetBSD: distinfo,v 1.38 2018/11/28 14:45:19 leot Exp $ SHA1 (tmux-2.8.tar.gz) = 6a469769a242c95dc8aec443b436d4f8f279f517 RMD160 (tmux-2.8.tar.gz) = 13f097f02b2d3f489fb00af5b3f702cb2eae523f SHA512 (tmux-2.8.tar.gz) = e382aec122a10624953432b3c869b21d69390bc2e7d459440a46950802e39503eafb398178f8085191261925e4f0872bb99b19e0403e7beb56d3ceecc4c86b09 Size (tmux-2.8.tar.gz) = 491195 bytes SHA1 (patch-Makefile.in) = dc8a351b06bf2f9f96b3dc4d944a174ef3c8d9db +SHA1 (patch-osdep-netbsd.c) = 81d0bf9275c0c12d4f0f2adc07136e3d8948137d SHA1 (patch-tty-term.c) = 20bf235e61e6650bec3e7e94ea79859898039eba diff --git a/misc/tmux/patches/patch-osdep-netbsd.c b/misc/tmux/patches/patch-osdep-netbsd.c new file mode 100644 index 00000000000..e99c6f09d71 --- /dev/null +++ b/misc/tmux/patches/patch-osdep-netbsd.c @@ -0,0 +1,43 @@ +$NetBSD: patch-osdep-netbsd.c,v 1.1 2018/11/28 14:45:19 leot Exp $ + +Implement osdep_get_cwd() via mount_procfs(8) (inspired by osdep-sunos.c). + +--- osdep-netbsd.c.orig 2016-01-21 00:00:28.000000000 +0000 ++++ osdep-netbsd.c +@@ -23,10 +23,13 @@ + + #include <errno.h> + #include <event.h> ++#include <limits.h> + #include <stdlib.h> + #include <string.h> + #include <unistd.h> + ++#include "tmux.h" ++ + #define is_runnable(p) \ + ((p)->p_stat == LSRUN || (p)->p_stat == SIDL) + #define is_stopped(p) \ +@@ -127,6 +130,22 @@ error: + char * + osdep_get_cwd(int fd) + { ++ static char target[PATH_MAX + 1]; ++ char *path; ++ pid_t pgrp; ++ ssize_t n; ++ ++ if ((pgrp = tcgetpgrp(fd)) == -1) ++ return (NULL); ++ ++ xasprintf(&path, "/proc/%lld/cwd", (long long) pgrp); ++ n = readlink(path, target, sizeof(target) - 1); ++ free(path); ++ if (n > 0) { ++ target[n] = '\0'; ++ return (target); ++ } ++ + return (NULL); + } + |