LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2956|回复: 6

在 debian 4.0 (etch) 下正确编译 stardict 3.0.0 的步骤.

[复制链接]
发表于 2007-9-3 01:13:06 | 显示全部楼层 |阅读模式
startdict 3.0.0 默认编译需要的若干函数库, 版本高于debian 4.0中所带的, 所以编译需要一些额外修改. 由于 stardict 是基于 gtk2.0 的程序, 所以首先确认你安装了 libgtk2.0-dev 包, 接下来:

0) 下载源代码 [color="Blue"]http://sourceforge.net/project/showfiles.php?group_id=80679&package_id=82452 我们需要的是 stardict-3.0.0.tar.bz2 这个文件. 然后解压缩到一个临时目录, 比如 /tmp/stardict-3.0.0/

1) export PKG_CONFIG=/usr/bin/pkg-config

2) ./configure --disable-espeak --disable-gucharmap --disable-spell  --disable-festival
( 因为我的桌面是 xfce, 我自己编译时还加了 一个参数  --disable-gnome-support , 如果增加这个参数, 需要额外修改一个文件, 下面详述).

3) 修改 ./src/dictmanagedlg.cpp 第 1939 行, 把红色部分改成绿色部分.

image = gtk_image_new_from_stock(GTK_STOCK_SELECT_ALL, GTK_ICON_SIZE_MENU);

==>

image = gtk_image_new_from_stock("gtk_select_all", GTK_ICON_SIZE_MENU);

4) 修改 ./src/Makefile , 找到 STARDICT_LIBS= 开始的这一行(很长的一行), 在这行的最后加上 -lgthread-2.0

5) make

6) make install


附注,  如果你在配置时, 添加了 --disable-gnome-support, 需要修改 ./src/prefsdlg.cpp

首先找到
  1. GtkWidget *label = gtk_label_new(_("RealPeopleTTS search path:"));
复制代码

改成
  1. label = gtk_label_new(_("RealPeopleTTS search path:"));
复制代码

然后向上二十几行, 找到
  1. void PrefsDlg::setup_dictionary_sound_page()
  2. {
  3.         GtkWidget *vbox = prepare_page(GTK_NOTEBOOK(notebook), _("Sound"), GTK_S
  4. TOCK_YES);
  5.         GtkWidget *vbox1 = gtk_vbox_new(false, 6);
  6.         gtk_box_pack_start(GTK_BOX(vbox),vbox1,false,false, 0);
  7.         GtkWidget *check_button;
复制代码
在这段代码的下面增加一行,
  1. GtkWidget *label;
复制代码
 楼主| 发表于 2007-9-3 10:25:21 | 显示全部楼层
刚发现, 虽然在编译时禁止了内置的festival引擎, 但在 Preference->Dictionary->Sound 中
选中 Use TTS program , 并在下面的下拉框中选择 echo %s | festival --tts & , 一样是可以发声的.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2007-9-3 11:58:44 | 显示全部楼层
发个patch,呵呵

  1. --- configure-ori        2007-08-30 23:10:49.000000000 +0800
  2. +++ configure        2007-08-30 23:14:34.000000000 +0800
  3. @@ -26185,7 +26185,7 @@



  4. -ac_config_files="$ac_config_files Makefile stardict.spec stardict-withoutgnome.spec data/Makefile doc/Makefile po/Makefile.in m4/Makefile src/Makefile src/sigc++/Makefile src/sigc++config/Makefile src/lib/Makefile src/pixmaps/Makefile src/sounds/Makefile src/dic/Makefile src/treedict/Makefile src/win32/Makefile src/win32/acrobat/Makefile src/win32/acrobat/sources/Makefile src/win32/acrobat/win32/Makefile src/win32/nsis/Makefile stardict-plugins/Makefile stardict-plugins/stardict-advertisement-plugin/Makefile stardict-plugins/stardict-advertisement-plugin/data/Makefile stardict-plugins/stardict-man-plugin/Makefile stardict-plugins/stardict-update-info-plugin/Makefile stardict-plugins/stardict-spell-plugin/Makefile stardict-plugins/stardict-gucharmap-plugin/Makefile stardict-plugins/stardict-festival-tts-plugin/Makefile stardict-plugins/stardict-espeak-tts-plugin/Makefile stardict-plugins/stardict-wiki-parsedata-plugin/Makefile stardict-plugins/stardict-powerword-parsedata-plugin/Makefile stardict-plugins/stardict-xdxf-parsedata-plugin/Makefile stardict-plugins/stardict-html-parsedata-plugin/Makefile tests/Makefile pixmaps/Makefile help/Makefile help/C/Makefile help/zh_CN/Makefile help/zh_TW/Makefile help/ru/Makefile help/mk/Makefile help/nl/Makefile help/uk/Makefile"
  5. +ac_config_files="$ac_config_files Makefile stardict.spec stardict-withoutgnome.spec data/Makefile doc/Makefile po/Makefile.in m4/Makefile src/Makefile src/sigc++/Makefile src/sigc++config/Makefile src/lib/Makefile src/pixmaps/Makefile src/sounds/Makefile src/dic/Makefile src/treedict/Makefile src/win32/Makefile src/win32/acrobat/Makefile src/win32/acrobat/sources/Makefile src/win32/acrobat/win32/Makefile src/win32/nsis/Makefile stardict-plugins/Makefile stardict-plugins/stardict-man-plugin/Makefile stardict-plugins/stardict-update-info-plugin/Makefile stardict-plugins/stardict-spell-plugin/Makefile stardict-plugins/stardict-gucharmap-plugin/Makefile stardict-plugins/stardict-festival-tts-plugin/Makefile stardict-plugins/stardict-espeak-tts-plugin/Makefile stardict-plugins/stardict-wiki-parsedata-plugin/Makefile stardict-plugins/stardict-powerword-parsedata-plugin/Makefile stardict-plugins/stardict-xdxf-parsedata-plugin/Makefile stardict-plugins/stardict-html-parsedata-plugin/Makefile tests/Makefile pixmaps/Makefile help/Makefile help/C/Makefile help/zh_CN/Makefile help/zh_TW/Makefile help/ru/Makefile help/mk/Makefile help/nl/Makefile help/uk/Makefile"

  6. cat >confcache <<\_ACEOF
  7. # This file is a shell script that caches the results of configure
  8. @@ -26911,8 +26911,6 @@
  9.      "src/win32/acrobat/win32/Makefile") CONFIG_FILES="$CONFIG_FILES src/win32/acrobat/win32/Makefile" ;;
  10.      "src/win32/nsis/Makefile") CONFIG_FILES="$CONFIG_FILES src/win32/nsis/Makefile" ;;
  11.      "stardict-plugins/Makefile") CONFIG_FILES="$CONFIG_FILES stardict-plugins/Makefile" ;;
  12. -    "stardict-plugins/stardict-advertisement-plugin/Makefile") CONFIG_FILES="$CONFIG_FILES stardict-plugins/stardict-advertisement-plugin/Makefile" ;;
  13. -    "stardict-plugins/stardict-advertisement-plugin/data/Makefile") CONFIG_FILES="$CONFIG_FILES stardict-plugins/stardict-advertisement-plugin/data/Makefile" ;;
  14.      "stardict-plugins/stardict-man-plugin/Makefile") CONFIG_FILES="$CONFIG_FILES stardict-plugins/stardict-man-plugin/Makefile" ;;
  15.      "stardict-plugins/stardict-update-info-plugin/Makefile") CONFIG_FILES="$CONFIG_FILES stardict-plugins/stardict-update-info-plugin/Makefile" ;;
  16.      "stardict-plugins/stardict-spell-plugin/Makefile") CONFIG_FILES="$CONFIG_FILES stardict-plugins/stardict-spell-plugin/Makefile" ;;
  17. --- configure.in-ori        2007-08-30 23:11:07.000000000 +0800
  18. +++ configure.in        2007-08-30 23:15:16.000000000 +0800
  19. @@ -345,8 +345,6 @@
  20. src/win32/acrobat/win32/Makefile
  21. src/win32/nsis/Makefile
  22. stardict-plugins/Makefile
  23. -stardict-plugins/stardict-advertisement-plugin/Makefile
  24. -stardict-plugins/stardict-advertisement-plugin/data/Makefile
  25. stardict-plugins/stardict-man-plugin/Makefile
  26. stardict-plugins/stardict-update-info-plugin/Makefile
  27. stardict-plugins/stardict-spell-plugin/Makefile
  28. --- stardict-plugins/Makefile.am-ori        2007-07-12 11:42:09.000000000 +0800
  29. +++ stardict-plugins/Makefile.am        2007-08-30 23:19:29.000000000 +0800
  30. @@ -1,3 +1,3 @@
  31. -DIST_SUBDIRS = stardict-advertisement-plugin stardict-man-plugin stardict-update-info-plugin stardict-html-parsedata-plugin stardict-xdxf-parsedata-plugin stardict-powerword-parsedata-plugin stardict-wiki-parsedata-plugin stardict-spell-plugin stardict-gucharmap-plugin stardict-festival-tts-plugin stardict-espeak-tts-plugin
  32. +DIST_SUBDIRS = stardict-man-plugin stardict-update-info-plugin stardict-html-parsedata-plugin stardict-xdxf-parsedata-plugin stardict-powerword-parsedata-plugin stardict-wiki-parsedata-plugin stardict-spell-plugin stardict-gucharmap-plugin stardict-festival-tts-plugin stardict-espeak-tts-plugin

  33. -SUBDIRS = stardict-advertisement-plugin stardict-man-plugin stardict-update-info-plugin stardict-html-parsedata-plugin stardict-xdxf-parsedata-plugin stardict-powerword-parsedata-plugin stardict-wiki-parsedata-plugin $(SPELL_PLUGIN_DIR) $(GUCHARMAP_PLUGIN_DIR) $(FESTIVAL_PLUGIN_DIR) $(ESPEAK_PLUGIN_DIR)
  34. +SUBDIRS = stardict-man-plugin stardict-update-info-plugin stardict-html-parsedata-plugin stardict-xdxf-parsedata-plugin stardict-powerword-parsedata-plugin stardict-wiki-parsedata-plugin $(SPELL_PLUGIN_DIR) $(GUCHARMAP_PLUGIN_DIR) $(FESTIVAL_PLUGIN_DIR) $(ESPEAK_PLUGIN_DIR)
  35. --- stardict-plugins/Makefile.in-ori        2007-08-13 09:32:09.000000000 +0800
  36. +++ stardict-plugins/Makefile.in        2007-08-30 23:19:56.000000000 +0800
  37. @@ -235,8 +235,8 @@
  38. target_alias = @target_alias@
  39. top_builddir = @top_builddir@
  40. top_srcdir = @top_srcdir@
  41. -DIST_SUBDIRS = stardict-advertisement-plugin stardict-man-plugin stardict-update-info-plugin stardict-html-parsedata-plugin stardict-xdxf-parsedata-plugin stardict-powerword-parsedata-plugin stardict-wiki-parsedata-plugin stardict-spell-plugin stardict-gucharmap-plugin stardict-festival-tts-plugin stardict-espeak-tts-plugin
  42. -SUBDIRS = stardict-advertisement-plugin stardict-man-plugin stardict-update-info-plugin stardict-html-parsedata-plugin stardict-xdxf-parsedata-plugin stardict-powerword-parsedata-plugin stardict-wiki-parsedata-plugin $(SPELL_PLUGIN_DIR) $(GUCHARMAP_PLUGIN_DIR) $(FESTIVAL_PLUGIN_DIR) $(ESPEAK_PLUGIN_DIR)
  43. +DIST_SUBDIRS = stardict-man-plugin stardict-update-info-plugin stardict-html-parsedata-plugin stardict-xdxf-parsedata-plugin stardict-powerword-parsedata-plugin stardict-wiki-parsedata-plugin stardict-spell-plugin stardict-gucharmap-plugin stardict-festival-tts-plugin stardict-espeak-tts-plugin
  44. +SUBDIRS = stardict-man-plugin stardict-update-info-plugin stardict-html-parsedata-plugin stardict-xdxf-parsedata-plugin stardict-powerword-parsedata-plugin stardict-wiki-parsedata-plugin $(SPELL_PLUGIN_DIR) $(GUCHARMAP_PLUGIN_DIR) $(FESTIVAL_PLUGIN_DIR) $(ESPEAK_PLUGIN_DIR)
  45. all: all-recursive

  46. .SUFFIXES:
复制代码

patch -p0 -i patch.txt
rm -rf stardict-plugins/stardict-advertisement-plugin*  后,编译即可

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2007-9-3 12:00:43 | 显示全部楼层
apt-get install stardict
这样就可以了,何必在编译源码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-3 12:04:20 | 显示全部楼层
在 etch 上还是得改源文件, 因为 stardict 3.0 用到了gtk 2.10 中的东西, 而 etch 中的 gtk 版本是 2.8
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-9-3 12:05:26 | 显示全部楼层
Post by sungx
apt-get install stardict
这样就可以了,何必在编译源码

apt 得到是 2.4, 我现在编译的是 3.0
回复 支持 反对

使用道具 举报

发表于 2007-9-3 13:44:38 | 显示全部楼层
用sid没任何问题
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表