2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-30 05:19:25 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Tmux < Formula
|
2009-12-17 23:10:48 +00:00
|
|
|
homepage 'http://tmux.sourceforge.net'
|
2012-06-09 16:04:42 +00:00
|
|
|
url 'http://sourceforge.net/projects/tmux/files/tmux/tmux-1.6/tmux-1.6.tar.gz'
|
|
|
|
sha1 '8756f6bcecb18102b87e5d6f5952ba2541f68ed3'
|
2009-09-30 05:19:25 +00:00
|
|
|
|
2012-09-06 18:27:10 +00:00
|
|
|
head 'git://tmux.git.sourceforge.net/gitroot/tmux/tmux'
|
2012-01-28 00:47:31 +00:00
|
|
|
|
2012-07-08 19:39:12 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-03-22 21:19:12 +00:00
|
|
|
depends_on 'libevent'
|
|
|
|
|
2012-08-23 04:14:18 +00:00
|
|
|
if build.head?
|
2012-07-07 18:08:22 +00:00
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
2012-02-28 15:39:22 +00:00
|
|
|
end
|
|
|
|
|
2012-07-08 19:39:12 +00:00
|
|
|
def patches
|
2012-07-23 05:29:31 +00:00
|
|
|
# Fix for Japanese characters. See:
|
|
|
|
# http://sourceforge.net/tracker/?func=detail&aid=3566884&group_id=200378&atid=973264
|
|
|
|
p = ['http://sourceforge.net/tracker/download.php?group_id=200378&atid=973264&file_id=453002&aid=3566884']
|
|
|
|
# This patch adds the implementation of osdep_get_cwd for Darwin platform,
|
|
|
|
# so that tmux can get current working directory correctly under Mac OS.
|
|
|
|
# NOTE: it applies to 1.6 only, and should be removed when 1.7 is out.
|
|
|
|
# (because it has been merged upstream)
|
|
|
|
p << DATA if build.stable?
|
|
|
|
|
|
|
|
p
|
2012-07-08 19:39:12 +00:00
|
|
|
end
|
|
|
|
|
2009-09-30 05:19:25 +00:00
|
|
|
def install
|
2012-08-23 04:14:18 +00:00
|
|
|
system "sh", "autogen.sh" if build.head?
|
2012-01-28 00:47:31 +00:00
|
|
|
|
2011-07-12 02:02:24 +00:00
|
|
|
ENV.append "LDFLAGS", '-lresolv'
|
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}", "--sysconfdir=#{etc}"
|
2009-09-30 05:19:25 +00:00
|
|
|
system "make install"
|
2011-07-12 02:02:24 +00:00
|
|
|
|
2011-06-16 00:25:52 +00:00
|
|
|
(prefix+'etc/bash_completion.d').install "examples/bash_completion_tmux.sh" => 'tmux'
|
2012-06-09 16:04:42 +00:00
|
|
|
|
|
|
|
# Install addtional meta file
|
|
|
|
prefix.install 'NOTES'
|
2011-06-16 00:25:52 +00:00
|
|
|
end
|
|
|
|
|
2012-08-14 02:20:53 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
Additional information can be found in:
|
|
|
|
#{prefix}/NOTES
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2012-04-07 04:36:24 +00:00
|
|
|
def test
|
2012-05-15 21:36:45 +00:00
|
|
|
system "#{bin}/tmux", "-V"
|
2012-04-07 04:36:24 +00:00
|
|
|
end
|
2009-09-30 05:19:25 +00:00
|
|
|
end
|
2012-07-08 19:39:12 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/osdep-darwin.c b/osdep-darwin.c
|
|
|
|
index c5820df..7b15446 100644
|
|
|
|
--- a/osdep-darwin.c
|
|
|
|
+++ b/osdep-darwin.c
|
|
|
|
@@ -18,6 +18,7 @@
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/sysctl.h>
|
|
|
|
+#include <libproc.h>
|
|
|
|
|
|
|
|
#include <event.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
@@ -52,6 +53,15 @@
|
|
|
|
char *
|
|
|
|
osdep_get_cwd(pid_t pid)
|
|
|
|
{
|
|
|
|
+ static char wd[PATH_MAX];
|
|
|
|
+ struct proc_vnodepathinfo pathinfo;
|
|
|
|
+ int ret;
|
|
|
|
+
|
|
|
|
+ ret = proc_pidinfo(pid, PROC_PIDVNODEPATHINFO, 0, &pathinfo, sizeof(pathinfo));
|
|
|
|
+ if (ret == sizeof(pathinfo)) {
|
|
|
|
+ strlcpy(wd, pathinfo.pvi_cdir.vip_path, sizeof(wd));
|
|
|
|
+ return (wd);
|
|
|
|
+ }
|
|
|
|
return (NULL);
|
|
|
|
}
|