My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
BuildSunpinyin2onMac  
如何在MacOS上build SunPinyin-2.0
macos, howto, Featured
Updated Aug 29, 2010 by find...@gmail.com

1. 安装scons

下载http://prdownloads.sourceforge.net/scons/scons-1.3.1.tar.gz,并将其解压,

$ cd scons-1.3.1
$ python setup.py install

2. 从github上clone/pull最新的sunpinyin源代码

$ git clone git://github.com/sunpinyin/sunpinyin.git

3. 使用scons来构建sunpinyin的工具及数据文件

$ cd sunpinyin
$ scons

5. 最后就是build基于IMKit的输入法前端了,

$ cd wrapper/macos
$ make clean; make
$ sudo make install

现在,sunpinyin-2.0应该已经安装到系统中了,需要re-login才可以看到这个输入法。

Comment by project member zongyao.qu, Mar 28, 2010

你好, 我试着按照上述的方法build sunpinyin, cmake在我的系统上并没有。

cmake也是要单独安装的是么?

请问有没有不依赖外部toolchain的方法?

Comment by mustan...@gmail.com, Mar 29, 2010
sudo port install cmake

就可以了

Comment by mustan...@gmail.com, Mar 29, 2010

执行make lexicon时抛错:

Opening language model...done!
Adding pinyin and corresponding words...make[3]: *** [CMakeFiles/lexicon] Segmentation fault
make[2]: *** [CMakeFiles/lexicon.dir/all] Error 2
make[1]: *** [CMakeFiles/lexicon.dir/rule] Error 2
make: *** [lexicon] Error 2
Comment by project member zongyao.qu, Mar 30, 2010

Macports 也是外部的toolchain啊, 那看样子是没有完全原生的方法了。

Comment by project member zongyao.qu, Mar 30, 2010

找到了另一个方法, http://www.cmake.org/ 去下载mac版的binary,然后用那里面的cmake生成两个头文件

然后下载 http://sunpinyin.googlecode.com/files/lm_sc.t3g.le http://sunpinyin.googlecode.com/files/pydict_sc.bin.le 重命名后放到data文件夹里面, 然后直接用xcode就能编译了,

不过编译的时候会出一个错误,但是不影响二进制文件的生成

Comment by haiyi....@gmail.com, Jun 23, 2010

SunPinyin?-MacOS-2.0.2.zip 这个文件应该是已经编译好的吧?为什么安装了以后在系统中没有呢?

Comment by project member find...@gmail.com, Jun 23, 2010

@haiyi.chu,您可能需要在语言首选项中打开sunpinyin,安装路径缺省在/Library/Input\ Methods/SunPinyin?.app ...

Comment by haiyi....@gmail.com, Jun 23, 2010

谢谢,成功了。在首选项中sunpinyin前打钩,就可以使用输入法了,很好用。

Comment by ryeboylinux@gmail.com, Aug 21, 2010

我下载的已经编译好的安装包安装后系统突然变的很慢很慢,我看了下进程信息占用了很多内存,并且后台在升级,升级了后系统还是很慢很慢,卸载后系统恢复以前,不知道是不是软件的问题?

Comment by verdana...@gmail.com, Aug 27, 2010

一直用 Git 跟踪最新的 trunk 分支,现在貌似 cmake 编译方式被移除了,autotools 也不可用,现在 MacOS 如何编译呢?

Comment by project member find...@gmail.com, Aug 29, 2010

@verdana.cn,已更新 :)

Comment by recordus, Sep 27, 2010

最后一步build IMkit前端时出错了: 见:http://pastebin.com/VWdWZkgx 同时xcodebuild也报错: http://pastebin.com/gFN0p33N

我使用的版本是:136e47373a5851ee3a07f8d284c4faaf9e75cc66

commit 136e47373a5851ee3a07f8d284c4faaf9e75cc66
Author: Yong Sun <mail@yongsun.me>
Date:   Fri Sep 24 02:09:04 2010 +0800

    revised the logic for transfering an ENDING_WORD_ID.
Comment by cnye...@gmail.com, Jan 14, 2011

Makefile里能添加Release-x86_64么?

Comment by magicm...@hotmail.it, Jan 16, 2012

用sun pinyin一定需要Python2.7吗?2.5或2.6行吗?


Sign in to add a comment
Powered by Google Project Hosting