Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Remove the need for dbus when compiling gtk+:3
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4339
Location: Dallas area

PostPosted: Tue Oct 22, 2019 4:30 pm    Post subject: Remove the need for dbus when compiling gtk+:3 Reply with quote

For those who don't want to pull in dbus when compiling gtk+:3 there is a way to fix it.

-------------Warning--------------
This has been added to further clarify who should use this:

If you are already using dbus for other things, then you should not use this.
This is for those people not running gnome/kde and for those who do not want to have dbus on their system.
-------------------------------------

New directions thanks to charles17 question below (much easier)

edit /etc/portage/profile/package.provided and add app-accessibility/at-spi2-atk-2.5.3
Note: if newer ebuilds require a version greater than 2.5.3 then that needs to be added.

mkdir /etc/portage/patches/x11-libs/gtk+:3 (you can specify version if you desire, but I've found the patch has worked well going back to 3.19)
copy following patch to the directory (call it what you want, a good name would be at-sp2-atk-removal.patch or atk-bridge-removal.patch)

emerge and enjoy your gtk:+3 without dbus being needed.

Code:
## Remove gtk3-atk-bridge support to avoid unwanted dbus dependency.

 
--- 1/configure.ac.orig   2018-10-22 09:23:08.542046885 -0500
+++ 2/configure.ac   2018-10-22 09:37:03.335514971 -0500
@@ -1390,14 +1390,10 @@
 
 
 ########################################
-# Check for Accessibility Toolkit flags
+# Removed the at-spi (atk-bridge) support
 ########################################
 
-if test x$enable_x11_backend = xyes; then
-   ATK_PACKAGES="atk atk-bridge-2.0"
-else
-   ATK_PACKAGES="atk"
-fi
+ATK_PACKAGES="atk"
 
 PKG_CHECK_MODULES(ATK, $ATK_PACKAGES)
 
## Remove gtk3-atk-bridge support to avoid unwanted dbus dependency.

--- 1/gtk/a11y/gtkaccessibility.c.orig   2018-10-22 09:23:50.806564701 -0500
+++ 2/gtk/a11y/gtkaccessibility.c   2018-10-22 09:33:39.019965471 -0500
@@ -37,10 +37,6 @@
 #include <gtk/gtktogglebutton.h>
 #include <gtk/gtkaccessible.h>
 
-#ifdef GDK_WINDOWING_X11
-#include <atk-bridge.h>
-#endif
-
 static gboolean gail_focus_watcher      (GSignalInvocationHint *ihint,
                                          guint                  n_param_values,
                                          const GValue          *param_values,
@@ -988,9 +984,5 @@
   _gtk_accessibility_override_atk_util ();
   do_window_event_initialization ();
 
-#ifdef GDK_WINDOWING_X11
-  atk_bridge_adaptor_init (NULL, NULL);
-#endif
-
   atk_misc_instance = g_object_new (GTK_TYPE_MISC_IMPL, NULL);
 }



It's just that simple (well until the devs modify the ebuild/eclasses again)

Note: This is intended for those not using gnome/kde or those simply wanting a dbus free system.
I mention gnome/kde, because there are lots of other wm related packages pulling in dbus.


Old way - kept for historical reasons.
go to PORTDIR/x11-libs/gtk+/
look for all patches listed in the ebuild
copy those patches to your local repo files directory
copy the ebuild to your local repo
edit the ebuild, save changes, and create digest
create user patch directory and put the patch file there
emerge and enjoy

I'll use gtk+-3.24.10.ebuild as the example (since it's the current stable one)

PORTDIR in my case is /usr/portage and local repo is /usr/local/portage (modify paths for your particular system)

cd /usr/portage/x11-libs/gtk+
grep -i patch gtk+-3.24.10.ebuild (in this case there are 2 files)
cp files/gtk+-3.22.20-libcloudproviders-automagic.patch /usr/local/portage/x11-libs/gtk+/files
cp files/gtk+-3.24.8-update-icon-cache.patch /usr/local/portage/x11-libs/gtk+/files
cp gtk+-3.24.10.ebuild /usr/local/portage/x11-libs/gtk+
cd /usr/local/portage/x11-libs/gtk+
edit gtk+-3.24.10.ebuild and remove dependency line with app-accessibility/at-spi2-atk on it and save file
ebuild gtk+-3.24.10.ebuild digest (create the digest so portage knows about it and associated files in /files directory)
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon


Last edited by Anon-E-moose on Tue Oct 29, 2019 9:48 am; edited 4 times in total
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6021

PostPosted: Wed Oct 23, 2019 1:31 am    Post subject: Reply with quote

Seems like a lot of manual work when there's been up-to-date ebuilds with USE=accessibility in various overlays for several months.
Back to top
View user's profile Send private message
sitquietly
Tux's lil' helper
Tux's lil' helper


Joined: 23 Oct 2010
Posts: 87
Location: On the Wolf River, Tennessee

PostPosted: Wed Oct 23, 2019 6:24 am    Post subject: Reply with quote

Ant P. wrote:
...there's been up-to-date ebuilds with USE=accessibility in various overlays for several months.


Thank you, I found your flussence repository and the debloated gtk+3, also very nice gtk2 gucharmap. I'm very glad to find those, and the audacious and quiterss ebuilds (and runit support!).
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4339
Location: Dallas area

PostPosted: Wed Oct 23, 2019 9:33 am    Post subject: Reply with quote

Ant P. wrote:
Seems like a lot of manual work when there's been up-to-date ebuilds with USE=accessibility in various overlays for several months.


Well, I don't routinely run around checking all the overlays to see what's going on.
This thread is still useful if someone wants to know how to do it or like me doesn't follow overlays.
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2799

PostPosted: Wed Oct 23, 2019 11:28 am    Post subject: Re: Remove the need for dbus when compiling gtk+:3 Reply with quote

Anon-E-moose wrote:
For those who don't want to pull in dbus when compiling gtk+:3 there is a way to fix it.

go to PORTDIR/x11-libs/gtk+/
look for all patches listed in the ebuild
copy those patches to your local repo files directory
copy the ebuild to your local repo
edit the ebuild, save changes, and create digest
create user patch directory and put the patch file there
emerge and enjoy

I'll use gtk+-3.24.10.ebuild as the example (since it's the current stable one)

PORTDIR in my case is /usr/portage and local repo is /usr/local/portage (modify paths for your particular system)

cd /usr/portage/x11-libs/gtk+
grep -i patch gtk+-3.24.10.ebuild (in this case there are 2 files)
cp files/gtk+-3.22.20-libcloudproviders-automagic.patch /usr/local/portage/x11-libs/gtk+/files
cp files/gtk+-3.24.8-update-icon-cache.patch /usr/local/portage/x11-libs/gtk+/files
cp gtk+-3.24.10.ebuild /usr/local/portage/x11-libs/gtk+
cd /usr/local/portage/x11-libs/gtk+
edit gtk+-3.24.10.ebuild and remove dependency line with app-accessibility/at-spi2-atk on it and save file
ebuild gtk+-3.24.10.ebuild digest (create the digest so portage knows about it and associated files in /files directory)

mkdir /etc/portage/patches/x11-libs/gtk+:3 (you can specify version if you desire, but I've found the patch has worked well going back to 3.19)
copy following patch to the directory (call it what you want, a good name would be at-sp2-atk-removal.patch or atk-bridge-removal.patch)

Why put it in /etc/portage/patches instead of listing it in the PATCHES array and having it in the ebuild's files directory?
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4339
Location: Dallas area

PostPosted: Wed Oct 23, 2019 12:02 pm    Post subject: Re: Remove the need for dbus when compiling gtk+:3 Reply with quote

charles17 wrote:
Why put it in /etc/portage/patches instead of listing it in the PATCHES array and having it in the ebuild's files directory?


One less modification to the ebuild.
And I still have hopes to convince the devs to put a use flag around the at-spi2-atk pkg. Which would mean no modifications to the ebuild.

Although, putting app-accessibility/at-spi2-atk in package.provided might provide the same result without the need to modify the ebuild at all.
I'll check it out later.

Edit to add: Thanks to charles17 question I thought of a much easier way (less changes needed), add file to package provided and drop patch in /etc/portage/patches.
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
duane
n00b
n00b


Joined: 03 Jun 2002
Posts: 63
Location: Oklahoma City

PostPosted: Thu Oct 24, 2019 7:35 am    Post subject: Reply with quote

I couldn't get package.provided to work on my systems:

Code:
#
app-accessibility/at-spi2-atk-2.30.1
app-accessibility/at-spi2-core-2.30.1


But, the old method still works fine. Thanks.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4339
Location: Dallas area

PostPosted: Thu Oct 24, 2019 9:58 am    Post subject: Reply with quote

duane wrote:
I couldn't get package.provided to work on my systems:

Code:
#
app-accessibility/at-spi2-atk-2.30.1
app-accessibility/at-spi2-core-2.30.1


But, the old method still works fine. Thanks.


It should have worked, I just tried and using that version works for me. Although I like to use the minimum required instead.
What does find /etc/portage -name package.provided -ls return
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
duane
n00b
n00b


Joined: 03 Jun 2002
Posts: 63
Location: Oklahoma City

PostPosted: Thu Oct 24, 2019 3:02 pm    Post subject: Reply with quote

Anon-E-moose wrote:
It should have worked, I just tried and using that version works for me. Although I like to use the minimum required instead.
What does find /etc/portage -name package.provided -ls return


Code:
# find /etc/portage -name package.provided -ls
 95423822      4 -rw-r--r--   1  root     root           77 Oct 24 02:34 /etc/portage/package.provided


When I try to emerge, I get this. dbus is masked, and the patched gtk+ is already installed, but I moved the gtk+ directory out of my repository and copied the patch into the patches directory.

Code:
# emerge -1pv gtk+                                     

These are the packages that would be merged, in order:                                             
Calculating dependencies... done!
[ebuild  N     ] acct-group/messagebus-0::gentoo  0 KiB
[ebuild  N     ] acct-user/messagebus-0::gentoo  0 KiB             
[ebuild  NS    ] app-text/docbook-xml-dtd-4.4-r3:4.4::gentoo [4.1.2-r7:4.1.2::ge
ntoo, 4.3-r2:4.3::gentoo] 94 KiB                                               
[ebuild  NS    ] app-text/docbook-xml-dtd-4.2-r3:4.2::gentoo [4.1.2-r7:4.1.2::ge
ntoo, 4.3-r2:4.3::gentoo] 77 KiB
[ebuild  N     ] app-text/xmlto-0.0.28-r1::gentoo  USE="-latex -text" 125 KiB
[ebuild  N    #] sys-apps/dbus-1.12.16::gentoo  USE="-X -debug -doc -elogind (-s
elinux) -static-libs -systemd -test -user-session" ABI_X86="(64) -32 (-x32)" 2,0
45 KiB
[ebuild  N     ] app-accessibility/at-spi2-core-2.30.1:2::gentoo  USE="introspection -X -gtk-doc -test" ABI_X86="(64) -32 (-x32)" 184 KiB
[ebuild  N     ] app-accessibility/at-spi2-atk-2.30.1:2::gentoo  USE="-test" ABI_X86="(64) -32 (-x32)" 93 KiB
[ebuild     UD ] x11-libs/gtk+-3.24.10:3::gentoo [3.24.10-r9:3::duane] USE="X introspection (-aqua) -broadway -cloudprint -colord -cups -examples -gtk-doc -test -vim-syntax -wayland -xinerama (-atk-bridge%)" ABI_X86="(64) -32 (-x32)" 0 KiB

Total: 9 packages (1 downgrade, 6 new, 2 in new slots), Size of downloads: 2,616 KiB

The following mask changes are necessary to proceed:
 (see "package.unmask" in the portage(5) man page for more details)
# required by app-accessibility/at-spi2-core-2.30.1::gentoo
# required by app-accessibility/at-spi2-atk-2.30.1::gentoo
# required by x11-libs/gtk+-3.24.10::gentoo[X]
# required by gtk+ (argument)
# /etc/portage/package.mask/zzz:
#
=sys-apps/dbus-1.12.16
Back to top
View user's profile Send private message
Perfect Gentleman
l33t
l33t


Joined: 18 May 2014
Posts: 884

PostPosted: Thu Oct 24, 2019 3:23 pm    Post subject: Reply with quote

check mv-overlay
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4339
Location: Dallas area

PostPosted: Thu Oct 24, 2019 3:40 pm    Post subject: Reply with quote

duane wrote:
Anon-E-moose wrote:
It should have worked, I just tried and using that version works for me. Although I like to use the minimum required instead.
What does find /etc/portage -name package.provided -ls return


Code:
# find /etc/portage -name package.provided -ls
 95423822      4 -rw-r--r--   1  root     root           77 Oct 24 02:34 /etc/portage/package.provided


package.provided is in /etc/portage/profile/ on my system.

man portage, doesn't specify that it needs to be in profile ... but the wiki does https://wiki.gentoo.org/wiki//etc/portage/profile/package.provided
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4339
Location: Dallas area

PostPosted: Thu Oct 24, 2019 3:44 pm    Post subject: Reply with quote

So far I know of flussence and mv-overlay that also contain patched ebuilds for gtk+:3 ... any others?
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
duane
n00b
n00b


Joined: 03 Jun 2002
Posts: 63
Location: Oklahoma City

PostPosted: Fri Oct 25, 2019 1:21 am    Post subject: Reply with quote

Anon-E-moose wrote:
package.provided is in /etc/portage/profile/ on my system.


That fixed it. I should have paid more attention to the man page and your instructions.

Edit: Nothing but timeouts when I try to post, then eight posts...
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2799

PostPosted: Fri Oct 25, 2019 3:36 pm    Post subject: Re: Remove the need for dbus when compiling gtk+:3 Reply with quote

Anon-E-moose wrote:
charles17 wrote:
Why put it in /etc/portage/patches instead of listing it in the PATCHES array and having it in the ebuild's files directory?


One less modification to the ebuild.
And I still have hopes to convince the devs to put a use flag around the at-spi2-atk pkg. Which would mean no modifications to the ebuild.

Although, putting app-accessibility/at-spi2-atk in package.provided might provide the same result without the need to modify the ebuild at all.
I'll check it out later.

Edit to add: Thanks to charles17 question I thought of a much easier way (less changes needed), add file to package provided and drop patch in /etc/portage/patches.


Thanks for the solution. The patch applies and everything works.
emerge -1avt x11-libs/gtk+:3::gentoo:
These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild   R    ] x11-libs/gtk+-3.24.10:3::gentoo  USE="X cups (-aqua) -broadway -cloudprint -colord -examples -gtk-doc -introspection -test -vim-syntax -wayland -xinerama" ABI_X86="(64) -32 (-x32)" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No]

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) x11-libs/gtk+-3.24.10::gentoo
 * gtk+-3.24.10.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                                                                                      [ ok ]
>>> Unpacking source...
>>> Unpacking gtk+-3.24.10.tar.xz to /var/tmp/portage/x11-libs/gtk+-3.24.10/work
>>> Source unpacked in /var/tmp/portage/x11-libs/gtk+-3.24.10/work
>>> Preparing source in /var/tmp/portage/x11-libs/gtk+-3.24.10/work/gtk+-3.24.10 ...
 * Applying gtk+-3.24.8-update-icon-cache.patch ...                                                                                                                                                                                                                                                                     [ ok ]
 * Applying gtk+-3.22.20-libcloudproviders-automagic.patch ...                                                                                                                                                                                                                                                          [ ok ]
 * Applying atk-bridge-removal.patch ...                                                                                                                                                                                                                                                                                [ ok ]
 * User patches applied.
Back to top
View user's profile Send private message
xanderal
Tux's lil' helper
Tux's lil' helper


Joined: 06 Mar 2019
Posts: 129
Location: Germany

PostPosted: Mon Oct 28, 2019 10:53 pm    Post subject: Reply with quote

What do you guys think about this forum topic? It was referenced in the package.provided wiki entry.
When I first read about package.provided I kinda thought the same thing Genone wrote in the above topic:
Genone wrote:
Also "pretending" that a package is installed while it is not can cause [...] runtime errors.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4339
Location: Dallas area

PostPosted: Mon Oct 28, 2019 11:04 pm    Post subject: Reply with quote

One should never indiscriminately use package.provided.

You have to be aware of why you are putting an entry there and the ramifications of it.
In the case of at-spi2-atk and gtk:3 with the patch there is no problem.
Because if you are using at-spi2-atk for some other package, then you wouldn't use the patch or entry in package.provided, there wouldn't be a need to.

Putting something like gcc in package.provided would produce interesting results. I can think of a few packages that would be foolish to put there.

It all boils down to understanding what you're doing, why you're doing it, and the consequences (positive and negative)
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum