aboutsummaryrefslogtreecommitdiffstats
path: root/chinese/sunpinyin
diff options
context:
space:
mode:
authorvanilla <vanilla@FreeBSD.org>2015-04-07 17:42:28 +0800
committervanilla <vanilla@FreeBSD.org>2015-04-07 17:42:28 +0800
commit843194e8eea512ce85321b2e343868ee80ac0436 (patch)
tree84110f1d5e363d5e99c882bdadaa5df658487b61 /chinese/sunpinyin
parent7b24f30bafb4ef9c1244c88570e0ffb2eb2e67d9 (diff)
downloadfreebsd-ports-gnome-843194e8eea512ce85321b2e343868ee80ac0436.tar.gz
freebsd-ports-gnome-843194e8eea512ce85321b2e343868ee80ac0436.tar.zst
freebsd-ports-gnome-843194e8eea512ce85321b2e343868ee80ac0436.zip
1: upgrade to 2.0.4rc3.
2: unBROKEN. 3: move to GITHUB. PR: 199105 Submitted by: maintainer
Diffstat (limited to 'chinese/sunpinyin')
-rw-r--r--chinese/sunpinyin/Makefile32
-rw-r--r--chinese/sunpinyin/distinfo12
-rw-r--r--chinese/sunpinyin/files/patch-SConstruct34
-rw-r--r--chinese/sunpinyin/files/patch-raw_Makefile21
-rw-r--r--chinese/sunpinyin/files/patch-src_sunpinyin-dictgen.mk.in26
-rw-r--r--chinese/sunpinyin/pkg-plist11
6 files changed, 70 insertions, 66 deletions
diff --git a/chinese/sunpinyin/Makefile b/chinese/sunpinyin/Makefile
index e047f51d8084..394b4aadd308 100644
--- a/chinese/sunpinyin/Makefile
+++ b/chinese/sunpinyin/Makefile
@@ -2,15 +2,11 @@
# $FreeBSD$
PORTNAME= sunpinyin
-DISTVERSION= 2.0.4rc2
-PORTREVISION= 1
+DISTVERSION= 2.0.4rc3
CATEGORIES= chinese devel
-MASTER_SITES= LOCAL/delphij:1 \
- ${MASTER_SITE_GOOGLE_CODE}:1 \
- http://open-gram.googlecode.com/files/:2
+MASTER_SITES= GH:1 SF/open-gram:2
DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:1 \
- lm_sc.t3g.arpa.tar.bz2:2 dict.utf8.tar.bz2:2
-EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX}
+ 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
@@ -18,20 +14,26 @@ COMMENT= Statistical language model based input method engine
LICENSE= LGPL21 CDDL
LICENSE_COMB= dual
-BROKEN= Unfetchable
LIB_DEPENDS= libsqlite3.so:${PORTSDIR}/databases/sqlite3
-MAKE_ARGS+= --prefix=${PREFIX} --libdatadir=${PREFIX}/share
+USE_GITHUB= yes
+GH_TAGNAME= a8bd811
+
+MAKE_ARGS+= --prefix=${PREFIX}
USE_LDCONFIG= yes
-USES= gmake scons iconv pkgconfig tar:xz
+USES= gmake iconv perl5 pkgconfig python scons shebangfix tar:xz
+USE_PERL5= build
+SHEBANG_FILES= python/*.py
+python_CMD= ${PYTHON_CMD}
LDFLAGS+= -L${LOCALBASE}/lib ${ICONV_LIB}
-INSTALL_TARGET= install --install-sandbox=${STAGEDIR}
-
-post-patch:
- @${CP} ${_DISTDIR}/lm_sc.t3g.arpa.tar.bz2 \
- ${_DISTDIR}/dict.utf8.tar.bz2 ${WRKSRC}/raw
+INSTALL_TARGET= install-lib install-headers --install-sandbox=${STAGEDIR}
post-install:
${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libsunpinyin.so.3.0
+ ${ENV} 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
index 2f0847e9665c..09b4984300fe 100644
--- a/chinese/sunpinyin/distinfo
+++ b/chinese/sunpinyin/distinfo
@@ -1,6 +1,6 @@
-SHA256 (sunpinyin-2.0.4rc2.tar.xz) = e38aaf5728d52c6022e37ce297ab27f82498f6356f0b9f3c78cdd7552ce1e17d
-SIZE (sunpinyin-2.0.4rc2.tar.xz) = 966852
-SHA256 (lm_sc.t3g.arpa.tar.bz2) = 5fcbb6264befd03a75fad1301b8804a8df52972b2ea91045c7f2613904bbc6c7
-SIZE (lm_sc.t3g.arpa.tar.bz2) = 36280876
-SHA256 (dict.utf8.tar.bz2) = d0bcbc5b7005823e69c490a178d456d476069c640bf292028282e9a94d784418
-SIZE (dict.utf8.tar.bz2) = 583655
+SHA256 (sunpinyin-sunpinyin-2.0.4rc3-a8bd811_GH0.tar.xz) = 762575e71a5e24c4efc291407302a161ad51b8bf8902d952b54076f4511997ef
+SIZE (sunpinyin-sunpinyin-2.0.4rc3-a8bd811_GH0.tar.xz) = 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
index d18c10030ceb..a631a54cacf4 100644
--- a/chinese/sunpinyin/files/patch-SConstruct
+++ b/chinese/sunpinyin/files/patch-SConstruct
@@ -1,23 +1,21 @@
---- SConstruct.orig 2012-07-18 12:25:59.000000000 +0800
-+++ SConstruct 2013-09-14 14:44:54.603035259 +0800
-@@ -176,10 +176,12 @@
-
- libln_builder = Builder(action='ln -s ${SOURCE.name} ${TARGET.name}',
- chdir=True)
-- env = Environment(ENV=os.environ, CFLAGS=cflags, CXXFLAGS=cflags,
-- TAR=tar, MAKE=make, WGET=wget,
+--- SConstruct.orig 2014-11-14 09:17:48.000000000 -0500
++++ SConstruct 2015-04-01 16:11:27.540297600 -0400
+@@ -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'])
-+ env = Environment(tools=['default', 'textfile'], **ARGUMENTS)
-+ env['ENV'] = os.environ
-+ env['TAR'] = tar
-+ env['MAKE'] = make
++ tools=['default', 'textfile'],
++ **ARGUMENTS)
+ env['CPPPATH'] = ['.'] + allinc()
-+
env.Append(BUILDERS={'InstallAsSymlink': libln_builder})
+ env['ENDIANNESS'] = "be" if sys.byteorder == "big" else "le"
return env
-
-@@ -324,7 +326,6 @@
+@@ -375,7 +376,6 @@ def DoConfigure():
conf.CheckFunc('getopt_long')
conf.CheckFunc('getpagesize')
conf.CheckFunc('get_opt')
@@ -25,12 +23,12 @@
conf.CheckCHeader('inttypes.h')
conf.CheckCHeader('locale.h')
conf.CheckCHeader('libintl.h')
-@@ -420,7 +421,7 @@
+@@ -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'])
- libdata_target = env.Install(libdatadir,
- ['data/lm_sc.t3g',
+ bin_target = env.Install(bindir, bins)
+ man1_target = env.Install(man1dir, man1s)
diff --git a/chinese/sunpinyin/files/patch-raw_Makefile b/chinese/sunpinyin/files/patch-raw_Makefile
deleted file mode 100644
index 0d626f8653c8..000000000000
--- a/chinese/sunpinyin/files/patch-raw_Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
---- raw/Makefile~ 2011-02-17 21:39:52.000000000 -0600
-+++ raw/Makefile 2011-11-10 01:52:50.258400612 -0600
-@@ -11,18 +11,12 @@ stamp-lm: lm_sc.t3g.arpa.tar.bz2
- $(TAR) -jxf $^
- touch $@
-
--lm_sc.t3g.arpa.tar.bz2:
-- $(WGET) $(LM_URL)/$@
--
- dict.utf8: stamp-dict
-
- stamp-dict: dict.utf8.tar.bz2
- $(TAR) -jxf $^
- touch $@
-
--dict.utf8.tar.bz2:
-- $(WGET) $(LM_URL)/$@
--
- clean:
- @rm -f stamp-dict stamp-lm lm_sc.t3g.arpa dict.utf8
- @echo cleaned
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..926457694627
--- /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 09:17:48.000000000 -0500
++++ src/sunpinyin-dictgen.mk.in 2015-04-01 14:42:35.541184598 -0400
+@@ -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/pkg-plist b/chinese/sunpinyin/pkg-plist
index 8b6807c25a26..9d178553e762 100644
--- a/chinese/sunpinyin/pkg-plist
+++ b/chinese/sunpinyin/pkg-plist
@@ -35,18 +35,17 @@ 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/sim_slmbuilder.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/slm/tslmpack/arpa_conv.h
-include/sunpinyin-2.0/slm/tslmpack/arpa_slm.h
-include/sunpinyin-2.0/slm/tslmpack/common.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
-share/sunpinyin/data/lm_sc.t3g
-share/sunpinyin/data/pydict_sc.bin
+%%DATADIR%%/lm_sc.t3g
+%%DATADIR%%/pydict_sc.bin