From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Nov 11 08:50:08 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B51D01065673 for ; Fri, 11 Nov 2011 08:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8D6A38FC1A for ; Fri, 11 Nov 2011 08:50:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id pAB8o728025966 for ; Fri, 11 Nov 2011 08:50:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id pAB8o7fk025965; Fri, 11 Nov 2011 08:50:07 GMT (envelope-from gnats) Resent-Date: Fri, 11 Nov 2011 08:50:07 GMT Resent-Message-Id: <201111110850.pAB8o7fk025965@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Zhihao Yuan Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45FB3106564A for ; Fri, 11 Nov 2011 08:49:08 +0000 (UTC) (envelope-from lichray@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 11C758FC1C for ; Fri, 11 Nov 2011 08:49:07 +0000 (UTC) Received: by iakl21 with SMTP id l21so3448329iak.13 for ; Fri, 11 Nov 2011 00:49:07 -0800 (PST) Received: by 10.50.88.199 with SMTP id bi7mr11478269igb.45.1321001347373; Fri, 11 Nov 2011 00:49:07 -0800 (PST) Received: from elitebook.hp (c-98-228-191-105.hsd1.il.comcast.net. [98.228.191.105]) by mx.google.com with ESMTPS id ew6sm8350502igc.4.2011.11.11.00.49.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Nov 2011 00:49:06 -0800 (PST) Received: by elitebook.hp (sSMTP sendmail emulation); Fri, 11 Nov 2011 02:49:03 -0600 Message-Id: <4ebce182.c6b8320a.76e0.2aae@mx.google.com> Date: Fri, 11 Nov 2011 02:49:03 -0600 From: Zhihao Yuan To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/162465: [PATCH] Make sunpinyin 2.0.4-compatible, XDG-compatible, etc. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Zhihao Yuan List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Nov 2011 08:50:08 -0000 >Number: 162465 >Category: ports >Synopsis: [PATCH] Make sunpinyin 2.0.4-compatible, XDG-compatible, etc. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Fri Nov 11 08:50:07 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Zhihao Yuan >Release: FreeBSD 8.2-STABLE amd64 >Organization: Northern Illinois University >Environment: System: FreeBSD elitebook.hp 8.2-STABLE FreeBSD 8.2-STABLE #3: Sun Oct 30 03:43:12 CDT 2011 lichray@elitebook.hp:/usr/obj/home/lichray/devel/freebsd-8/sys/HOUKAGO amd64 >Description: 1. patch-2.0.4-compatible sunpinyin-2.0.4 is not released, but I'm porting a front-end which uses several changes from the newer version. This patch is enough. 2. patch-xdg Change the config dir from .sunpinyin to .config/sunpinyin. It's safe because we have no front-ends in ports tree, so no one has these configured :) 3. patch-src... Remove the unneeded and repeated message on terminal. >How-To-Repeat: >Fix: --- sunpinyin-2.0.3_1.patch begins here --- diff -ruN --exclude=CVS /usr/ports/chinese/sunpinyin.orig/Makefile /usr/ports/chinese/sunpinyin/Makefile --- /usr/ports/chinese/sunpinyin.orig/Makefile 2011-11-10 20:46:15.000000000 -0600 +++ /usr/ports/chinese/sunpinyin/Makefile 2011-11-10 22:40:43.167388774 -0600 @@ -7,6 +7,7 @@ PORTNAME= sunpinyin PORTVERSION= 2.0.3 +PORTREVISION= 1 CATEGORIES= chinese devel MASTER_SITES= ${MASTER_SITE_GOOGLE_CODE}:1 \ http://open-gram.googlecode.com/files/:2 diff -ruN --exclude=CVS /usr/ports/chinese/sunpinyin.orig/files/patch-2.0.4-compatible /usr/ports/chinese/sunpinyin/files/patch-2.0.4-compatible --- /usr/ports/chinese/sunpinyin.orig/files/patch-2.0.4-compatible 1969-12-31 18:00:00.000000000 -0600 +++ /usr/ports/chinese/sunpinyin/files/patch-2.0.4-compatible 2011-11-10 23:05:36.750075415 -0600 @@ -0,0 +1,88 @@ +--- src/ime-core/imi_view_classic.h.orig 2011-02-17 21:39:52.000000000 -0600 ++++ src/ime-core/imi_view_classic.h 2011-11-10 23:00:20.374788681 -0600 +@@ -61,6 +61,9 @@ public: + virtual int onCandidatePageRequest(int pgno, bool relative); + virtual int onCandidateSelectRequest(int index); + ++ void makeSelection(int candiIdx, unsigned& mask); ++ void deleteCandidate(int candiIdx, unsigned& mask); ++ + private: + unsigned m_cursorFrIdx; + unsigned m_candiFrIdx; +@@ -75,8 +78,6 @@ private: + inline void _erase (bool backward, unsigned& mask); + + inline void _getCandidates (); +- inline void _makeSelection (int candiIdx, unsigned& mask); +- inline void _deleteCandidate (int candiIdx, unsigned& mask); + + inline void _commitChar (TWCHAR ch); + inline void _commitString (const wstring& wstr); +--- src/ime-core/imi_view_classic.cpp.orig 2011-02-17 21:39:52.000000000 -0600 ++++ src/ime-core/imi_view_classic.cpp 2011-11-10 23:01:01.213605402 -0600 +@@ -168,7 +168,7 @@ CIMIClassicView::onKeyEvent(const CKeyEv + !m_pIC->isEmpty ()) { + changeMasks |= KEYEVENT_USED; + unsigned sel = (keyvalue == '0'? 9: keyvalue-'1'); +- _deleteCandidate (sel, changeMasks); ++ deleteCandidate (sel, changeMasks); + goto PROCESSED; + + } else if ((modifiers & (IM_CTRL_MASK | IM_ALT_MASK | IM_SUPER_MASK | IM_RELEASE_MASK)) == 0) { +@@ -177,7 +177,7 @@ CIMIClassicView::onKeyEvent(const CKeyEv + if (!m_pIC->isEmpty ()) { + changeMasks |= KEYEVENT_USED; + unsigned sel = (keyvalue == '0'? 9: keyvalue-'1'); +- _makeSelection (sel, changeMasks); ++ makeSelection (sel, changeMasks); + } else { + m_numeric_mode = true; + } +@@ -216,7 +216,7 @@ CIMIClassicView::onKeyEvent(const CKeyEv + } else if (keycode == IM_VK_SPACE) { + if (!m_pIC->isEmpty ()) { + changeMasks |= KEYEVENT_USED; +- _makeSelection (0, changeMasks); ++ makeSelection (0, changeMasks); + } else { + wstring wstr = (m_pIC->fullPuncOp()) (keyvalue); + if (wstr.size()) { +@@ -327,7 +327,7 @@ CIMIClassicView::onCandidateSelectReques + unsigned changeMasks = 0; + + if (!m_pIC->isEmpty()) +- _makeSelection(index, changeMasks); ++ makeSelection(index, changeMasks); + + updateWindows(changeMasks); + return 0; +@@ -612,7 +612,7 @@ CIMIClassicView::_moveEnd (unsigned& mas + } + + void +-CIMIClassicView::_makeSelection (int candiIdx, unsigned& mask) ++CIMIClassicView::makeSelection (int candiIdx, unsigned& mask) + { + candiIdx += m_candiPageFirst; + if (!m_tailSentence.empty ()) --candiIdx; +@@ -655,7 +655,7 @@ CIMIClassicView::_makeSelection (int can + } + + void +-CIMIClassicView::_deleteCandidate (int candiIdx, unsigned& mask) ++CIMIClassicView::deleteCandidate (int candiIdx, unsigned& mask) + { + candiIdx += m_candiPageFirst; + if (!m_tailSentence.empty ()) --candiIdx; +--- src/ime-core/imi_view.h.orig 2011-02-17 21:39:52.000000000 -0600 ++++ src/ime-core/imi_view.h 2011-11-10 23:05:14.515633839 -0600 +@@ -188,7 +188,7 @@ public: + CIMIWinHandler* getWinHandler(void) {return m_pWinHandler;} + + void setHotkeyProfile (CHotkeyProfile *prof) { m_pHotkeyProfile = prof;} +- void setCandiWindowSize (unsigned size) {m_candiWindowSize = size<10? size: 10;} ++ void setCandiWindowSize (unsigned size) {m_candiWindowSize = size;} + CHotkeyProfile* getHotkeyProfile() { return m_pHotkeyProfile; } + unsigned getCandiWindowSize() { return m_candiWindowSize; } + diff -ruN --exclude=CVS /usr/ports/chinese/sunpinyin.orig/files/patch-src_ime-core_imi__winHandler.cpp /usr/ports/chinese/sunpinyin/files/patch-src_ime-core_imi__winHandler.cpp --- /usr/ports/chinese/sunpinyin.orig/files/patch-src_ime-core_imi__winHandler.cpp 1969-12-31 18:00:00.000000000 -0600 +++ /usr/ports/chinese/sunpinyin/files/patch-src_ime-core_imi__winHandler.cpp 2011-11-11 02:31:36.212515692 -0600 @@ -0,0 +1,16 @@ +--- ./src/ime-core/imi_winHandler.cpp~ 2011-02-17 21:39:52.000000000 -0600 ++++ ./src/ime-core/imi_winHandler.cpp 2011-11-11 02:29:45.163309361 -0600 +@@ -85,6 +85,7 @@ CIMIWinHandler::throwBackKey(unsigned ke + void + CIMIWinHandler::updateStatus(int key, int value) + { ++#ifdef DEBUG + switch (key) { + case STATUS_ID_CN: + printf("CN status is "); break; +@@ -99,4 +100,5 @@ CIMIWinHandler::updateStatus(int key, in + + printf("%d\n", value); + fflush(stdout); ++#endif + } diff -ruN --exclude=CVS /usr/ports/chinese/sunpinyin.orig/files/patch-xdg /usr/ports/chinese/sunpinyin/files/patch-xdg --- /usr/ports/chinese/sunpinyin.orig/files/patch-xdg 1969-12-31 18:00:00.000000000 -0600 +++ /usr/ports/chinese/sunpinyin/files/patch-xdg 2011-11-10 23:09:34.000000000 -0600 @@ -0,0 +1,29 @@ +diff -uNr src/ime-core/imi_options.cpp src/ime-core/imi_options.cpp +--- src/ime-core/imi_options.cpp 2010-09-22 13:14:32.876000000 +0800 ++++ src/ime-core/imi_options.cpp 2010-09-22 13:21:48.181000000 +0800 +@@ -73,8 +73,11 @@ + + if (!m_user_data_dir.size()) { + char path[256]; +- const char *home = getenv ("HOME"); +- snprintf (path, sizeof(path), "%s/%s", home, SUNPINYIN_USERDATA_DIR_PREFIX); ++ const char *home = getenv ("XDG_CONFIG_HOME"); ++ if(home == NULL) ++ snprintf (path, sizeof(path), "%s/.config/%s", getenv("HOME"), SUNPINYIN_USERDATA_DIR_PREFIX); ++ else ++ snprintf (path, sizeof(path), "%s/%s", home, SUNPINYIN_USERDATA_DIR_PREFIX); + m_user_data_dir = path; + } + +diff -uNr src/ime-core/imi_options.h src/ime-core/imi_options.h +--- src/ime-core/imi_options.h 2010-09-22 13:14:35.883000000 +0800 ++++ src/ime-core/imi_options.h 2010-09-22 13:15:20.760000002 +0800 +@@ -50,7 +50,7 @@ + #include "pinyin/shuangpin_seg.h" + + #ifndef SUNPINYIN_USERDATA_DIR_PREFIX +-#define SUNPINYIN_USERDATA_DIR_PREFIX ".sunpinyin" ++#define SUNPINYIN_USERDATA_DIR_PREFIX "sunpinyin" + #endif + + struct CSimplifiedChinesePolicy : public IConfigurable --- sunpinyin-2.0.3_1.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: