diff options
author | kevlo <kevlo@FreeBSD.org> | 2017-02-13 15:17:41 +0800 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2017-02-13 15:17:41 +0800 |
commit | ad86ca600496f52489e3c81de91209ecf83908cb (patch) | |
tree | a998040edc4b679acbab3f241efa8472a68e2835 /chinese | |
parent | 338314d0d1219d2ceafb7dc65dc986f8f3d14178 (diff) | |
download | freebsd-ports-gnome-ad86ca600496f52489e3c81de91209ecf83908cb.tar.gz freebsd-ports-gnome-ad86ca600496f52489e3c81de91209ecf83908cb.tar.zst freebsd-ports-gnome-ad86ca600496f52489e3c81de91209ecf83908cb.zip |
Remove the chinese specific version of mutt's email client.
The regular mail/mutt can handle Chinese locales.
Diffstat (limited to 'chinese')
-rw-r--r-- | chinese/Makefile | 1 | ||||
-rw-r--r-- | chinese/mutt/Makefile | 43 | ||||
-rw-r--r-- | chinese/mutt/files/patch-init.h | 32 | ||||
-rw-r--r-- | chinese/mutt/files/patch-mbyte.c | 135 | ||||
-rw-r--r-- | chinese/mutt/files/patch-mutt.h | 10 | ||||
-rw-r--r-- | chinese/mutt/files/patch-myiconv.c | 170 | ||||
-rw-r--r-- | chinese/mutt/files/patch-pager.c | 41 | ||||
-rw-r--r-- | chinese/mutt/files/patch-parse.c | 14 | ||||
-rw-r--r-- | chinese/mutt/files/patch-pgp.c | 11 | ||||
-rw-r--r-- | chinese/mutt/files/patch-sendlib.c | 11 | ||||
-rw-r--r-- | chinese/mutt/pkg-message | 18 |
11 files changed, 0 insertions, 486 deletions
diff --git a/chinese/Makefile b/chinese/Makefile index a55ccb3ae5f9..08b1cb858fd3 100644 --- a/chinese/Makefile +++ b/chinese/Makefile @@ -72,7 +72,6 @@ SUBDIR += lunar SUBDIR += moettf SUBDIR += muni - SUBDIR += mutt SUBDIR += oicq SUBDIR += opencc SUBDIR += opendesktop-fonts diff --git a/chinese/mutt/Makefile b/chinese/mutt/Makefile deleted file mode 100644 index c3261e31b4aa..000000000000 --- a/chinese/mutt/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# Created by: David O'Brien (obrien@NUXI.com) -# $FreeBSD$ - -#PORTREVISION= 0 -CATEGORIES= chinese - -MASTERDIR= ${.CURDIR}/../../mail/mutt -#REVISEDATE= 20100927 -PORTREVISION= 3 - -# XXX: Currently PORTREVISION assignment is not perfect. It needs to -# inherit its master port's PORTREVISION and be appended. - -MAINTAINER= ports@FreeBSD.org -COMMENT= The Mongrel of Mail User Agents with Chinese support - -CONFLICTS= ja-mutt-[0-9]* ja-mutt-devel-[0-9]* mutt-[0-9]* mutt-lite-[0-9]* - -LIB_DEPENDS+= libhz.so:chinese/autoconvert - -LDFLAGS_ADD+= -lhz - -WITH_MUTT_LOCALES_FIX= yes -WITH_MUTT_NCURSES= yes -.if !defined(PACKAGE_BUILDING) -WITHOUT_MUTT_SGMLFORMAT= yes -WITHOUT_MUTT_HTML= yes -WITHOUT_MUTT_XML= yes -WITHOUT_MUTT_COMPRESSED_FOLDERS=yes -.endif -MUTT_SLAVE_HTML_PAGES= 1 - -PKGMESSAGE= ${.CURDIR}/pkg-message - -post-patch:: - @${REINPLACE_CMD} -e '/^mutt_SOURCES/s/\\$$/ myiconv.c \\/' ${WRKSRC}/Makefile.am - @for i in ${.CURDIR}/files/patch-*; do \ - ${ECHO_MSG} "===> Applying extra patch $$i"; \ - ${PATCH} -d ${PATCH_WRKSRC} ${PATCH_ARGS} < $$i; \ - done - @${REINPLACE_CMD} -e 's|裏|裡|' ${WRKSRC}/po/zh_TW.po - -.include "${MASTERDIR}/Makefile" diff --git a/chinese/mutt/files/patch-init.h b/chinese/mutt/files/patch-init.h deleted file mode 100644 index e7d9baacd408..000000000000 --- a/chinese/mutt/files/patch-init.h +++ /dev/null @@ -1,32 +0,0 @@ ---- init.h.orig 2016-12-02 11:18:42.572961000 +0800 -+++ init.h 2016-12-02 11:18:42.600298000 +0800 -@@ -290,6 +290,11 @@ struct option_t MuttVars[] = { - ** .pp - ** Also see $$fast_reply. - */ -+ { "bbsislame", DT_BOOL, R_NONE, OPTBBSISLAME, 0 }, -+ /* -+ ** .pp -+ ** When this variable is set, mutt will beep when an error occurs. -+ */ - { "beep", DT_BOOL, R_NONE, OPTBEEP, 1 }, - /* - ** .pp -@@ -2667,7 +2672,7 @@ struct option_t MuttVars[] = { - ** For the pager, this variable specifies the number of lines shown - ** before search results. By default, search results will be top-aligned. - */ -- { "send_charset", DT_STR, R_NONE, UL &SendCharset, UL "us-ascii:iso-8859-1:utf-8" }, -+ { "send_charset", DT_STR, R_NONE, UL &SendCharset, UL "big5:gb2312:us-ascii:iso-8859-1:utf-8" }, - /* - ** .pp - ** A colon-delimited list of character sets for outgoing messages. Mutt will use the -@@ -3649,7 +3654,7 @@ struct option_t MuttVars[] = { - ** When \fIset\fP, Mutt will jump to the next unread message, if any, - ** when the current thread is \fIun\fPcollapsed. - */ -- { "use_8bitmime", DT_BOOL, R_NONE, OPTUSE8BITMIME, 0 }, -+ { "use_8bitmime", DT_BOOL, R_NONE, OPTUSE8BITMIME, 1 }, - /* - ** .pp - ** \fBWarning:\fP do not set this variable unless you are using a version diff --git a/chinese/mutt/files/patch-mbyte.c b/chinese/mutt/files/patch-mbyte.c deleted file mode 100644 index d9698b86a7f9..000000000000 --- a/chinese/mutt/files/patch-mbyte.c +++ /dev/null @@ -1,135 +0,0 @@ ---- mbyte.c.orig 2016-10-09 03:35:50.000000000 +0800 -+++ mbyte.c 2016-12-02 11:18:42.600658000 +0800 -@@ -24,6 +24,9 @@ - # include "config.h" - #endif - -+/* -+ * Trad. Chinese (Big5) support by yjchou@linux.cis.nctu.edu.tw -+ */ - #include "mutt.h" - #include "mbyte.h" - #include "charset.h" -@@ -39,6 +42,7 @@ - int Charset_is_utf8 = 0; - #ifndef HAVE_WC_FUNCS - static int charset_is_ja = 0; -+static int charset_is_big5 = 0; - static iconv_t charset_to_utf8 = (iconv_t)(-1); - static iconv_t charset_from_utf8 = (iconv_t)(-1); - #endif -@@ -52,6 +56,7 @@ void mutt_set_charset (char *charset) - Charset_is_utf8 = 0; - #ifndef HAVE_WC_FUNCS - charset_is_ja = 0; -+ charset_is_big5 = 0; - if (charset_to_utf8 != (iconv_t)(-1)) - { - iconv_close (charset_to_utf8); -@@ -82,6 +87,14 @@ void mutt_set_charset (char *charset) - charset_from_utf8 = mutt_iconv_open (charset, "utf-8", 0); - } - #endif -+#ifndef HAVE_WC_FUNCS -+ else if (!strcmp(buffer, "big5")) -+ { -+ charset_is_big5 = 1; -+ charset_to_utf8 = iconv_open ("UTF-8", charset); -+ charset_from_utf8 = iconv_open (charset, "UTF-8"); -+ } -+#endif - - #if defined(HAVE_BIND_TEXTDOMAIN_CODESET) && defined(ENABLE_NLS) - bind_textdomain_codeset(PACKAGE, buffer); -@@ -256,7 +269,7 @@ size_t mbrtowc (wchar_t *pwc, const char - - int iswprint (wint_t wc) - { -- if (Charset_is_utf8 || charset_is_ja) -+ if (Charset_is_utf8 || charset_is_ja || charset_is_big5) - return ((0x20 <= wc && wc < 0x7f) || 0xa0 <= wc); - else - return (0 <= wc && wc < 256) ? IsPrint (wc) : 0; -@@ -264,7 +277,7 @@ int iswprint (wint_t wc) - - int iswspace (wint_t wc) - { -- if (Charset_is_utf8 || charset_is_ja) -+ if (Charset_is_utf8 || charset_is_ja || charset_is_big5) - return (9 <= wc && wc <= 13) || wc == 32; - else - return (0 <= wc && wc < 256) ? isspace (wc) : 0; -@@ -347,7 +360,7 @@ static int iswalpha_ucs (wint_t wc) - - wint_t towupper (wint_t wc) - { -- if (Charset_is_utf8 || charset_is_ja) -+ if (Charset_is_utf8 || charset_is_ja || charset_is_big5) - return towupper_ucs (wc); - else - return (0 <= wc && wc < 256) ? toupper (wc) : wc; -@@ -355,7 +368,7 @@ wint_t towupper (wint_t wc) - - wint_t towlower (wint_t wc) - { -- if (Charset_is_utf8 || charset_is_ja) -+ if (Charset_is_utf8 || charset_is_ja || charset_is_big5) - return towlower_ucs (wc); - else - return (0 <= wc && wc < 256) ? tolower (wc) : wc; -@@ -363,7 +376,7 @@ wint_t towlower (wint_t wc) - - int iswalnum (wint_t wc) - { -- if (Charset_is_utf8 || charset_is_ja) -+ if (Charset_is_utf8 || charset_is_ja || charset_is_big5) - return iswalnum_ucs (wc); - else - return (0 <= wc && wc < 256) ? isalnum (wc) : 0; -@@ -404,13 +417,31 @@ int wcwidth_ja (wchar_t ucs) - return -1; - } - -+int wcwidth_big5(wchar_t ucs) -+{ -+ return wcwidth_ja (ucs); -+} -+ - int wcwidth_ucs(wchar_t ucs); - - int wcwidth (wchar_t wc) - { - if (!Charset_is_utf8) - { -- if (!charset_is_ja) -+ if (charset_is_ja) -+ { -+ /* Japanese */ -+ int k = wcwidth_ja (wc); -+ if (k != -1) -+ return k; -+ } -+ else if (charset_is_big5) -+ { -+ int k = wcwidth_big5 (wc); -+ if (k != -1) -+ return k; -+ } -+ else - { - /* 8-bit case */ - if (!wc) -@@ -420,13 +451,6 @@ int wcwidth (wchar_t wc) - else - return -1; - } -- else -- { -- /* Japanese */ -- int k = wcwidth_ja (wc); -- if (k != -1) -- return k; -- } - } - return wcwidth_ucs (wc); - } diff --git a/chinese/mutt/files/patch-mutt.h b/chinese/mutt/files/patch-mutt.h deleted file mode 100644 index a1f06fc7c22c..000000000000 --- a/chinese/mutt/files/patch-mutt.h +++ /dev/null @@ -1,10 +0,0 @@ ---- mutt.h.orig 2016-12-02 11:18:42.574880000 +0800 -+++ mutt.h 2016-12-02 11:18:42.601038000 +0800 -@@ -342,6 +342,7 @@ enum - OPTATTACHSPLIT, - OPTAUTOEDIT, - OPTAUTOTAG, -+ OPTBBSISLAME, - OPTBEEP, - OPTBEEPNEW, - OPTBOUNCEDELIVERED, diff --git a/chinese/mutt/files/patch-myiconv.c b/chinese/mutt/files/patch-myiconv.c deleted file mode 100644 index 269934a09a2b..000000000000 --- a/chinese/mutt/files/patch-myiconv.c +++ /dev/null @@ -1,170 +0,0 @@ ---- myiconv.c.orig 2016-12-02 11:18:42.601104000 +0800 -+++ myiconv.c 2016-12-02 11:18:42.601603000 +0800 -@@ -0,0 +1,167 @@ -+/* -+ * Contributed by Kuang-che Wu <kcwu@kcwu.dyndns.org> -+ */ -+#if HAVE_CONFIG_H -+# include "config.h" -+#endif -+ -+#include <stdio.h> -+#include <stdlib.h> -+#include "mutt.h" -+#include "charset.h" -+#include <hz.h> -+#include <dlfcn.h> -+ -+ -+ -+#ifdef HAVE_ICONV -+ -+typedef struct myiconv { -+ iconv_t cd; -+ int incode,outcode; -+ int myjob; -+} myiconv_t; -+ -+static int is_init; -+static void *dlh; -+static iconv_t (*old_iconv_open)(const char *tocode, const char *fromcode); -+static size_t (*old_iconv)(iconv_t cd, ICONV_CONST char **inbuf, -+ size_t *inbytesleft, char **outbuf, size_t *outbytesleft); -+static int (*old_iconv_close) (iconv_t cd); -+static int inst; -+ -+static void init(void) -+{ -+ hz_setup(); -+ dlh=dlopen("libiconv.so",RTLD_LAZY); -+ if(dlh) { -+ old_iconv_open=dlsym(dlh,"iconv_open"); -+ old_iconv=dlsym(dlh,"iconv"); -+ old_iconv_close=dlsym(dlh,"iconv_close"); -+ } -+ is_init=1; -+} -+ -+static size_t myconv(ICONV_CONST char **inbuf, -+ size_t *inbytesleft, char **outbuf, size_t *outbytesleft) -+{ -+ /* reference to autogb.c */ -+ int count; -+ char buff[MAX_BUFFER*3]; -+ char *pbuf,*ps; -+ size_t rt=0; -+ -+ pbuf=&buff[2]; -+ -+ count=*inbytesleft; -+ if(count>MAX_BUFFER) count=MAX_BUFFER; -+ memcpy(pbuf,*inbuf,count); -+ *inbuf+=count; -+ *inbytesleft-=count; -+ while(count>0) { -+ rt+=count; -+ ps=hz_convert(pbuf,&count,0); -+ memcpy(*outbuf,ps,count); -+ *outbuf+=count; *outbytesleft+=count; -+ pbuf=&buff[2]; -+ -+ count=*inbytesleft; -+ if(count>MAX_BUFFER) count=MAX_BUFFER; -+ memcpy(pbuf,*inbuf,count); -+ *inbuf+=count; -+ *inbytesleft-=count; -+ } -+ return rt; -+} -+ -+int conv_str(const char* str_code) -+{ -+ int i; -+ char *str; -+ struct mapping { -+ char *code; -+ int value; -+ } map[]={ -+ {"gb2312",GB_CODE}, -+ {"euccn",GB_CODE}, -+ {"big5",BIG5_CODE}, -+ {0,OTHER_CODE}, /* should we handle below cases? */ -+ {"hz",HZ_CODE}, -+ {"uni",UNI_CODE}, -+ {"utf7",UTF7_CODE}, -+ {"utf8",UTF8_CODE}, -+ }; -+ str=strdup(str_code); -+ if(strchr(str,'/')) -+ *strchr(str,'/')=0; -+ for(i=0;map[i].code;i++) -+ if(mutt_chscmp(str,map[i].code)) -+ break; -+ free(str); -+ return map[i].value; -+} -+ -+iconv_t iconv_open (const char *tocode, const char *fromcode) -+{ -+ myiconv_t *mycd=(myiconv_t*)-1; -+ iconv_t cd; -+ char *_tocode, *_fromcode; -+ -+ _tocode = tocode; -+ _fromcode = fromcode; -+ -+ if (!mutt_strcmp(tocode,"big5")) _tocode = "big5-hkscs"; -+ if (!mutt_strcmp(fromcode,"big5")) _fromcode = "big5-hkscs"; -+ -+ if(!is_init) init(); -+ if(!old_iconv_open) -+ return (iconv_t)(-1); -+ -+ if((cd=old_iconv_open(_tocode,_fromcode))!=(iconv_t)-1) { -+ mycd=(myiconv_t*)calloc(1,sizeof(myiconv_t)); -+ mycd->cd=cd; -+ mycd->incode=conv_str(fromcode); -+ mycd->outcode=conv_str(tocode); -+ /* inst==0 is because: -+ libhz only has one stack, and -+ it will destroy all instance's data when setup stack. -+ -+ If want to fix, libhz's init func should know which inst. -+ */ -+ if(inst==0 && mycd->incode!=mycd->outcode && -+ hz_search(mycd->incode,mycd->outcode,8)) { -+ inst++; -+ mycd->myjob=1; -+ } -+ } -+ return (iconv_t)mycd; -+} -+ -+size_t iconv (iconv_t cd, ICONV_CONST char **inbuf, size_t *inbytesleft, -+ char **outbuf, size_t *outbytesleft) -+{ -+ myiconv_t *mycd=(myiconv_t*)cd; -+ size_t rt=(size_t)0; -+ if(mycd->myjob) { -+ if(!inbuf || !*inbuf || !outbuf || !*outbuf) -+ hz_search(mycd->incode,mycd->outcode,8); -+ else -+ rt=myconv(inbuf,inbytesleft,outbuf,outbytesleft); -+ } else if(old_iconv) -+ rt=old_iconv(mycd->cd,inbuf,inbytesleft,outbuf,outbytesleft); -+ return rt; -+} -+ -+int iconv_close (iconv_t cd) -+{ -+ myiconv_t *mycd=(myiconv_t*)cd; -+ if(!old_iconv_close) -+ return 0; -+ old_iconv_close(mycd->cd); -+ if(mycd->myjob) -+ inst--; -+ free(mycd); -+ return 0; -+} -+ -+#endif diff --git a/chinese/mutt/files/patch-pager.c b/chinese/mutt/files/patch-pager.c deleted file mode 100644 index dd389965048a..000000000000 --- a/chinese/mutt/files/patch-pager.c +++ /dev/null @@ -1,41 +0,0 @@ ---- pager.c.orig 2016-10-09 03:35:50.000000000 +0800 -+++ pager.c 2016-12-02 11:21:36.940396000 +0800 -@@ -20,6 +20,10 @@ - # include "config.h" - #endif - -+/* -+ * Trad. Chinese support by Michael Hsin <mhsin@mhsin.org> -+ */ -+ - #include "mutt.h" - #include "mutt_curses.h" - #include "mutt_regex.h" -@@ -1101,7 +1105,7 @@ static int format_line (struct line_t ** - int space = -1; /* index of the last space or TAB */ - int col = option (OPTMARKERS) ? (*lineInfo)[n].continuation : 0; - size_t k; -- int ch, vch, last_special = -1, special = 0, t; -+ int ch, vch, last_special = -1, special = 0, t = 0, old_t = 0; - wchar_t wc; - mbstate_t mbstate; - int wrap_cols = mutt_window_wrap_cols (pager_window, (flags & MUTT_PAGER_NOWRAP) ? 0 : Wrap); -@@ -1223,7 +1227,10 @@ static int format_line (struct line_t ** - * attempt to wrap at this character. */ - wc = ' '; - } -+ old_t = t; - t = wcwidth (wc); -+ if (t > 1 || old_t > 1) -+ space = ch; - if (col + t > wrap_cols) - break; - col += t; -@@ -1447,6 +1454,7 @@ display_line (FILE *f, LOFF_T *last_pos, - { - buf_ptr = buf + ch; - /* skip trailing blanks */ -+ ch--; - while (ch && (buf[ch] == ' ' || buf[ch] == '\t' || buf[ch] == '\r')) - ch--; - /* a very long word with leading spaces causes infinite wrapping */ diff --git a/chinese/mutt/files/patch-parse.c b/chinese/mutt/files/patch-parse.c deleted file mode 100644 index 7d8c1c388703..000000000000 --- a/chinese/mutt/files/patch-parse.c +++ /dev/null @@ -1,14 +0,0 @@ ---- parse.c.orig 2016-10-09 03:30:21.000000000 +0800 -+++ parse.c 2016-12-02 11:18:42.603025000 +0800 -@@ -393,7 +393,10 @@ static void parse_content_disposition (c - { - s = skip_email_wsp(s + 1); - if ((s = mutt_get_parameter ("filename", (parms = parse_parameters (s))))) -- mutt_str_replace (&ct->filename, s); -+ { -+ mutt_str_replace (&ct->filename, s); -+ rfc2047_decode (&ct->filename); -+ } - if ((s = mutt_get_parameter ("name", parms))) - ct->form_name = safe_strdup (s); - mutt_free_parameter (&parms); diff --git a/chinese/mutt/files/patch-pgp.c b/chinese/mutt/files/patch-pgp.c deleted file mode 100644 index bb508a8d26f2..000000000000 --- a/chinese/mutt/files/patch-pgp.c +++ /dev/null @@ -1,11 +0,0 @@ ---- pgp.c.orig 2016-10-09 03:30:21.000000000 +0800 -+++ pgp.c 2016-12-02 11:18:42.603476000 +0800 -@@ -1154,7 +1154,7 @@ BODY *pgp_sign_message (BODY *a) - int empty = 1; - pid_t thepid; - -- convert_to_7bit (a); /* Signed data _must_ be in 7-bit format. */ -+ if (!option(OPTBBSISLAME)) convert_to_7bit (a); /* Signed data _must_ be in 7-bit format. */ - - mutt_mktemp (sigfile, sizeof (sigfile)); - if ((fp = safe_fopen (sigfile, "w")) == NULL) diff --git a/chinese/mutt/files/patch-sendlib.c b/chinese/mutt/files/patch-sendlib.c deleted file mode 100644 index d030e214800e..000000000000 --- a/chinese/mutt/files/patch-sendlib.c +++ /dev/null @@ -1,11 +0,0 @@ ---- sendlib.c.orig 2016-12-02 11:18:42.515424000 +0800 -+++ sendlib.c 2016-12-02 11:18:42.605557000 +0800 -@@ -2494,7 +2494,7 @@ void mutt_prepare_envelope (ENVELOPE *en - rfc2047_encode_adrlist (env->reply_to, "Reply-To"); - rfc2047_encode_string (&env->x_label); - -- if (env->subject) -+ if (env->subject && !option(OPTBBSISLAME)) - { - rfc2047_encode_string (&env->subject); - } diff --git a/chinese/mutt/pkg-message b/chinese/mutt/pkg-message deleted file mode 100644 index 76f182cb1123..000000000000 --- a/chinese/mutt/pkg-message +++ /dev/null @@ -1,18 +0,0 @@ -Check the following lines in your ~/.muttrc if you're migrating from -mutt 1.2.x. - -set charset=big5 -set locale="zh_TW.Big5" -set send_charset="us-ascii:iso-8859-1:big5:gb2312:utf-8:x-unknown" -charset-hook us-ascii big5 -charset-hook iso-8859-1 big5 - -Please execute the following command if you encounter problem with -legacy bbs: - -echo "set bbsislame=yes" >> ~/.muttrc - -If you have to send signed mail to outlook users, please execute the -following command: - -echo "set pgp_outlook_compat=yes" >> ~/.muttrc |