1 |
commit: 4f9268e50e56dc63243cc385aea7580a63ee91e3 |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Nov 25 12:21:13 2017 +0000 |
4 |
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 25 12:31:44 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f9268e5 |
7 |
|
8 |
Revert "app-i18n/sunpinyin: Remove old" |
9 |
|
10 |
This reverts commit 342fbe62db3fb93842dedfbee7993d30ca4588eb. |
11 |
|
12 |
app-i18n/sunpinyin/Manifest | 3 + |
13 |
.../files/sunpinyin-2.0.3-force-switch.patch | 30 ++++++++++ |
14 |
.../sunpinyin/files/sunpinyin-2.0.3-gcc-4.7.patch | 49 +++++++++++++++++ |
15 |
app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild | 64 ++++++++++++++++++++++ |
16 |
4 files changed, 146 insertions(+) |
17 |
|
18 |
diff --git a/app-i18n/sunpinyin/Manifest b/app-i18n/sunpinyin/Manifest |
19 |
index 6a7d9e8dd0d..8ea93a2261f 100644 |
20 |
--- a/app-i18n/sunpinyin/Manifest |
21 |
+++ b/app-i18n/sunpinyin/Manifest |
22 |
@@ -1 +1,4 @@ |
23 |
+DIST dict.utf8.tar.bz2 1598995 SHA256 d8261f6b0bfcdd40a9c4f366228f86b017e06c9d7d64d6ddec1c2c3511eea805 SHA512 04ec55e4af4b58d29b1141a824b5c3de5dbaaab0133d88e477d9183db738fc63543b4004bf071e611c6ea0d4b4c161b73849a64ab75f4df5bb5116d7f52d8e34 WHIRLPOOL c1ead1556dbcbe0811551cff2b84367ce9827a06733a3f5a6c2a229882ecd9b83069455146d6ea507d235ef3ad979cd10d373cfc806e150ad0fae9bd91330925 |
24 |
+DIST lm_sc.t3g.arpa.tar.bz2 25098718 SHA256 c80093a8b43561e64158de4139967eef39b851432a2660e8050429d7560907cd SHA512 1e5e577c92df2f230b6b5962298ef7c215f6069b53e8e2dd4c5ad3eb54f999fc239b0924b4ab031af59c3194da15d6317ea2860f158e805b5cf0126666eaad98 WHIRLPOOL 294b668ca6bcb765392f882bd9b0f16e403c8709eb2d7ae129e4c4aba3372b8b6d9b6a78df67b811a742136e4d1b203b5da7e7f7554296c6986a6fcba361b50b |
25 |
+DIST sunpinyin-2.0.3.tar.gz 169394 SHA256 4ab776e7563f69f8dbda8fac7cfaa42bd0db1ea68bab15f756094ce5398d83d1 SHA512 25f1fc4b8f550663861f2c7426832924676f83e1f201689fde51b04ca78704b46dbbf2b92736234d5e1a729ba1bb23bd1f3a0394f6b8b54cb0df57b9bb7ece1d WHIRLPOOL 71a4efedcbe4ec1dda9ecb1b94256a0e5e8ca570a234a8b378f85af68bf3da9f3b9220aee98c2f3ce509daa33996fea8b554e81594c299281ede58167cf633e8 |
26 |
DIST sunpinyin-2.0.4_pre20130108.tar.xz 964764 SHA256 e650957aced55075448b7f02298d0c5cf59a8b8e041e9c7d92d24cb5170de93f SHA512 7c1dd7db8b800e9d436746a560a16de2c6777576868f2e7e28f6dcb767b91ccd62b974f9d4ce6bd6ce80d30e1ee83887c3ee03c227e7e9fa59c01db4867465b2 WHIRLPOOL 82535dcde38c2fce17877e465db7ebeaed14a7f305ad96ca451c5b35ae04244a94e9bde9ce51092a390964c557e39ab43742d2370342f9b72722b24f916c55d6 |
27 |
|
28 |
diff --git a/app-i18n/sunpinyin/files/sunpinyin-2.0.3-force-switch.patch b/app-i18n/sunpinyin/files/sunpinyin-2.0.3-force-switch.patch |
29 |
new file mode 100644 |
30 |
index 00000000000..f2f6b389ba0 |
31 |
--- /dev/null |
32 |
+++ b/app-i18n/sunpinyin/files/sunpinyin-2.0.3-force-switch.patch |
33 |
@@ -0,0 +1,30 @@ |
34 |
+diff --git a/SConstruct b/SConstruct |
35 |
+index 68cd365..9bb6ebc 100644 |
36 |
+--- a/SConstruct |
37 |
++++ b/SConstruct |
38 |
+@@ -180,12 +180,6 @@ libdir = env['LIBDIR'] |
39 |
+ libdatadir = env['LIBDATADIR'] + '/sunpinyin/data' |
40 |
+ headersdir = env['PREFIX'] + '/include/sunpinyin-2.0' |
41 |
+ |
42 |
+-if GetOS() != 'Darwin': |
43 |
+- env.Append(LINKFLAGS=['-Wl,-soname=libsunpinyin.so.%d' % abi_major]) |
44 |
+- |
45 |
+-if GetOption('rpath') is not None and GetOS() != 'Darwin': |
46 |
+- env.Append(LINKFLAGS='-Wl,-R -Wl,%s' % GetOption('rpath')) |
47 |
+- |
48 |
+ # pass through environmental variables |
49 |
+ envvar = [('CC', 'CC'), |
50 |
+ ('CXX', 'CXX'), |
51 |
+@@ -202,6 +196,12 @@ extra_cflags=' -DHAVE_CONFIG_H -DSUNPINYIN_DATA_DIR=\'"%s"\'' % libdatadir |
52 |
+ env.Append(CFLAGS=extra_cflags) |
53 |
+ env.Append(CXXFLAGS=extra_cflags) |
54 |
+ |
55 |
++if GetOS() != 'Darwin': |
56 |
++ env.Append(LINKFLAGS=' -Wl,-soname=libsunpinyin.so.%d' % abi_major) |
57 |
++ |
58 |
++if GetOption('rpath') is not None and GetOS() != 'Darwin': |
59 |
++ env.Append(LINKFLAGS=' -Wl,-R -Wl,%s' % GetOption('rpath')) |
60 |
++ |
61 |
+ # |
62 |
+ #==============================configure================================ |
63 |
+ # |
64 |
|
65 |
diff --git a/app-i18n/sunpinyin/files/sunpinyin-2.0.3-gcc-4.7.patch b/app-i18n/sunpinyin/files/sunpinyin-2.0.3-gcc-4.7.patch |
66 |
new file mode 100644 |
67 |
index 00000000000..c523449ef51 |
68 |
--- /dev/null |
69 |
+++ b/app-i18n/sunpinyin/files/sunpinyin-2.0.3-gcc-4.7.patch |
70 |
@@ -0,0 +1,49 @@ |
71 |
+From 3d35aa0370d9c7bd455098caa9ba22ebe1f82968 Mon Sep 17 00:00:00 2001 |
72 |
+From: Yong Sun <mail@×××××××.me> |
73 |
+Date: Wed, 4 Apr 2012 18:41:39 +0800 |
74 |
+Subject: [PATCH] Integrated patch from YunQiang Su, fixed FTBFS with gcc-4.7 |
75 |
+ |
76 |
+--- |
77 |
+ SConstruct | 3 ++- |
78 |
+ src/portability.h | 5 ++--- |
79 |
+ 2 files changed, 4 insertions(+), 4 deletions(-) |
80 |
+ |
81 |
+diff --git a/SConstruct b/SConstruct |
82 |
+index 97abf47..354fd19 100644 |
83 |
+--- a/SConstruct |
84 |
++++ b/SConstruct |
85 |
+@@ -313,7 +313,8 @@ def DoConfigure(): |
86 |
+ conf.CheckCHeader('sys/param.h') |
87 |
+ conf.CheckCHeader('sys/stat.h') |
88 |
+ conf.CheckCHeader('sys/types.h') |
89 |
+- conf.CheckCHeader('unistd.h') |
90 |
++ if conf.CheckCHeader('unistd.h'): |
91 |
++ conf.Define('DHAVE_UNISTD_H', 1) |
92 |
+ conf.CheckCHeader('wchar.h') |
93 |
+ |
94 |
+ # add essential package requirements |
95 |
+diff --git a/src/portability.h b/src/portability.h |
96 |
+index 949d4f2..cf43bd0 100644 |
97 |
+--- a/src/portability.h |
98 |
++++ b/src/portability.h |
99 |
+@@ -44,15 +44,14 @@ |
100 |
+ #include <string> |
101 |
+ #include <cstring> |
102 |
+ |
103 |
+-#if defined(sun) |
104 |
++#if defined(HAVE_UNISTD_H) |
105 |
+ #include <unistd.h> |
106 |
+ #ifdef __cplusplus |
107 |
+ #include <algorithm> |
108 |
+ #else |
109 |
+ #include <sys/ddi.h> |
110 |
+ #endif //__cpluscplus |
111 |
+-#endif //defined(sun) |
112 |
+- |
113 |
++#endif //defined(HAVE_UNISTD_H) |
114 |
+ |
115 |
+ #ifndef HOST_OS_GNUC_2 |
116 |
+ #if defined(DEBUG) && !defined(NDEBUG) |
117 |
+-- |
118 |
+1.7.8.5 |
119 |
+ |
120 |
|
121 |
diff --git a/app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild b/app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild |
122 |
new file mode 100644 |
123 |
index 00000000000..c0dea27daf5 |
124 |
--- /dev/null |
125 |
+++ b/app-i18n/sunpinyin/sunpinyin-2.0.3-r1.ebuild |
126 |
@@ -0,0 +1,64 @@ |
127 |
+# Copyright 1999-2015 Gentoo Foundation |
128 |
+# Distributed under the terms of the GNU General Public License v2 |
129 |
+ |
130 |
+EAPI="3" |
131 |
+ |
132 |
+inherit eutils multilib scons-utils toolchain-funcs |
133 |
+ |
134 |
+DESCRIPTION="SunPinyin is a SLM (Statistical Language Model) based IME" |
135 |
+HOMEPAGE="https://sunpinyin.googlecode.com" |
136 |
+SRC_URI="${HOMEPAGE}/files/${P}.tar.gz |
137 |
+ https://open-gram.googlecode.com/files/dict.utf8.tar.bz2 |
138 |
+ https://open-gram.googlecode.com/files/lm_sc.t3g.arpa.tar.bz2" |
139 |
+ |
140 |
+LICENSE="LGPL-2.1 CDDL" |
141 |
+SLOT="0" |
142 |
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" |
143 |
+IUSE="" |
144 |
+ |
145 |
+RDEPEND="dev-db/sqlite:3" |
146 |
+DEPEND="${RDEPEND} |
147 |
+ virtual/pkgconfig" |
148 |
+ |
149 |
+src_unpack() { |
150 |
+ unpack "${P}.tar.gz" |
151 |
+ ln -s "${DISTDIR}/dict.utf8.tar.bz2" "${S}/raw/" || die "dict file not found" |
152 |
+ ln -s "${DISTDIR}/lm_sc.t3g.arpa.tar.bz2" "${S}/raw/" || die "dict file not found" |
153 |
+} |
154 |
+ |
155 |
+src_prepare() { |
156 |
+ epatch "${FILESDIR}/${P}-force-switch.patch" |
157 |
+ epatch "${FILESDIR}/${P}-gcc-4.7.patch" |
158 |
+} |
159 |
+ |
160 |
+src_configure() { |
161 |
+ tc-export CXX |
162 |
+ myesconsargs=( |
163 |
+ --prefix="${EPREFIX}"/usr |
164 |
+ --libdir="${EPREFIX}"/usr/$(get_libdir) |
165 |
+ --libdatadir="${EPREFIX}"/usr/lib |
166 |
+ ) |
167 |
+} |
168 |
+ |
169 |
+src_compile() { |
170 |
+ escons || die |
171 |
+} |
172 |
+ |
173 |
+src_install() { |
174 |
+ escons --install-sandbox="${ED}" install || die |
175 |
+} |
176 |
+ |
177 |
+pkg_postinst() { |
178 |
+ elog "" |
179 |
+ elog "If you have already installed former version of ${PN}" |
180 |
+ elog "and any wrapper, please remerge the wrapper to make it work with" |
181 |
+ elog "the new version." |
182 |
+ elog "" |
183 |
+ elog "To use any wrapper for ${PN}, please merge any of the following" |
184 |
+ elog "packages: " |
185 |
+ elog "emerge app-i18n/fcitx-sunpinyin" |
186 |
+ elog "emerge app-i18n/ibus-sunpinyin" |
187 |
+ elog "emerge app-i18n/scim-sunpinyin" |
188 |
+ elog "emerge app-i18n/xsunpinyin" |
189 |
+ elog "" |
190 |
+} |