ports/155909: [PATCH] sysutils/tmux: fix tmux.conf location, support libevent2
Martin Matuska
mm at FreeBSD.org
Thu Mar 24 10:20:01 UTC 2011
>Number: 155909
>Category: ports
>Synopsis: [PATCH] sysutils/tmux: fix tmux.conf location, support libevent2
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Thu Mar 24 10:20:00 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Martin Matuska
>Release: FreeBSD 8.2-STABLE amd64
>Organization:
>Environment:
System: FreeBSD neo.vx.sk 8.2-STABLE FreeBSD 8.2-STABLE #0 r219122M: Wed Mar 2 00:08:08
>Description:
- tmux.conf should be read from ${PREFIX}/etc/tmux.conf
- add support for linking against libevent2 (static and dynamic)
Port maintainer (wen at FreeBSD.org) is cc'd.
Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:
--- tmux-1.4_5.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/sysutils/tmux/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- Makefile 3 Mar 2011 08:16:59 -0000 1.26
+++ Makefile 24 Mar 2011 10:09:39 -0000
@@ -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,9 @@
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
# 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 +33,32 @@
.include <bsd.port.pre.mk>
+.if defined(WITH_LIBEVENT2)
+CFLAGS+= -I${LOCALBASE}/include/event2/compat
+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)
@@ -53,12 +72,14 @@
.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
--- tmux-1.4_5.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list