我运行的是 Fedora 23,需要降级到 gedit 3.10.4 以及相应版本的gedit-plugins
和gedit-r-plugin
。
这个答案提供了在 ubuntu 中执行此操作的代码。我正在尝试在 Fedora 23 中做同样的事情。
编辑:
我总结了下面 Serge 答案中的所有命令(以及评论中的命令)。从全新安装的 F23 中,我执行以下操作:
sudo dnf install @development-tools fedora-packager rpmdevtools
sudo /usr/sbin/useradd makerpm
sudo usermod -a -G mock makerpm
sudo passwd makerpm
(然后我为用户 makerpm 分配一个密码并注销并以 makerpm 身份登录)。然后,我从 Fedora 档案中下载 gedit-3.10.4(Serge 答案中的链接)。然后
su -
cd /home/makerpm/
cd Download
sh downgradgedit.sh
现在,我得到:
[root@localhost Downloads]# sh downgradgedit.sh
warning: gedit-3.10.4-1.fc20.src.rpm: Header V3 RSA/SHA256 Signature, key ID 246110c1: NOKEY
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
(Stripping trailing CRs from patch; use --binary to disable.)
patching file gedit.spec
downgradgedit.sh: line 32: $'\r': command not found
error: Failed build dependencies:
autoconf is needed by gedit-2:3.10.4-1.local.fc23.x86_64
automake is needed by gedit-2:3.10.4-1.local.fc23.x86_64
enchant-devel >= 1.2.0 is needed by gedit-2:3.10.4-1.local.fc23.x86_64
glib2-devel >= 2.37.5 is needed by gedit-2:3.10.4-1.local.fc23.x86_64
gnome-common is needed by gedit-2:3.10.4-1.local.fc23.x86_64
gobject-introspection-devel is needed by gedit-2:3.10.4-1.local.fc23.x86_64
gsettings-desktop-schemas-devel is needed by gedit-2:3.10.4-1.local.fc23.x86_64
gtk3-devel is needed by gedit-2:3.10.4-1.local.fc23.x86_64
gtksourceview3-devel >= 3.9.91 is needed by gedit-2:3.10.4-1.local.fc23.x86_64
intltool is needed by gedit-2:3.10.4-1.local.fc23.x86_64
iso-codes-devel >= 0.35 is needed by gedit-2:3.10.4-1.local.fc23.x86_64
itstool is needed by gedit-2:3.10.4-1.local.fc23.x86_64
libSM-devel is needed by gedit-2:3.10.4-1.local.fc23.x86_64
libattr-devel is needed by gedit-2:3.10.4-1.local.fc23.x86_64
libpeas-devel >= 1.7.0 is needed by gedit-2:3.10.4-1.local.fc23.x86_64
libtool is needed by gedit-2:3.10.4-1.local.fc23.x86_64
pygobject3-devel is needed by gedit-2:3.10.4-1.local.fc23.x86_64
python3-devel is needed by gedit-2:3.10.4-1.local.fc23.x86_64
yelp-tools is needed by gedit-2:3.10.4-1.local.fc23.x86_64
zeitgeist-devel >= 0.9.12 is needed by gedit-2:3.10.4-1.local.fc23.x86_64
所以我:
dnf install autoconf automake enchant-devel glib2-devel gnome-common gobject-introspection-devel gsettings-desktop-schemas-devel gtk3-devel gtksourceview3-devel intltool iso-codes-devel itstool libSM-devel libattr-devel libpeas-devel libtool pygobject3-devel python3-devel yelp-tools zeitgeist-devel
然后,我sh downgradgedit.sh
(这次没有问题退出):
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.PxbsBL
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd gedit-3.10.4
+ /usr/bin/rm -rf /root/rpmbuild/BUILDROOT/gedit-3.10.4-1.local.fc23.x86_64
+ exit 0
接下来,执行以下操作:
su -
cd
sudo dnf install ~/rpmbuild/RPMS/x86_64/gedit-3.10.4-1.local.fc23.x86_64.rpm
sudo dnf install ~/rpmbuild/RPMS/x86_64/geditdevel3.10.4-1.local.fc23.x86_64.rpm.
之后 cd 到您所在的目录gedit-plugins-3.10.1-1.fc20.src.rpm
:
cd /home/makerpm/Downloads/
sudo yum-builddep gedit-plugins-3.10.1-1.fc20.src.rpm
rpmbuild --rebuild gedit-plugins-3.10.1-1.fc20.src.rpm
然后做
sudo dnf install ~/rpmbuild/RPMS/x86_64/gedit-plugins-3.10.1-1.fc23.x86_64.rpm
现在启动gedit
会启动所需版本的gedit
.它terminal-plugin
甚至在插件列表中可见。但激活它会导致:
GLib-GIO-ERROR **: Settings schema 'org.gnome.Terminal.Legacy.Profile' does not contain a key named 'word-chars'
Trace/breakpoint trap (core dumped)
答案1
按照此处所述准备您的系统:https://fedoraproject.org/wiki/How_to_create_an_RPM_package#Preparing_your_system
以构建用户身份登录并从 Fedora 档案下载 gedit-3.10.4 的源 rpm:http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/20/SRPMS/gedit-3.10.4-1.fc20.src.rpm
安装任何构建依赖项:
$ sudo yum-builddep gedit-3.10.4-1.fc20.src.rpm
并构建二进制 rpm:
$ rpmbuild --rebuild gedit-3.10.4-1.fc20.src.rpm
您的二进制包将位于~/rpmbuild/RPMS/<arch>
文件夹中
重复源下载并重建您需要的任何其他包。
如果您愿意,您可以省略为构建创建特殊用户并使用您自己的帐户进行所有操作。
编辑: 显然,在构建插件时,您需要安装 gedit-3.10.4 的开发包。因此,在使用 yum-builddep 解析插件 src rpm 的 deps 之前,请安装从 gedit 重建中获得的开发包。
编辑2:
根据评论中的讨论,刚刚构建的 gedit-3.10.4-1 由于与最新版本的gnome
.这是应用补丁进行提交的脚本https://github.com/GNOME/gedit/commit/3bed781fca0f128d0c960f095aca3dfd30c0923d拒绝已修复。
#!/bin/bash
rpm -i gedit-3.10.4-1.fc20.src.rpm || exit 1
patch -d ~/rpmbuild/SPECS -p0 <<'EOF'
--- gedit.spec.orig 2014-07-21 18:27:05.000000000 +0400
+++ gedit.spec 2016-06-03 01:27:32.294149403 +0300
@@ -25,7 +25,7 @@
Name: gedit
Epoch: 2
Version: 3.10.4
-Release: 1%{?dist}
+Release: 1.local%{?dist}
License: GPLv2+ and GFDL
Group: Applications/Editors
#VCS: git:git://git.gnome.org/gedit
@@ -41,6 +41,7 @@
%endif
Patch4: gedit-disable-python3.patch
+Patch999: gedit-remove-enable-delete.patch
BuildRequires: gnome-common
BuildRequires: glib2-devel >= %{glib2_version}
@@ -124,6 +125,7 @@
%if !%{with_python3}
%patch4 -p1 -b .disable-python
%endif
+%patch999 -p1 -b .remove-enable-delete
autoreconf -i -f
intltoolize -f
EOF
cat >~/rpmbuild/SOURCES/gedit-remove-enable-delete.patch <<'EOF'
From 3bed781fca0f128d0c960f095aca3dfd30c0923d Mon Sep 17 00:00:00 2001
From: Paolo Borelli <[email protected]>
Date: Tue, 3 Mar 2015 09:05:46 +0100
Subject: [PATCH] Remove checking nautilus "enable-delete" setting
Nautilus removed this setting
---
plugins/filebrowser/gedit-file-browser-plugin.c | 15 ---------
plugins/filebrowser/gedit-file-browser-widget.c | 36 +---------------------
...ome.gedit.plugins.filebrowser.gschema.xml.in.in | 3 --
3 files changed, 1 insertion(+), 53 deletions(-)
diff --git a/plugins/filebrowser/gedit-file-browser-plugin.c b/plugins/filebrowser/gedit-file-browser-plugin.c
index 412757b..62c932f 100644
--- a/plugins/filebrowser/gedit-file-browser-plugin.c
+++ b/plugins/filebrowser/gedit-file-browser-plugin.c
@@ -52,7 +52,6 @@
#define NAUTILUS_BASE_SETTINGS "org.gnome.nautilus.preferences"
#define NAUTILUS_FALLBACK_SETTINGS "org.gnome.gedit.plugins.filebrowser.nautilus"
#define NAUTILUS_CLICK_POLICY_KEY "click-policy"
-#define NAUTILUS_ENABLE_DELETE_KEY "enable-delete"
#define NAUTILUS_CONFIRM_TRASH_KEY "confirm-trash"
#define TERMINAL_BASE_SETTINGS "org.gnome.desktop.default-applications.terminal"
@@ -72,7 +71,6 @@ struct _GeditFileBrowserPluginPrivate
gboolean confirm_trash;
guint click_policy_handle;
- guint enable_delete_handle;
guint confirm_trash_handle;
};
@@ -354,13 +352,6 @@ install_nautilus_prefs (GeditFileBrowserPlugin *plugin)
G_CALLBACK (on_click_policy_changed),
plugin);
- /* Bind enable-delete */
- g_settings_bind (priv->nautilus_settings,
- NAUTILUS_ENABLE_DELETE_KEY,
- priv->tree_widget,
- "enable-delete",
- G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-
/* Get confirm_trash */
prefb = g_settings_get_boolean (priv->nautilus_settings,
NAUTILUS_CONFIRM_TRASH_KEY);
@@ -599,12 +590,6 @@ gedit_file_browser_plugin_deactivate (GeditWindowActivatable *activatable)
priv->click_policy_handle);
}
- if (priv->enable_delete_handle)
- {
- g_signal_handler_disconnect (priv->nautilus_settings,
- priv->enable_delete_handle);
- }
-
if (priv->confirm_trash_handle)
{
g_signal_handler_disconnect (priv->nautilus_settings,
diff --git a/plugins/filebrowser/gedit-file-browser-widget.c b/plugins/filebrowser/gedit-file-browser-widget.c
index 72a3da6..bd5a2d7 100644
--- a/plugins/filebrowser/gedit-file-browser-widget.c
+++ b/plugins/filebrowser/gedit-file-browser-widget.c
@@ -65,7 +65,6 @@ enum
PROP_0,
PROP_FILTER_PATTERN,
- PROP_ENABLE_DELETE
};
/* Signals */
@@ -152,15 +151,11 @@ struct _GeditFileBrowserWidgetPrivate
GtkWidget *location_next_menu;
GtkWidget *current_location_menu_item;
- gboolean enable_delete;
-
GCancellable *cancellable;
GdkCursor *busy_cursor;
};
-static void set_enable_delete (GeditFileBrowserWidget *obj,
- gboolean enable);
static void on_model_set (GObject *gobject,
GParamSpec *arg1,
GeditFileBrowserWidget *obj);
@@ -439,9 +434,6 @@ gedit_file_browser_widget_get_property (GObject *object,
case PROP_FILTER_PATTERN:
g_value_set_string (value, obj->priv->filter_pattern_str);
break;
- case PROP_ENABLE_DELETE:
- g_value_set_boolean (value, obj->priv->enable_delete);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -462,9 +454,6 @@ gedit_file_browser_widget_set_property (GObject *object,
gedit_file_browser_widget_set_filter_pattern (obj,
g_value_get_string (value));
break;
- case PROP_ENABLE_DELETE:
- set_enable_delete (obj, g_value_get_boolean (value));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -489,13 +478,6 @@ gedit_file_browser_widget_class_init (GeditFileBrowserWidgetClass *klass)
"The filter pattern",
"",
G_PARAM_READWRITE));
- g_object_class_install_property (object_class, PROP_ENABLE_DELETE,
- g_param_spec_boolean ("enable-delete",
- "Enable delete",
- "Enable permanently deleting items",
- TRUE,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT));
signals[LOCATION_ACTIVATED] =
g_signal_new ("location-activated",
@@ -795,19 +777,6 @@
gtk_combo_box_set_active (GTK_COMBO_BOX (obj->priv->combo), 0);
}
-static void
-set_enable_delete (GeditFileBrowserWidget *obj,
- gboolean enable)
-{
- GAction *action;
- obj->priv->enable_delete = enable;
-
- action = g_simple_action_group_lookup (obj->priv->action_group,
- "delete");
-
- g_simple_action_set_enabled (G_SIMPLE_ACTION (action), enable);
-}
-
static gboolean
filter_real (GeditFileBrowserStore *model,
GtkTreeIter *iter,
@@ -1036,8 +1005,6 @@ gedit_file_browser_widget_init (GeditFileBrowserWidget *obj)
"browser",
G_ACTION_GROUP (obj->priv->action_group));
- set_enable_delete (obj, obj->priv->enable_delete);
-
gtk_widget_init_template (GTK_WIDGET (obj));
g_signal_connect (obj->priv->previous_button, "button-press-event",
@@ -2967,8 +2934,7 @@ on_treeview_key_press_event (GeditFileBrowserView *treeview,
event->keyval == GDK_KEY_KP_Delete)
{
- if ((event->state & modifiers) == GDK_SHIFT_MASK &&
- obj->priv->enable_delete)
+ if ((event->state & modifiers) == GDK_SHIFT_MASK)
{
delete_selected_files (obj, FALSE);
return TRUE;
diff --git a/plugins/filebrowser/org.gnome.gedit.plugins.filebrowser.gschema.xml.in.in b/plugins/filebrowser/org.gnome.gedit.plugins.filebrowser.gschema.xml.in.in
index cc76ab8..7a384c7 100644
--- a/plugins/filebrowser/org.gnome.gedit.plugins.filebrowser.gschema.xml.in.in
+++ b/plugins/filebrowser/org.gnome.gedit.plugins.filebrowser.gschema.xml.in.in
@@ -51,9 +51,6 @@
<key name="click-policy" enum="org.gnome.gedit.plugins.filebrowser.nautilus.ClickPolicy">
<default>'double'</default>
</key>
- <key name="enable-delete" type="b">
- <default>false</default>
- </key>
<key name="confirm-trash" type="b">
<default>true</default>
</key>
EOF
rpmbuild -ba ~/rpmbuild/SPECS/gedit.spec
该脚本假定该文件gedit-3.10.4-1.fc20.src.rpm
位于当前目录中。构建完成后,您将在目录中找到二进制包~/rpmbuild/RPMS
以及新的、修补过的SRPM
包~/rpmbuild/SRPMS
在 chrooted FC23 安装中执行相同的步骤后,我的终端插件没有任何问题:
编辑3:
由于OP对程序有问题,我使用构建脚本和结果创建了一个github存储库RPM
:https://github.com/geditFC23/gedit-3.10.4-fc23/releases