From ddcf604a5dc970f062993ffaf2f1602c23943088 Mon Sep 17 00:00:00 2001 From: wen Date: Wed, 25 May 2011 00:29:33 +0000 Subject: - Fix tmux.conf location [1] - Support libevent2 [1] - Add an option to use patch-tty-key.c [2] PR: ports/155909 [1], ports/153942 [2] Submitted by: mm@ [1], Brandon Low [2], randy.belk@gmail.com(via email) [2] --- sysutils/tmux/Makefile | 50 +++++++++++++++++++++++------- sysutils/tmux/files/extra-patch-tty-keys.c | 11 +++++++ sysutils/tmux/files/patch-tty-keys.c | 11 ------- 3 files changed, 49 insertions(+), 23 deletions(-) create mode 100644 sysutils/tmux/files/extra-patch-tty-keys.c delete mode 100644 sysutils/tmux/files/patch-tty-keys.c (limited to 'sysutils') diff --git a/sysutils/tmux/Makefile b/sysutils/tmux/Makefile index b1554bf9d320..30059b8639f2 100644 --- a/sysutils/tmux/Makefile +++ b/sysutils/tmux/Makefile @@ -7,7 +7,7 @@ PORTNAME= tmux PORTVERSION= 1.4 -PORTREVISION= 4 +PORTREVISION= 5 CATEGORIES= sysutils MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${PORTNAME}-${PORTVERSION} @@ -23,12 +23,10 @@ PLIST_FILES= bin/tmux PORTDOCS= CHANGES FAQ NOTES PORTEXAMPLES= * -CFLAGS+= -I${LOCALBASE}/include -#LDFLAGS+= -L${LOCALBASE}/lib -CONFIGURE_ARGS+= CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" - -OPTIONS= KQUEUE "Build without define HAVE_BROKEN_KQUEUE " On \ - LIBEVENT_STATIC "Build with static libevent" Off +OPTIONS= KQUEUE "Build without define HAVE_BROKEN_KQUEUE " On \ + LIBEVENT2 "Use libevent version 2" Off \ + LIBEVENT_STATIC "Build with static libevent" Off \ + BACKSPACE "Build with tty/keys patch" Off # Now I set tmux build without #define HAVE_BROKEN_KQUEUE as default and an option, # If it still hang the system or other run error, try as upstream suggest: @@ -36,10 +34,32 @@ OPTIONS= KQUEUE "Build without define HAVE_BROKEN_KQUEUE " On \ .include +.if defined(WITH_LIBEVENT2) +CFLAGS+= -I${LOCALBASE}/include/event2/compat -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib/event2 +.else +CFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= -L${LOCALBASE}/lib +.endif + +MAKE_ENV+= LDFLAGS="${LDFLAGS}" + .if defined(WITH_LIBEVENT_STATIC) -BUILD_DEPENDS+= ${LOCALBASE}/lib/libevent.a:${PORTSDIR}/devel/libevent +. if defined(WITH_LIBEVENT2) +_LEVENT_LIB= ${LOCALBASE}/lib/event2/libevent.a +BUILD_DEPENDS+= ${_LEVENT_LIB}:${PORTSDIR}/devel/libevent2 +. else +_LEVENT_LIB= ${LOCALBASE}/lib/libevent.a +BUILD_DEPENDS+= ${_LEVENT_LIB}:${PORTSDIR}/devel/libevent +. endif .else +. if defined(WITH_LIBEVENT2) +_LEVENT_LIB= -levent-2.0 +LIB_DEPENDS= event-2.0:${PORTSDIR}/devel/libevent2 +. else +_LEVENT_LIB= -levent-1.4 LIB_DEPENDS= event-1.4:${PORTSDIR}/devel/libevent +. endif .endif .if !defined(WITHOUT_KQUEUE) @@ -52,13 +72,19 @@ EXTRA_PATCHES= ${PATCHDIR}/extra-patch-kqueue EXTRA_PATCHES= ${PATCHDIR}/extra-patch-fb7 .endif +.if defined(WITH_BACKSPACE) +EXTRA_PATCHES= ${PATCHDIR}/extra-patch-tty-keys.c +.endif + post-patch: - @${REINPLACE_CMD} -e 's#/usr/local#${LOCALBASE}#g' \ + @${REINPLACE_CMD} -e 's|/etc/tmux.conf|${PREFIX}/etc/tmux.conf|g' \ + ${WRKSRC}/tmux.1 ${WRKSRC}/tmux.h + @${REINPLACE_CMD} -e 's|-I/usr/local/include||g' \ + -e 's|/usr/local|${LOCALBASE}|g' \ + -e 's|LDFLAGS+=|#LDFLAGS+=|g' \ ${WRKSRC}/Makefile -.if defined(WITH_LIBEVENT_STATIC) - @${REINPLACE_CMD} -e 's|-levent|${LOCALBASE}/lib/libevent.a|g' \ + @${REINPLACE_CMD} -e 's|-levent|${_LEVENT_LIB}|g' \ ${WRKSRC}/configure -.endif do-install: @${INSTALL_PROGRAM} ${WRKSRC}/tmux ${PREFIX}/bin diff --git a/sysutils/tmux/files/extra-patch-tty-keys.c b/sysutils/tmux/files/extra-patch-tty-keys.c new file mode 100644 index 000000000000..6a8bf625c9cc --- /dev/null +++ b/sysutils/tmux/files/extra-patch-tty-keys.c @@ -0,0 +1,11 @@ +--- tty-keys.c.orig 2010-06-04 08:45:52.000000000 +0800 ++++ tty-keys.c 2010-06-04 08:46:45.000000000 +0800 +@@ -456,8 +456,6 @@ + * used. termios should have a better idea. + */ + bspace = tty->tio.c_cc[VERASE]; +- if (bspace != _POSIX_VDISABLE && key == bspace) +- key = KEYC_BSPACE; + goto handle_key; + } + diff --git a/sysutils/tmux/files/patch-tty-keys.c b/sysutils/tmux/files/patch-tty-keys.c deleted file mode 100644 index 6a8bf625c9cc..000000000000 --- a/sysutils/tmux/files/patch-tty-keys.c +++ /dev/null @@ -1,11 +0,0 @@ ---- tty-keys.c.orig 2010-06-04 08:45:52.000000000 +0800 -+++ tty-keys.c 2010-06-04 08:46:45.000000000 +0800 -@@ -456,8 +456,6 @@ - * used. termios should have a better idea. - */ - bspace = tty->tio.c_cc[VERASE]; -- if (bspace != _POSIX_VDISABLE && key == bspace) -- key = KEYC_BSPACE; - goto handle_key; - } - -- cgit