View | Details | Raw Unified | Return to bug 199105
Collapse All | Expand All

(-)chinese/sunpinyin/Makefile (-14 / +15 lines)
Lines 2-16 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	sunpinyin
4
PORTNAME=	sunpinyin
5
DISTVERSION=	2.0.4rc2
5
DISTVERSION=	2.0.4rc3
6
PORTREVISION=	1
7
CATEGORIES=	chinese devel
6
CATEGORIES=	chinese devel
8
MASTER_SITES=	LOCAL/delphij:1 \
7
MASTER_SITES=	GH:1 SF/open-gram:2
9
		${MASTER_SITE_GOOGLE_CODE}:1 \
10
		http://open-gram.googlecode.com/files/:2
11
DISTFILES=	${DISTNAME}${EXTRACT_SUFX}:1 \
8
DISTFILES=	${DISTNAME}${EXTRACT_SUFX}:1 \
12
		lm_sc.t3g.arpa.tar.bz2:2 dict.utf8.tar.bz2:2
9
		lm_sc.3gm.arpa-20140820.tar.bz2:2 dict.utf8-20131214.tar.bz2:2
13
EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}
14
10
15
MAINTAINER=	lichray@gmail.com
11
MAINTAINER=	lichray@gmail.com
16
COMMENT=	Statistical language model based input method engine
12
COMMENT=	Statistical language model based input method engine
Lines 20-36 Link Here
20
16
21
LIB_DEPENDS=	libsqlite3.so:${PORTSDIR}/databases/sqlite3
17
LIB_DEPENDS=	libsqlite3.so:${PORTSDIR}/databases/sqlite3
22
18
23
MAKE_ARGS+=	--prefix=${PREFIX} --libdatadir=${PREFIX}/share
19
USE_GITHUB=	yes
20
GH_TAGNAME=	a8bd811
21
22
MAKE_ARGS+=	--prefix=${PREFIX}
24
USE_LDCONFIG=	yes
23
USE_LDCONFIG=	yes
25
USES=		gmake scons iconv pkgconfig tar:xz
24
USES=		gmake scons iconv pkgconfig shebangfix tar:xz
25
SHEBANG_FILES=	python/*.py
26
LDFLAGS+=	-L${LOCALBASE}/lib ${ICONV_LIB}
26
LDFLAGS+=	-L${LOCALBASE}/lib ${ICONV_LIB}
27
INSTALL_TARGET=	install --install-sandbox=${STAGEDIR}
27
INSTALL_TARGET=	install-lib install-headers --install-sandbox=${STAGEDIR}
28
28
29
post-patch:
30
	@${CP} ${_DISTDIR}/lm_sc.t3g.arpa.tar.bz2 \
31
		${_DISTDIR}/dict.utf8.tar.bz2 ${WRKSRC}/raw
32
33
post-install:
29
post-install:
34
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libsunpinyin.so.3.0
30
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libsunpinyin.so.3.0
31
	${ENV} PATH=${WRKSRC}/src:$${PATH} ${GMAKE} -C ${WRKDIR} \
32
		-f ${WRKSRC}/src/sunpinyin-dictgen.mk STAGEDIR=${STAGEDIR}
33
	${INSTALL} -d ${STAGEDIR}${DATADIR}
34
	${INSTALL_DATA} ${WRKDIR}/lm_sc.t3g ${WRKDIR}/pydict_sc.bin \
35
		${STAGEDIR}${DATADIR}
35
36
36
.include <bsd.port.mk>
37
.include <bsd.port.mk>
(-)chinese/sunpinyin/distinfo (-6 / +6 lines)
Lines 1-6 Link Here
1
SHA256 (sunpinyin-2.0.4rc2.tar.xz) = e38aaf5728d52c6022e37ce297ab27f82498f6356f0b9f3c78cdd7552ce1e17d
1
SHA256 (sunpinyin-sunpinyin-2.0.4rc3-a8bd811_GH0.tar.xz) = 762575e71a5e24c4efc291407302a161ad51b8bf8902d952b54076f4511997ef
2
SIZE (sunpinyin-2.0.4rc2.tar.xz) = 966852
2
SIZE (sunpinyin-sunpinyin-2.0.4rc3-a8bd811_GH0.tar.xz) = 547083
3
SHA256 (lm_sc.t3g.arpa.tar.bz2) = 5fcbb6264befd03a75fad1301b8804a8df52972b2ea91045c7f2613904bbc6c7
3
SHA256 (lm_sc.3gm.arpa-20140820.tar.bz2) = 751bab7c55ea93a2cedfb0fbb7eb09f67d4da9c2c55496e5f31eb8580f1d1e2f
4
SIZE (lm_sc.t3g.arpa.tar.bz2) = 36280876
4
SIZE (lm_sc.3gm.arpa-20140820.tar.bz2) = 36623028
5
SHA256 (dict.utf8.tar.bz2) = d0bcbc5b7005823e69c490a178d456d476069c640bf292028282e9a94d784418
5
SHA256 (dict.utf8-20131214.tar.bz2) = af70bc2bcd7af7468495774fed9e3a2de434650119fbc3d3388c2bcf7e0acb01
6
SIZE (dict.utf8.tar.bz2) = 583655
6
SIZE (dict.utf8-20131214.tar.bz2) = 674512
(-)chinese/sunpinyin/files/patch-SConstruct (-18 / +16 lines)
Lines 1-23 Link Here
1
--- SConstruct.orig	2012-07-18 12:25:59.000000000 +0800
1
--- SConstruct.orig	2014-11-14 09:17:48.000000000 -0500
2
+++ SConstruct	2013-09-14 14:44:54.603035259 +0800
2
+++ SConstruct	2015-04-01 16:11:27.540297600 -0400
3
@@ -176,10 +176,12 @@
3
@@ -215,10 +215,11 @@ def CreateEnvironment():
4
 
4
         make = 'gmake'
5
     libln_builder = Builder(action='ln -s ${SOURCE.name} ${TARGET.name}',
5
         tar = 'gtar'
6
                             chdir=True)
6
     libln_builder = Builder(action='cd ${TARGET.dir} && ln -s ${SOURCE.name} ${TARGET.name}')
7
-    env = Environment(ENV=os.environ, CFLAGS=cflags, CXXFLAGS=cflags,
7
-    env = Environment(ENV=os.environ, CFLAGS=cflags, CXXFLAGS='',
8
-                      TAR=tar, MAKE=make, WGET=wget,
8
+    env = Environment(ENV=os.environ,
9
                       MAKE=make, WGET=wget, W3M=w3m, TAR=tar,
9
-                      CPPPATH=['.'] + allinc(),
10
-                      CPPPATH=['.'] + allinc(),
10
-                      tools=['default', 'textfile'])
11
-                      tools=['default', 'textfile'])
11
+    env = Environment(tools=['default', 'textfile'], **ARGUMENTS)
12
+                      tools=['default', 'textfile'],
12
+    env['ENV'] = os.environ
13
+                      **ARGUMENTS)
13
+    env['TAR'] = tar
14
+    env['MAKE'] = make
15
+    env['CPPPATH'] = ['.'] + allinc()
14
+    env['CPPPATH'] = ['.'] + allinc()
16
+
17
     env.Append(BUILDERS={'InstallAsSymlink': libln_builder})
15
     env.Append(BUILDERS={'InstallAsSymlink': libln_builder})
16
     env['ENDIANNESS'] = "be" if sys.byteorder == "big" else "le"
18
     return env
17
     return env
19
 
18
@@ -375,7 +376,6 @@ def DoConfigure():
20
@@ -324,7 +326,6 @@
21
     conf.CheckFunc('getopt_long')
19
     conf.CheckFunc('getopt_long')
22
     conf.CheckFunc('getpagesize')
20
     conf.CheckFunc('getpagesize')
23
     conf.CheckFunc('get_opt')
21
     conf.CheckFunc('get_opt')
Lines 25-31 Link Here
25
     conf.CheckCHeader('inttypes.h')
23
     conf.CheckCHeader('inttypes.h')
26
     conf.CheckCHeader('locale.h')
24
     conf.CheckCHeader('locale.h')
27
     conf.CheckCHeader('libintl.h')
25
     conf.CheckCHeader('libintl.h')
28
@@ -420,7 +421,7 @@
26
@@ -463,7 +463,7 @@ def DoInstall():
29
                                  lib_target_bin),
27
                                  lib_target_bin),
30
             ]
28
             ]
31
 
29
 
Lines 32-36 Link Here
32
-    lib_pkgconfig_target = env.Install(os.path.join(libdir, 'pkgconfig'),
30
-    lib_pkgconfig_target = env.Install(os.path.join(libdir, 'pkgconfig'),
33
+    lib_pkgconfig_target = env.Install(os.path.join(env['PREFIX'], 'libdata/pkgconfig'),
31
+    lib_pkgconfig_target = env.Install(os.path.join(env['PREFIX'], 'libdata/pkgconfig'),
34
                                        ['sunpinyin-2.0.pc'])
32
                                        ['sunpinyin-2.0.pc'])
35
     libdata_target = env.Install(libdatadir,
33
     bin_target = env.Install(bindir, bins)
36
                                  ['data/lm_sc.t3g',
34
     man1_target = env.Install(man1dir, man1s)
(-)chinese/sunpinyin/files/patch-raw_Makefile (-21 lines)
Lines 1-21 Link Here
1
--- raw/Makefile~	2011-02-17 21:39:52.000000000 -0600
2
+++ raw/Makefile	2011-11-10 01:52:50.258400612 -0600
3
@@ -11,18 +11,12 @@ stamp-lm: lm_sc.t3g.arpa.tar.bz2
4
 	$(TAR) -jxf $^
5
 	touch $@
6
 
7
-lm_sc.t3g.arpa.tar.bz2:
8
-	$(WGET) $(LM_URL)/$@
9
-
10
 dict.utf8: stamp-dict
11
 
12
 stamp-dict: dict.utf8.tar.bz2
13
 	$(TAR) -jxf $^
14
 	touch $@
15
 
16
-dict.utf8.tar.bz2:
17
-	$(WGET) $(LM_URL)/$@
18
-
19
 clean:
20
 	@rm -f stamp-dict stamp-lm lm_sc.t3g.arpa dict.utf8
21
 	@echo cleaned
(-)chinese/sunpinyin/files/patch-src_sunpinyin-dictgen.mk.in (+26 lines)
Line 0 Link Here
1
--- src/sunpinyin-dictgen.mk.in.orig	2014-11-14 09:17:48.000000000 -0500
2
+++ src/sunpinyin-dictgen.mk.in	2015-04-01 14:42:35.541184598 -0400
3
@@ -42,22 +42,7 @@ DL_ROOT = ${DL_HOST}/open-gram
4
 DICT_PAT = 'dict\.utf8-[0-9]\+.tar.bz2'
5
 SLM_PAT = 'lm_sc\.3gm\.arpa-[0-9]\+.tar.bz2'
6
 
7
-DICT_AR = $(shell ${W3M} ${DL_LIST} | grep -o ${DICT_PAT} | sort | tail -n 1)
8
-SLM_AR = $(shell ${W3M} ${DL_LIST} | grep -o ${SLM_PAT} | sort | tail -n 1)
9
-
10
-all: install
11
-
12
-${DICT_AR}:
13
-	${WGET} ${DL_ROOT}/$@
14
-
15
-dict.utf8: ${DICT_AR}
16
-	${TAR} xmf $^
17
-
18
-${SLM_AR}:
19
-	${WGET} ${DL_ROOT}/$@
20
-
21
-lm_sc.3gm.arpa: ${SLM_AR}
22
-	${TAR} xmf $^
23
+all: lm_sc.t3g pydict_sc.bin
24
 
25
 lm_sc.3gm: lm_sc.3gm.arpa dict.utf8
26
 	slmpack $^ $@
(-)chinese/sunpinyin/pkg-plist (-6 / +5 lines)
Lines 35-52 Link Here
35
include/sunpinyin-2.0/slm/sim_fmerge.h
35
include/sunpinyin-2.0/slm/sim_fmerge.h
36
include/sunpinyin-2.0/slm/sim_sen.h
36
include/sunpinyin-2.0/slm/sim_sen.h
37
include/sunpinyin-2.0/slm/sim_slm.h
37
include/sunpinyin-2.0/slm/sim_slm.h
38
include/sunpinyin-2.0/slm/sim_slmbuilder.h
39
include/sunpinyin-2.0/slm/slm.h
38
include/sunpinyin-2.0/slm/slm.h
39
include/sunpinyin-2.0/slm/slmbuild/sim_slmbuilder.h
40
include/sunpinyin-2.0/slm/slmpack/arpa_slm.h
41
include/sunpinyin-2.0/slm/slmpack/common.h
40
include/sunpinyin-2.0/slm/thread/ValueCompress.h
42
include/sunpinyin-2.0/slm/thread/ValueCompress.h
41
include/sunpinyin-2.0/slm/tslmendian/slm_file.h
43
include/sunpinyin-2.0/slm/tslmendian/slm_file.h
42
include/sunpinyin-2.0/slm/tslmendian/writer.h
44
include/sunpinyin-2.0/slm/tslmendian/writer.h
43
include/sunpinyin-2.0/slm/tslmpack/arpa_conv.h
44
include/sunpinyin-2.0/slm/tslmpack/arpa_slm.h
45
include/sunpinyin-2.0/slm/tslmpack/common.h
46
include/sunpinyin-2.0/sunpinyin.h
45
include/sunpinyin-2.0/sunpinyin.h
47
lib/libsunpinyin.so
46
lib/libsunpinyin.so
48
lib/libsunpinyin.so.3
47
lib/libsunpinyin.so.3
49
lib/libsunpinyin.so.3.0
48
lib/libsunpinyin.so.3.0
50
libdata/pkgconfig/sunpinyin-2.0.pc
49
libdata/pkgconfig/sunpinyin-2.0.pc
51
share/sunpinyin/data/lm_sc.t3g
50
%%DATADIR%%/lm_sc.t3g
52
share/sunpinyin/data/pydict_sc.bin
51
%%DATADIR%%/pydict_sc.bin

Return to bug 199105