如何修补和重建 gnome-settings-daemon?

如何修补和重建 gnome-settings-daemon?

我正在尝试修复 gnome 3 上的电源按钮而不关闭系统,正如 don_crissti 在这个线程中所说(Gnome 3:如何将电源按钮设置为关机而不是挂起?)该选项已被删除。

他还提到你可以修复它

如果您愿意修补并重建 gnome-settings-daemon

那么我该怎么做呢?

答案1

创建一个目录build并在那里下载补丁,并将其另存为d.patch.

按照这个脚本操作(我已经保存了整个会话,因此您知道应该从哪些目录施放这些咒语)。

[user@MACHINE build]$ git clone git://git.gnome.org/gnome-settings-daemon #download GSD source
[user@MACHINE build]$ git clone git://git.gnome.org/libgnome-volume-control #download dependency
[user@MACHINE build]$ cd gnome-settings-daemon/
[user@MACHINE gnome-settings-daemon]$ git checkout GNOME_SETTINGS_DAEMON_3_18_2 #get the version for which the script was prepared
[user@MACHINE gnome-settings-daemon]$ git submodule init #download more dependencies
[user@MACHINE gnome-settings-daemon]$ git config --local submodule.panels/media-keys/gvc.url ../libgnome-volume-control
[user@MACHINE gnome-settings-daemon]$ git submodule update
[user@MACHINE gnome-settings-daemon]$ cd ..
[user@MACHINE build]$ wget https://launchpad.net/ubuntu/+archive/primary/+files/gnome-settings-daemon_3.18.2-0ubuntu2.debian.tar.xz #download Ubuntu patches - that's why I asked you about your OS
[user@MACHINE build]$ tar -xf gnome-settings-daemon_3.18.2-0ubuntu2.debian.tar.xz 
[user@MACHINE build]$ cd gnome-settings-daemon/
[user@MACHINE gnome-settings-daemon]$ patch -p1 -i ../debian/patches/64_restore_terminal_keyboard_shortcut_schema.patch #apply Ubuntu patches if you want Ubuntu version of GSD
[user@MACHINE gnome-settings-daemon]$ patch -p1 -i ../debian/patches/ubuntu-lid-close-suspend.patch
[user@MACHINE gnome-settings-daemon]$ patch -p1 -i ../debian/patches/revert_background_dropping.patch
[user@MACHINE gnome-settings-daemon]$ patch -p1 -i ../debian/patches/revert-gsettings-removals.patch
[user@MACHINE gnome-settings-daemon]$ cd ..
[user@MACHINE build]$ mv gnome-settings-daemon gnome-settings-daemon-3.18.2
[user@MACHINE build]$ patch -p0 <d.patch #patch with downloaded patch
[user@MACHINE build]$ cd gnome-settings-daemon-3.18.2/
[user@MACHINE gnome-settings-daemon-3.18.2]$ NOCONFIGURE=1 ./autogen.sh #generate config script - would fail if we wouldn't download those dependencies before
[user@MACHINE gnome-settings-daemon-3.18.2]$ ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libexecdir=/usr/lib/gnome-settings-daemon --disable-static #configure - will check for dependencies  - you might need to download some packages
[user@MACHINE gnome-settings-daemon-3.18.2]$ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool #see https://bugzilla.gnome.org/show_bug.cgi?id=656231
[user@MACHINE gnome-settings-daemon-3.18.2]$ make
[user@MACHINE gnome-settings-daemon-3.18.2]$ make install

该剧本改编自这里。您可以大致看到配置它所需的依赖项。

长话短说 唯一的魔力是将所有源集中在一起:git submodules来自启动板的 Ubuntu 补丁和libgnome-volume-control.无需申请即可工作sed。其余的都是标准程序。

相关内容