Gnome3

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

  • June 22, 2017

我正在嘗試修復 gnome 3 上的電源按鈕而不是關閉系統,正如 don_crissti 在此執行緒中所說的那樣(Gnome 3:如何將電源按鈕設置為關閉而不是掛起?)該選項已被刪除。

他還提到你可以修復它

如果您願意修補和重建 gnome-settings-daemon

那我該怎麼做呢?

創建一個目錄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

劇本改編自這裡。您可以在那里大致看到配置它所需的依賴項。

TL;DR 唯一的魔力是將所有資源集中在一起:git submodules來自啟動板的 Ubuntu 更新檔和libgnome-volume-control. 不用申請就可以了sed。其餘的都是標準程序。

引用自:https://unix.stackexchange.com/questions/372766