aboutsummaryrefslogtreecommitdiff
path: root/chinese
diff options
context:
space:
mode:
authorAntoine Brodin <antoine@FreeBSD.org>2021-01-01 10:11:34 +0000
committerAntoine Brodin <antoine@FreeBSD.org>2021-01-01 10:11:34 +0000
commit26b4c8f71f91d22e081b27814782686edde0c90a (patch)
tree1c321c39372c25d8634e75b5c8e08edc676b296d /chinese
parent548f16bd1a2915f08878b716eed92ff3267e6de2 (diff)
downloadports-26b4c8f71f91d22e081b27814782686edde0c90a.tar.gz
ports-26b4c8f71f91d22e081b27814782686edde0c90a.zip
Revert r559792 to unbreak INDEX and bulk -a
It seems a lot of reverse dependencies were missed With hat: portmgr
Notes
Notes: svn path=/head/; revision=559822
Diffstat (limited to 'chinese')
-rw-r--r--chinese/Makefile1
-rw-r--r--chinese/sunpinyin/Makefile38
-rw-r--r--chinese/sunpinyin/distinfo6
-rw-r--r--chinese/sunpinyin/files/patch-SConstruct34
-rw-r--r--chinese/sunpinyin/files/patch-man_SConscript11
-rw-r--r--chinese/sunpinyin/files/patch-src_ime-core_imi__winHandler.cpp18
-rw-r--r--chinese/sunpinyin/files/patch-src_portability.h10
-rw-r--r--chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp17
-rw-r--r--chinese/sunpinyin/files/patch-src_sunpinyin-dictgen.mk.in26
-rw-r--r--chinese/sunpinyin/files/patch-xdg35
-rw-r--r--chinese/sunpinyin/pkg-descr5
-rw-r--r--chinese/sunpinyin/pkg-plist51
12 files changed, 252 insertions, 0 deletions
diff --git a/chinese/Makefile b/chinese/Makefile
index 4caa9330887f..465da7bcc5b1 100644
--- a/chinese/Makefile
+++ b/chinese/Makefile
@@ -130,6 +130,7 @@
SUBDIR += sourcehansans-tc-otf
SUBDIR += sourcehanserif-sc-otf
SUBDIR += sourcehanserif-tc-otf
+ SUBDIR += sunpinyin
SUBDIR += taipeisanstc
SUBDIR += tin
SUBDIR += tintin++
diff --git a/chinese/sunpinyin/Makefile b/chinese/sunpinyin/Makefile
new file mode 100644
index 000000000000..9bedb7c52bee
--- /dev/null
+++ b/chinese/sunpinyin/Makefile
@@ -0,0 +1,38 @@
+# Created by: Zhihao Yuan <lichray@gmail.com>
+# $FreeBSD$
+
+PORTNAME= sunpinyin
+DISTVERSION= 2.0.4rc3
+PORTREVISION= 1
+CATEGORIES= chinese devel
+MASTER_SITES= SF/open-gram:2
+DISTFILES= lm_sc.3gm.arpa-20140820.tar.bz2:2 dict.utf8-20131214.tar.bz2:2
+
+MAINTAINER= lichray@gmail.com
+COMMENT= Statistical language model based input method engine
+
+LICENSE= LGPL21 CDDL
+LICENSE_COMB= dual
+
+LIB_DEPENDS= libsqlite3.so:databases/sqlite3
+
+USE_GITHUB= yes
+GH_TAGNAME= a8bd811
+
+MAKE_ARGS+= --prefix=${PREFIX}
+USE_LDCONFIG= yes
+USES= gmake iconv perl5 pkgconfig python:2.7 scons:python2 shebangfix
+USE_PERL5= build
+SHEBANG_FILES= python/*.py
+LDFLAGS+= -L${LOCALBASE}/lib ${ICONV_LIB}
+INSTALL_TARGET= install-lib install-headers --install-sandbox=${STAGEDIR}
+
+post-install:
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libsunpinyin.so.3.0
+ ${SETENV} PATH=${WRKSRC}/src:$${PATH} ${GMAKE} -C ${WRKDIR} \
+ -f ${WRKSRC}/src/sunpinyin-dictgen.mk STAGEDIR=${STAGEDIR}
+ ${INSTALL} -d ${STAGEDIR}${DATADIR}
+ ${INSTALL_DATA} ${WRKDIR}/lm_sc.t3g ${WRKDIR}/pydict_sc.bin \
+ ${STAGEDIR}${DATADIR}
+
+.include <bsd.port.mk>
diff --git a/chinese/sunpinyin/distinfo b/chinese/sunpinyin/distinfo
new file mode 100644
index 000000000000..40a469cdf7b0
--- /dev/null
+++ b/chinese/sunpinyin/distinfo
@@ -0,0 +1,6 @@
+SHA256 (sunpinyin-sunpinyin-2.0.4rc3-a8bd811_GH0.tar.gz) = 762575e71a5e24c4efc291407302a161ad51b8bf8902d952b54076f4511997ef
+SIZE (sunpinyin-sunpinyin-2.0.4rc3-a8bd811_GH0.tar.gz) = 547083
+SHA256 (lm_sc.3gm.arpa-20140820.tar.bz2) = 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
+SIZE (lm_sc.3gm.arpa-20140820.tar.bz2) = 36623028
+SHA256 (dict.utf8-20131214.tar.bz2) = af70bc2bcd7af7468495774fed9e3a2de434650119fbc3d3388c2bcf7e0acb01
+SIZE (dict.utf8-20131214.tar.bz2) = 674512
diff --git a/chinese/sunpinyin/files/patch-SConstruct b/chinese/sunpinyin/files/patch-SConstruct
new file mode 100644
index 000000000000..ffd859c026ff
--- /dev/null
+++ b/chinese/sunpinyin/files/patch-SConstruct
@@ -0,0 +1,34 @@
+--- SConstruct.orig 2014-11-14 14:17:48 UTC
++++ SConstruct
+@@ -215,10 +215,11 @@ def CreateEnvironment():
+ make = 'gmake'
+ tar = 'gtar'
+ libln_builder = Builder(action='cd ${TARGET.dir} && ln -s ${SOURCE.name} ${TARGET.name}')
+- env = Environment(ENV=os.environ, CFLAGS=cflags, CXXFLAGS='',
++ env = Environment(ENV=os.environ,
+ MAKE=make, WGET=wget, W3M=w3m, TAR=tar,
+- CPPPATH=['.'] + allinc(),
+- tools=['default', 'textfile'])
++ tools=['default', 'textfile'],
++ **ARGUMENTS)
++ env['CPPPATH'] = ['.'] + allinc()
+ env.Append(BUILDERS={'InstallAsSymlink': libln_builder})
+ env['ENDIANNESS'] = "be" if sys.byteorder == "big" else "le"
+ return env
+@@ -375,7 +376,6 @@ def DoConfigure():
+ conf.CheckFunc('getopt_long')
+ conf.CheckFunc('getpagesize')
+ conf.CheckFunc('get_opt')
+- conf.CheckCHeader('iconv.h')
+ conf.CheckCHeader('inttypes.h')
+ conf.CheckCHeader('locale.h')
+ conf.CheckCHeader('libintl.h')
+@@ -463,7 +463,7 @@ def DoInstall():
+ lib_target_bin),
+ ]
+
+- lib_pkgconfig_target = env.Install(os.path.join(libdir, 'pkgconfig'),
++ lib_pkgconfig_target = env.Install(os.path.join(env['PREFIX'], 'libdata/pkgconfig'),
+ ['sunpinyin-2.0.pc'])
+ bin_target = env.Install(bindir, bins)
+ man1_target = env.Install(man1dir, man1s)
diff --git a/chinese/sunpinyin/files/patch-man_SConscript b/chinese/sunpinyin/files/patch-man_SConscript
new file mode 100644
index 000000000000..e04f8c8623af
--- /dev/null
+++ b/chinese/sunpinyin/files/patch-man_SConscript
@@ -0,0 +1,11 @@
+--- man/SConscript.orig 2014-11-14 14:17:48 UTC
++++ man/SConscript
+@@ -1,7 +1,7 @@
+ import os
+ Import('env')
+
+-pod2man = Builder(action = 'pod2man < $SOURCE > $TARGET')
++pod2man = Builder(action = 'pod2man $SOURCE $TARGET')
+ env.Append(BUILDERS = {'Man': pod2man})
+
+ env.Man('mmseg.1', 'mmseg.pod')
diff --git a/chinese/sunpinyin/files/patch-src_ime-core_imi__winHandler.cpp b/chinese/sunpinyin/files/patch-src_ime-core_imi__winHandler.cpp
new file mode 100644
index 000000000000..74fdf4f2fa59
--- /dev/null
+++ b/chinese/sunpinyin/files/patch-src_ime-core_imi__winHandler.cpp
@@ -0,0 +1,18 @@
+--- src/ime-core/imi_winHandler.cpp.orig 2014-11-14 14:17:48 UTC
++++ src/ime-core/imi_winHandler.cpp
+@@ -87,6 +87,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;
+@@ -101,6 +102,7 @@ CIMIWinHandler::updateStatus(int key, in
+
+ printf("%d\n", value);
+ fflush(stdout);
++#endif
+ }
+
+ // -*- indent-tabs-mode: nil -*- vim:et:ts=4
diff --git a/chinese/sunpinyin/files/patch-src_portability.h b/chinese/sunpinyin/files/patch-src_portability.h
new file mode 100644
index 000000000000..93c117af2c66
--- /dev/null
+++ b/chinese/sunpinyin/files/patch-src_portability.h
@@ -0,0 +1,10 @@
+--- src/portability.h.orig 2014-11-14 14:17:48 UTC
++++ src/portability.h
+@@ -42,6 +42,7 @@
+ #include <stdio.h>
+ #include <math.h>
+ #include <stdint.h>
++#include <stdlib.h>
+ #include <string>
+ #include <cstring>
+
diff --git a/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp b/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp
new file mode 100644
index 000000000000..723c45843d74
--- /dev/null
+++ b/chinese/sunpinyin/files/patch-src_slm_thread_slmthread.cpp
@@ -0,0 +1,17 @@
+--- src/slm/thread/slmthread.cpp.orig 2014-11-14 14:17:48 UTC
++++ src/slm/thread/slmthread.cpp
+@@ -250,10 +250,10 @@ main(int argc, char* argv[])
+
+ bool usingLogPr = slm.isUseLogPr();
+
+- #define EffectivePr(a) (float((usingLogPr) ? ((a) / log(2.0)) : (-log2((a)))))
+- #define OriginalPr(b) (float((usingLogPr) ? ((b) * log(2.0)) : (exp2(-(b)))))
+- #define EffectiveBow(a) (float((usingLogPr) ? (exp(-(a))) : ((a))))
+- #define OriginalBow(b) (float((usingLogPr) ? (-log((b))) : ((b))))
++ #define EffectivePr(a) (float((usingLogPr) ? ((a) / logf(2.0f)) : (-log2f((a)))))
++ #define OriginalPr(b) (float((usingLogPr) ? ((b) * logf(2.0f)) : (exp2f(-(b)))))
++ #define EffectiveBow(a) (float((usingLogPr) ? (expf(-(a))) : ((a))))
++ #define OriginalBow(b) (float((usingLogPr) ? (-logf((b))) : ((b))))
+
+ printf("\nfirst pass..."); fflush(stdout);
+ for (int lvl = 0; lvl <= slm.getN(); ++lvl) {
diff --git a/chinese/sunpinyin/files/patch-src_sunpinyin-dictgen.mk.in b/chinese/sunpinyin/files/patch-src_sunpinyin-dictgen.mk.in
new file mode 100644
index 000000000000..4372c17738ef
--- /dev/null
+++ b/chinese/sunpinyin/files/patch-src_sunpinyin-dictgen.mk.in
@@ -0,0 +1,26 @@
+--- src/sunpinyin-dictgen.mk.in.orig 2014-11-14 14:17:48 UTC
++++ src/sunpinyin-dictgen.mk.in
+@@ -42,22 +42,7 @@ DL_ROOT = ${DL_HOST}/open-gram
+ DICT_PAT = 'dict\.utf8-[0-9]\+.tar.bz2'
+ SLM_PAT = 'lm_sc\.3gm\.arpa-[0-9]\+.tar.bz2'
+
+-DICT_AR = $(shell ${W3M} ${DL_LIST} | grep -o ${DICT_PAT} | sort | tail -n 1)
+-SLM_AR = $(shell ${W3M} ${DL_LIST} | grep -o ${SLM_PAT} | sort | tail -n 1)
+-
+-all: install
+-
+-${DICT_AR}:
+- ${WGET} ${DL_ROOT}/$@
+-
+-dict.utf8: ${DICT_AR}
+- ${TAR} xmf $^
+-
+-${SLM_AR}:
+- ${WGET} ${DL_ROOT}/$@
+-
+-lm_sc.3gm.arpa: ${SLM_AR}
+- ${TAR} xmf $^
++all: lm_sc.t3g pydict_sc.bin
+
+ lm_sc.3gm: lm_sc.3gm.arpa dict.utf8
+ slmpack $^ $@
diff --git a/chinese/sunpinyin/files/patch-xdg b/chinese/sunpinyin/files/patch-xdg
new file mode 100644
index 000000000000..452c3aacb46f
--- /dev/null
+++ b/chinese/sunpinyin/files/patch-xdg
@@ -0,0 +1,35 @@
+--- src/ime-core/imi_options.cpp.orig 2014-11-14 14:17:48 UTC
++++ src/ime-core/imi_options.cpp
+@@ -73,12 +73,15 @@ CSimplifiedChinesePolicy::loadResources(
+
+ 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;
+ }
+
+--- src/ime-core/imi_options.h.orig 2014-11-14 14:17:48 UTC
++++ src/ime-core/imi_options.h
+@@ -52,7 +52,7 @@
+ #include "pinyin/hunpin_seg.h"
+
+ #ifndef SUNPINYIN_USERDATA_DIR_PREFIX
+-#define SUNPINYIN_USERDATA_DIR_PREFIX ".sunpinyin"
++#define SUNPINYIN_USERDATA_DIR_PREFIX "sunpinyin"
+ #endif
+
+ struct CSimplifiedChinesePolicy : public IConfigurable {
diff --git a/chinese/sunpinyin/pkg-descr b/chinese/sunpinyin/pkg-descr
new file mode 100644
index 000000000000..5e010cf93aa0
--- /dev/null
+++ b/chinese/sunpinyin/pkg-descr
@@ -0,0 +1,5 @@
+SunPinyin is a statistical language model based Chinese input method, which
+was firstly developed by Sun Beijing Globalization team, and opensource'd
+to community with OpenSolaris project, with LGPLv2 and CDDL dual-licenses.
+
+WWW: http://code.google.com/p/sunpinyin/
diff --git a/chinese/sunpinyin/pkg-plist b/chinese/sunpinyin/pkg-plist
new file mode 100644
index 000000000000..9d178553e762
--- /dev/null
+++ b/chinese/sunpinyin/pkg-plist
@@ -0,0 +1,51 @@
+include/sunpinyin-2.0/ime-core/ic_history.h
+include/sunpinyin-2.0/ime-core/imi_context.h
+include/sunpinyin-2.0/ime-core/imi_data.h
+include/sunpinyin-2.0/ime-core/imi_defines.h
+include/sunpinyin-2.0/ime-core/imi_funcobjs.h
+include/sunpinyin-2.0/ime-core/imi_glibHandler.h
+include/sunpinyin-2.0/ime-core/imi_keys.h
+include/sunpinyin-2.0/ime-core/imi_option_event.h
+include/sunpinyin-2.0/ime-core/imi_option_keys.h
+include/sunpinyin-2.0/ime-core/imi_options.h
+include/sunpinyin-2.0/ime-core/imi_uiobjects.h
+include/sunpinyin-2.0/ime-core/imi_view.h
+include/sunpinyin-2.0/ime-core/imi_view_classic.h
+include/sunpinyin-2.0/ime-core/imi_winHandler.h
+include/sunpinyin-2.0/ime-core/lattice_states.h
+include/sunpinyin-2.0/ime-core/userdict.h
+include/sunpinyin-2.0/ime-core/utils.h
+include/sunpinyin-2.0/lexicon/pytrie.h
+include/sunpinyin-2.0/lexicon/pytrie_gen.h
+include/sunpinyin-2.0/lexicon/trie_writer.h
+include/sunpinyin-2.0/pinyin/datrie.h
+include/sunpinyin-2.0/pinyin/datrie_impl.h
+include/sunpinyin-2.0/pinyin/hunpin_seg.h
+include/sunpinyin-2.0/pinyin/pinyin_data.h
+include/sunpinyin-2.0/pinyin/pinyin_seg.h
+include/sunpinyin-2.0/pinyin/quanpin_trie.h
+include/sunpinyin-2.0/pinyin/segmentor.h
+include/sunpinyin-2.0/pinyin/shuangpin_data.h
+include/sunpinyin-2.0/pinyin/shuangpin_seg.h
+include/sunpinyin-2.0/pinyin/syllable.h
+include/sunpinyin-2.0/portability.h
+include/sunpinyin-2.0/slm/ids2ngram/idngram.h
+include/sunpinyin-2.0/slm/ids2ngram/idngram_merge.h
+include/sunpinyin-2.0/slm/sim_dict.h
+include/sunpinyin-2.0/slm/sim_fmerge.h
+include/sunpinyin-2.0/slm/sim_sen.h
+include/sunpinyin-2.0/slm/sim_slm.h
+include/sunpinyin-2.0/slm/slm.h
+include/sunpinyin-2.0/slm/slmbuild/sim_slmbuilder.h
+include/sunpinyin-2.0/slm/slmpack/arpa_slm.h
+include/sunpinyin-2.0/slm/slmpack/common.h
+include/sunpinyin-2.0/slm/thread/ValueCompress.h
+include/sunpinyin-2.0/slm/tslmendian/slm_file.h
+include/sunpinyin-2.0/slm/tslmendian/writer.h
+include/sunpinyin-2.0/sunpinyin.h
+lib/libsunpinyin.so
+lib/libsunpinyin.so.3
+lib/libsunpinyin.so.3.0
+libdata/pkgconfig/sunpinyin-2.0.pc
+%%DATADIR%%/lm_sc.t3g
+%%DATADIR%%/pydict_sc.bin