Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664318 - www-client/firefox: Move gtk+:2 from RDEPEND to DEPEND
Summary: www-client/firefox: Move gtk+:2 from RDEPEND to DEPEND
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-22 22:11 UTC by Alex Xu (Hello71)
Modified: 2020-04-15 16:45 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Xu (Hello71) 2018-08-22 22:11:17 UTC
https://bugs.archlinux.org/task/47398
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2018-09-03 14:38:43 UTC
My builds still link against gtk+:2 via libgtk-x11-2.0.so.0 , I'm not convinced that dropping the dep is a good idea since that'll just convert it to a magic-dep...  I'll try to run this down for the v61 release and see if it can be mitigated or skipped.
Comment 2 Alex Xu (Hello71) 2018-09-03 17:47:17 UTC
it is dlopened when flash is loaded
Comment 3 Alex Xu (Hello71) 2018-09-06 08:26:42 UTC
also automagic dependencies generally refer to the case where a program requires different packages at runtime depending on what was installed at compile time, and this is not controlled by USE flags. this is not an automagic dependency, it is an optional dependency.

with modern firefox, you literally just need to move the dependency from the one variable to the other (and ensure that flash depends on gtk2).
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2018-09-23 01:28:27 UTC
I agree with Ian: Latest Firefox (62.0.2) still builds and installs

/usr/lib64/firefox/gtk2/libmozgtk.so

which links against libgtk-x11-2.0.so.0:

> $ equery belongs /usr/lib64/libgtk-x11-2.0.so.0
> * Searching for /usr/lib64/libgtk-x11-2.0.so.0 ...
> x11-libs/gtk+-2.24.32-r1 (/usr/lib64/libgtk-x11-2.0.so.0.2400.32)
> x11-libs/gtk+-2.24.32-r1 (/usr/lib64/libgtk-x11-2.0.so.0 -> libgtk-x11-2.0.so.0.2400.32)

So we will need it in DEPEND and RDEPEND. It is currently in CDEPEND helper variable which is in DEPEND and RDEPEND so I see nothing left we can do here.

I also see no option to disable mozgtk2.

I tend to close this as invalid.
Comment 5 Alex Xu (Hello71) 2018-09-23 02:50:43 UTC
well, then you might as well throw out the whole idea of "plugins" and "optional dependencies" if you don't believe in dlopen
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2018-09-23 13:40:00 UTC
I am not sure if you understand the problem:

The problem is that firefox will pick up and link against libgtk-x11-2.0.so library, at least when available, during build (I haven't tested if firefox will fail to build at all when this library is absent).

I am not aware of any parameter in firefox's build system to control the usage ob libgtk-x11-2.

If this library isn't really used (and maybe not even listed in upstream's own requirement list -- haven't check that), it would be a 'automagic dependency', see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies

tl;dr
As long as firefox will link against libgtk-x11-2 during build when this library is available, we must keep that library in DEPEND.

Feel free to provide a patch which will fix firefox build system so that firefox won't link against that library anymore even when available.
Comment 7 Alex Xu (Hello71) 2018-09-23 15:36:07 UTC
then I guess you should make pulseaudio a forced dependency, because dlopen doesn't exist.
Comment 8 Matt Turner gentoo-dev 2020-04-15 04:44:57 UTC
I'm quite confused why Hello71 thinks that gtk:2 is a built-time dependency.

Firefox installs libmozgtk.so, which links against gtk:2 (not dlopen!).

ET_DYN libpthread.so.0,libgtk-x11-2.0.so.0,libgdk-x11-2.0.so.0 /usr/lib64/firefox/gtk2/libmozgtk.so 

Whether /usr/bin/firefox dlopens libmozgtk.so doesn't seem material to the point.
Comment 9 Arfrever Frehtes Taifersar Arahesis 2020-04-15 16:33:19 UTC
If /usr/lib64/firefox/gtk2/libmozgtk.so was using dlopen() for libgtk-x11-2.0.so.0 and was not linked against libgtk-x11-2.0.so.0, then not including x11-libs/gtk+:2 in RDEPEND might be acceptable.

In current situation (where linking against libgtk-x11-2.0.so.0 is present), not including x11-libs/gtk+:2 in RDEPEND could result in warnings from package managers and other tools.

If any change was to be made, acceptable solution might be:

IUSE="... gtk2" (or IUSE="... +gtk2")
DEPEND="... gtk2? ( >=x11-libs/gtk+-2.18:2 )"
RDEPEND="... gtk2? ( >=x11-libs/gtk+-2.18:2 )"
...
src_install() {
    ...
    if ! gtk2 && [[ -f ${ED}${MOZILLA_FIVE_HOME}/gtk2/libmozgtk.so ]]; then
        rm "${ED}${MOZILLA_FIVE_HOME}/gtk2/libmozgtk.so" || die
    fi
Comment 10 Alex Xu (Hello71) 2020-04-15 16:38:57 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #9)
> If /usr/lib64/firefox/gtk2/libmozgtk.so was using dlopen() for
> libgtk-x11-2.0.so.0 and was not linked against libgtk-x11-2.0.so.0, then not
> including x11-libs/gtk+:2 in RDEPEND might be acceptable.
> 
> In current situation (where linking against libgtk-x11-2.0.so.0 is present),
> not including x11-libs/gtk+:2 in RDEPEND could result in warnings from
> package managers and other tools.
> 
> If any change was to be made, acceptable solution might be:
> 
> IUSE="... gtk2" (or IUSE="... +gtk2")
> DEPEND="... gtk2? ( >=x11-libs/gtk+-2.18:2 )"
> RDEPEND="... gtk2? ( >=x11-libs/gtk+-2.18:2 )"
> ...
> src_install() {
>     ...
>     if ! gtk2 && [[ -f ${ED}${MOZILLA_FIVE_HOME}/gtk2/libmozgtk.so ]]; then
>         rm "${ED}${MOZILLA_FIVE_HOME}/gtk2/libmozgtk.so" || die
>     fi

yeah, preserved-libs is upset about it, and I couldn't find any easy way to exclude it.
Comment 11 Arfrever Frehtes Taifersar Arahesis 2020-04-15 16:45:16 UTC
(In reply to Alex Xu (Hello71) from comment #10)
> yeah, preserved-libs is upset about it, and I couldn't find any easy way to
> exclude it.

This is one of reasons why you should not try to exclude dependency of installed file from RDEPEND.
Only not installing of given file (preferably preceded by not building it, but maybe not achievable in this case) would be acceptable.