RabbitVCS 在 Thunar / Kubuntu 20.04 上安装

RabbitVCS 在 Thunar / Kubuntu 20.04 上安装

我试图通过 Thunar (1.8.14) 让 RabbitVCS 在 Kubuntu (20.04) 上工作,但尽我所能,似乎没有任何效果。 当然它不能按照他们的官方安装说明工作。我觉得我已经非常接近了,但是遇到了障碍,并且在谷歌了几个小时之后,我不知道如何继续。这是我的过程。

首先,安装 Thunar:

 sudo apt install thunar

还有一些在存储库中实际可用的rabbitvcs依赖项:

 sudo apt install python-gobject python-dbus

接下来,我需要安装 thunarx-python。存储库中缺少它,因此我安装从下载的 thunarx-python_0.5.1-2_amd64.debhttps://ubuntu.pkgs.org/19.10/ubuntu-universe-amd64/thunarx-python_0.5.1-2_amd64.deb.html

同样,存储库中缺少 python-configobj,因此我从以下位置安装 debhttps://ubuntu.pkgs.org/19.10/ubuntu-universe-amd64/python-configobj_5.0.6-3_all.deb.html

现在基本的 Rabbit 安装:

 git clone https://github.com/rabbitvcs/rabbitvcs
 cd rabbitvcs
 sudo python setup.py install --install-layout=deb
 sudo mkdir -p /usr/share/thunarx-python/extensions
 sudo cp clients/thunar/RabbitVCS.py /usr/share/thunarx-python/extensions

为了查看发生了什么,我将启动 Thunar 并启用 thunarx-python 调试:

 THUNARX_PYTHON_DEBUG=all /usr/bin/thunar

结果:

thunar_extension_initialize: entered
thunarx_python_load_dir: entered dirname=/home/metal450/.local/share/thunarx-python/extensions
thunarx_python_load_dir: entered dirname=/usr/share/thunarx-python/extensions
thunarx_python_init_python: entered
thunarx-python: Setting GI_TYPELIB_PATH to /usr/lib/x86_64-linux-gnu/girepository-1.0
thunarx-python: g_module_open /usr/lib/x86_64-linux-gnu/libpython2.7.so.1.0
thunarx-python: Py_Initialize
thunarx-python: PySys_SetArgv
thunarx-python: Sanitize the python search path
thunarx-python: init_pygobject
thunarx-python: import Thunarx
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Thunarx not available
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 133, in load_module
    'introspection typelib not found' % namespace)
ImportError: cannot import name Thunarx, introspection typelib not found

(thunar:14773): thunarx-python-WARNING **: 11:50:40.747: thunarx_python_init_python failed
Traceback (most recent call last):
File "/usr/share/thunarx-python/extensions/RabbitVCS.py", line 41, in <module>
    from gi.repository import GObject, Gtk, Thunarx
File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 133, in load_module
    'introspection typelib not found' % namespace)
ImportError: cannot import name Thunarx, introspection typelib not found
thunarx_python_load_dir: entered dirname=/usr/share/plasma/thunarx-python/extensions
thunarx_python_load_dir: entered dirname=/usr/local/share/thunarx-python/extensions
thunarx_python_load_dir: entered dirname=/usr/share/thunarx-python/extensions
thunarx_python_init_python: entered
Traceback (most recent call last):
File "/usr/share/thunarx-python/extensions/RabbitVCS.py", line 41, in <module>
    from gi.repository import GObject, Gtk, Thunarx
File "/usr/lib/python2.7/dist-packages/gi/importer.py", line 133, in load_module
    'introspection typelib not found' % namespace)
ImportError: cannot import name Thunarx, introspection typelib not found
thunarx_python_load_dir: entered dirname=/var/lib/snapd/desktop/thunarx-python/extensions
thunarx_python_load_dir: entered dirname=/usr/lib/x86_64-linux-gnu/thunarx-3/python
thunar_extension_list_types: entered

看起来它想要 GI_TYPELIB_PATH 中的 Thunarx typelib,即 /usr/lib/x86_64-linux-gnu/girepository-1.0。一些谷歌搜索看起来应该是 Thunarx-3.0.typelib,其中该文件包含在 Thunar 本身中(即参见https://www.archlinux.org/packages/extra/x86_64/thunar/files/)。但事实并非如此。我的系统上没有这样的文件,尽管我进行了搜索,但我无法弄清楚它应该来自哪里。

任何帮助将不胜感激。到目前为止,我已经花了 4 个多小时来完成这个任务,不幸的是,似乎仍然无法让 Rabbit 工作。

答案1

正如与 RabbitVCS 开发人员讨论的那样:https://github.com/rabbitvcs/rabbitvcs/issues/297,看起来 RabbitVCS 中存在多个错误,并且其安装说明中存在多个不准确之处。

直接地回答上面我自己的问题,我能够通过下载 rpm 来获取丢失的 typelibhttps://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/t/Thunar-1.8.11-1.el8.x86_64.rpm,手动提取缺少的 typelib,并手动将其移动到 /usr/lib/x86_64-linux-gnu/girepository-1.0。然而,当我了解到 Thunar 实际上并不支持 RabbitVCS 的覆盖图标时,我最终选择了 Nautilus。为了让它在 Kubuntu 中工作,我安装了:

sudo apt install nautilus python-dbus python3-nautilus python3-configobj python3-svn
git clone https://github.com/rabbitvcs/rabbitvcs
cd rabbitvcs
sudo python3 setup.py install --install-layout=deb
sudo cp clients/nautilus/RabbitVCS.py /usr/share/nautilus-python/extensions
nautilus -q

注意:他们的说明建议从 PPA 安装;忽略它并从源代码安装,因为 PPA 版本显然不起作用。他们的说明还列出了不存在的软件包 nautilus-python(您必须更改为 python3-nautilus)、python-configobj -> python3-configobj、python-svn -> python3-svn、dulwich -> python3-德威奇,python-gtk2 -> python3-tk。

这样就可以安装了。此时仍然不行,报错信息:

TypeError: Don't know which D-Bus type to use to encode type "NoneType"

我通过编辑 /usr/lib/python3/dist-packages/rabbitvcs/services/checkerservice.py 并注释掉第 270 行locale.getlocale(locale.LC_MESSAGES)以及 /usr/lib/python3/dist-packages/rabbitvcs/vcs/git/ 来修复它。 init.py 第 824 行。修复说明位于上面的 github 链接,但如果您没有弄乱系统区域设置,它应该可以正常工作。

我相信他们已经做出了自己的修复(所以你可能不需要这最后一步),但这就是它对我有用的原因,在花了一天的大部分时间在这上面之后,我只是坚持我的做法已经有了。

这就留下了唯一剩下的损坏的东西:弹出菜单中的图标丢失了。其他一切似乎都有效:覆盖图标、菜单操作、对话框等 - 这意味着它的功能已启动并正在运行。

相关内容