aboutsummaryrefslogtreecommitdiffstats
path: root/irc/irssi
diff options
context:
space:
mode:
authorvanilla <vanilla@FreeBSD.org>2012-08-13 23:08:03 +0800
committervanilla <vanilla@FreeBSD.org>2012-08-13 23:08:03 +0800
commit0ef542e7bfd3a74f4ce9c686ffee4c4bc643d8c6 (patch)
tree604fd21efe6b158bc50081e69309fc2bec9b1afe /irc/irssi
parentfe77fbdda0f54f9dfbd3f43c68f251d9b4f777bc (diff)
downloadfreebsd-ports-gnome-0ef542e7bfd3a74f4ce9c686ffee4c4bc643d8c6.tar.gz
freebsd-ports-gnome-0ef542e7bfd3a74f4ce9c686ffee4c4bc643d8c6.tar.zst
freebsd-ports-gnome-0ef542e7bfd3a74f4ce9c686ffee4c4bc643d8c6.zip
1: fix utf-8 decoding.
2: convert to optionng. PR: ports/169780 Submitted by: Kuan-Chung Chiu <buganini@gmail.com> [1]
Diffstat (limited to 'irc/irssi')
-rw-r--r--irc/irssi/Makefile31
-rw-r--r--irc/irssi/files/patch-irssi-utf838
2 files changed, 55 insertions, 14 deletions
diff --git a/irc/irssi/Makefile b/irc/irssi/Makefile
index 7bd78c0561fa..a3d6c7d51a76 100644
--- a/irc/irssi/Makefile
+++ b/irc/irssi/Makefile
@@ -7,14 +7,14 @@
PORTNAME= irssi
PORTVERSION= 0.8.15
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES?= irc
MASTER_SITES= http://mirror.irssi.org/
MAINTAINER?= vanilla@FreeBSD.org
COMMENT?= A modular IRC client with many features
-LIB_DEPENDS= glib-2.0:${PORTSDIR}/devel/glib20
+LIB_DEPENDS= glib-2:${PORTSDIR}/devel/glib20
CONFLICTS= irssi-devel-[0-9]* zh-irssi-[0-9]*
@@ -26,11 +26,14 @@ WANT_PERL= yes
MAN1= irssi.1
-OPTIONS= PERL "Enable perl support" on \
- PROXY "Enable proxy support" off \
- SOCKS "Enable socks proxy support" off \
- IPV6 "Enable IPv6" on \
- BOT "Enable bot" off
+OPTIONS_DEFINE= PERL PROXY SOCKS IPV6 BOT
+PERL_DESC= Perl support
+PROXY_DESC= Proxy support
+SOCKS_DESC= Socks proxy support
+IPV6_DESC= IPV6 support
+BOT_DESC= Bot support
+OPTIONS_DEFAULT= PERL IPV6
+
# USE_OPENSSL must be defined before bsd.port.pre.mk so use old schema
# for WITH_SSL option
@@ -40,11 +43,11 @@ CONFIGURE_ARGS+= --disable-ssl
USE_OPENSSL= yes
.endif
-.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
# Process options.
-.if !defined(WITHOUT_PERL)
+.if ${PORT_OPTIONS:MPERL}
USE_PERL5= yes
CONFIGURE_ARGS+= --with-perl-lib=site
PLIST_SUB+= WITH_PERL=""
@@ -53,23 +56,23 @@ CONFIGURE_ARGS+= --without-perl
PLIST_SUB+= WITH_PERL="@comment "
.endif
-.if defined(WITH_PROXY)
+.if ${PORT_OPTIONS:MPROXY}
CONFIGURE_ARGS+= --with-proxy
PLIST_SUB+= WITH_PROXY=""
.else
PLIST_SUB+= WITH_PROXY="@comment "
.endif
-.if defined(WITH_SOCKS)
+.if ${PORT_OPTIONS:MSOCKS}
CONFIGURE_ARGS+= --with-socks
.endif
-.if defined(WITHOUT_IPV6)
+.if !${PORT_OPTIONS:MIPV6}
CONFIGURE_ARGS+= --disable-ipv6
CATEGORIES+= ipv6
.endif
-.if defined(WITH_BOT)
+.if ${PORT_OPTIONS:MBOT}
CONFIGURE_ARGS+= --with-bot
PLIST_SUB+= WITH_BOT=""
.else
@@ -92,4 +95,4 @@ post-install:
@${ECHO_MSG} "You may install x11-themes/irssi-themes for"
@${ECHO_MSG} " additional themes."
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/irc/irssi/files/patch-irssi-utf8 b/irc/irssi/files/patch-irssi-utf8
new file mode 100644
index 000000000000..ab67286bf3d1
--- /dev/null
+++ b/irc/irssi/files/patch-irssi-utf8
@@ -0,0 +1,38 @@
+#
+# $FreeBSD$
+#
+--- src/fe-common/core/utf8.h (revision 5189)
++++ src/fe-common/core/utf8.h (working copy)
+@@ -12,5 +12,6 @@
+ int mk_wcwidth(unichar c);
+
+ #define unichar_isprint(c) (((c) & ~0x80) >= 32)
++#define is_utf8_leading(c) (((c) & 0xc0) != 0x80)
+
+ #endif
+--- src/fe-text/textbuffer.c (revision 5189)
++++ src/fe-text/textbuffer.c (working copy)
+@@ -23,6 +23,7 @@
+ #include "module.h"
+ #include "misc.h"
+ #include "formats.h"
++#include "utf8.h"
+
+ #include "textbuffer.h"
+
+@@ -157,6 +158,16 @@
+ if (left > 0 && data[left-1] == 0)
+ left--; /* don't split the commands */
+
++ /* don't split utf-8 character. (assume we can split non-utf8 anywhere. */
++ if (left < TEXT_CHUNK_USABLE_SIZE && !is_utf8_leading(data[left])) {
++ int i;
++ for (i = 1; i < 4 && left >= i; i++)
++ if (is_utf8_leading(data[left - i])) {
++ left -= i;
++ break;
++ }
++ }
++
+ memcpy(chunk->buffer + chunk->pos, data, left);
+ chunk->pos += left;