安装Source Navigator

来自个人维基
跳转至: 导航搜索

在安装的过程中,一个重要的技巧是执行指令./configure 时加入执行的参数指令是./configure --prefix=/usr/share/name

上述这样做的好处是在uninstall删除那个目录(You might also remove your ~/.sn directory where settings are saved),即可以完全的删除干净,要不就要到处查找所要删除的文件,这样就变得非常麻烦了。

Source-Navigator的安装:

我用的是现时的6.0版本,下面是安装方法:

从以下地址下载最新的版本:

http://sourceforge.net/projects/sourcenav/

从以下地址下载一个重要的PATCH,tk-lastevent.patch:

http://svn.exactcode.de/t2/trunk/package/develop/sourcenav-ng/

1.解压 tar -xzvf sourcenav-6.0.tar.gz

2.进入解压后目录

$:cd sourcenav-6.0

3.把tk-lastevent.patch拷到sourcenav-6.0的目录下,然后打开sourcenav的文件夹,打补丁

$:patch -p1 < tk-lastevent.patch

我个人按照打补丁时失败了,提示:

patching file -p1
Hunk #1 FAILED at 635.
1 out of 1 hunk FAILED -- saving rejects to file -p1.rej

出现这个提示是因为下载的这个patch是在比较老版本的tk.h上生成的,在新版本上行数有变化,故会提示失败,解决办法是打开这个patch文件,根据里面的信息手动替换掉相关代码(关于patch文件的解析请见这里)。

4.创建安装目录

$:sudo mkdir /usr/share/sourcenav

5. 执行

$:./configure --prefix=/usr/share/sourcenav

6.安装需求库

$:sudo apt-get install libx11-dev

7.

$:sudo make

8.

$:sudo make install

程序将被安装在:/usr/local/sourcenav/bin

执行./snavigator

这时,如果没有执行第3步(或执行失败),则会提示以下错误:

Can't find a usable tk.tcl in the following directories: 
    /usr/share/sourcenav/share/tk8.3

/usr/share/sourcenav/share/tk8.3/tk.tcl: no event type or button # or keysym
no event type or button # or keysym
    while executing
"bind Listbox <MouseWheel> {
    %W yview scroll [expr {- (%D / 120) * 4}] units
}"
    (file "/usr/share/sourcenav/share/tk8.3/listbox.tcl" line 182)
    invoked from within
"source [file join $tk_library listbox.tcl]"
    invoked from within
"if {[string compare $tcl_platform(platform) "macintosh"] && \
	[string compare {} $tk_library]} {
    source [file join $tk_library button.tcl]
    so..."
    (file "/usr/share/sourcenav/share/tk8.3/tk.tcl" line 308)
    invoked from within
"source /usr/share/sourcenav/share/tk8.3/tk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 [list source $file]"


This probably means that tk wasn't installed properly.

可以用以下方法解决,但个人建议还是打上那个patch比较好:

将安装目录下的

/usr/share/sourcenav/share/tk8.3/listbox.tcl 第182-184行
/usr/share/sourcenav/share/tk8.3/text.tcl 第457-459行

用"#"注释掉


最后,可以在桌面上生成一个链接:

1、点击右键“创建启动器...”

2、类型是“应用程序”

3、名称是SourceNavigator

4、命令是"/usr/share/sourcenav/bin/snavigator"

确定就可以启动程序了


用户使用参考手册 http://sourcenav.sourceforge.net/online-docs/userguide/index_ug.html


参考文档:

http://blog.csdn.net/eastwei2006/article/details/6677563

http://blog.csdn.net/hwppippo/article/details/6384192