Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 398593 - gnome-base/gnome-shell: make networkmanager dependency optional
Summary: gnome-base/gnome-shell: make networkmanager dependency optional
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL: https://bugzilla.gnome.org/show_bug.c...
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-01-12 02:46 UTC by Florian Klink
Modified: 2013-04-07 10:10 UTC (History)
0 users

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


Attachments
patch removing libnm-glib and libnm-util dependency (no_nm.patch,16.83 KB, patch)
2012-01-12 15:44 UTC, Florian Klink
Details | Diff
patch removing libnm-glib and libnm-util dependency (gnome-shell-3.2.1-disable-networkmanager.patch,16.83 KB, patch)
2012-01-12 16:31 UTC, Florian Klink
Details | Diff
gnome-shell-3.2.1-r2.ebuild (gnome-shell-3.2.1-r2.ebuild,4.89 KB, text/plain)
2012-01-12 16:32 UTC, Florian Klink
Details
gnome-shell-3.2.1-disable-networkmanager.patch (gnome-shell-3.2.1-disable-networkmanager.patch,11.99 KB, text/plain)
2012-01-12 19:40 UTC, Florian Klink
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Klink 2012-01-12 02:46:04 UTC
I have a system where networkmanager is not necessary (pxeboot).

The only reason why it still gets pulled in is because gnome-shell(3.2.1-r2) DEPENDs on ">=net-misc/networkmanager-0.8.999[introspection]".

Is this really a core dependency, or can you modify the ebuild so that it will only get pulled in if the USE flag is set?
Comment 1 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-01-12 03:45:02 UTC
networkmanager's libnm and libnm-glib are required for gnome-shell to build. It might be possible to patch gnome-shell source so that the build does not need networkmanager, and, very importantly, so that this change does not introduce bugs that only become apparent at runtime.

I do not have the time to work on this. Perhaps you do?

Patches welcome :)
Comment 2 Florian Klink 2012-01-12 15:44:01 UTC
Created attachment 298759 [details, diff]
patch removing libnm-glib and libnm-util dependency

This patch

- removes the libnm-glib and libnm-util dependency from the configure/makefiles
- modifies the Makefile so that shell-network-agent and shell-mobile-providers doesn't get built in
- modifies the javascript code from gnome-shell so that it won't load the NetworkManager module

It compiles and runs successfully, ldd shows that there's no libnm-* linked in, and the panel doesn't have the native networkmanager controls anymore.

This is my first patch for a bigger gnome application, so be careful :-D
Comment 3 Florian Klink 2012-01-12 15:45:34 UTC
By the way, it seems to me as if the Makefile.in doesn't get regenerated in the build process, so I had to patch this one too. Is this a bug or a feature?
Comment 4 Florian Klink 2012-01-12 16:31:21 UTC
Created attachment 298767 [details, diff]
patch removing libnm-glib and libnm-util dependency
Comment 5 Florian Klink 2012-01-12 16:32:04 UTC
Created attachment 298769 [details]
gnome-shell-3.2.1-r2.ebuild
Comment 6 Gilles Dartiguelongue (RETIRED) gentoo-dev 2012-01-12 16:54:42 UTC
Please send this upstream for review. We won't introduce such change without a word from upstream as it clearly is not something they wanted to support in the beginner of gnome 3.
Comment 7 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-01-12 17:15:32 UTC
(In reply to comment #6)
> Please send this upstream for review.

If you want to, but I suspect it will be a waste of time. Upstream has already declared that they don't want to make networkmanager optional: https://bugzilla.gnome.org/show_bug.cgi?id=663523

> We won't introduce such change without a word from upstream

Making a dependency on networkmanager optional is one of those situations where deviating from upstream makes sense. If the patch is clean and looks like something that won't require fiddling with on every version bump, I am perfectly willing to add it to the portage. I fact, I wanted to write such a patch myself before moving gnome-shell from the overlay to portage, but higher-priority tasks got in the way.
Comment 8 Florian Klink 2012-01-12 19:40:11 UTC
Created attachment 298787 [details]
gnome-shell-3.2.1-disable-networkmanager.patch

no need to patch ./configure, as it is generated during build, so we can skip this part.

Somehow src/Makefile.in is not generated, that's why it still has to be patched here. Normally, patching src/Makefile.am should be enough.
Is there a reason for that?

If this can be fixed, the patch should be trivial enough to survive some version bumps :-)

@Alexandre, could you take a look at it?
Comment 9 Pacho Ramos gentoo-dev 2012-01-12 19:50:05 UTC
To regenerate Makefile.in you need to run eautoreconf (from autotools.eclass) in src_prepare phase and others:

        intltoolize --force --copy --automake || die "intltoolize failed" -> this one if you package uses intltool
        eautoreconf
        gnome2_src_prepare

Look to other gnome related ebuild like evolution-2.32.3-r1.ebuild for example :)

Also, the patch should drop NM support when a "--disable-networkmanager" (or similar) option is passed, not always (even if it will need more changes in the patch :/)
Comment 10 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-01-13 06:01:15 UTC
thrice` in #gentoo-desktop has reported that Debian dev Michael Biebl had already posted a patch to make networkmanager in gnome-shell optional: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652482#29
Comment 11 Alexandre Rostovtsev (RETIRED) gentoo-dev 2012-01-13 10:01:21 UTC
Michael Biebl's patch turned out to have a few problems - reassigning to a constant variable and overlooking the fact that disabling networkmanager would also require not importing ui.status.network. Fortunately, it wasn't too difficult to improve the patch so that it works properly.

Florian, thanks for working on the patch. The steps you took to disable networkmanager were sound. However, as Pacho said above, what we wanted was a patch that made networkmanager optional, not hard-disabled it (in Gentoo, we try to avoid conditional patches, i.e. patches that are only applied if a user has certain USE flags selected, because such patches make ebuild testing and maintenance more difficult and error-prone).

>*gnome-shell-3.2.1-r3 (13 Jan 2012)
> 
>  13 Jan 2012; Alexandre Rostovtsev <tetromino@gentoo.org>
>  gnome-shell-3.2.1-r1.ebuild, gnome-shell-3.2.1-r2.ebuild,
>  +gnome-shell-3.2.1-r3.ebuild,
>  +files/gnome-shell-3.2.1-optional-networkmanager.patch:
>  Make networkmanager optional (bug #398593, reported by Florian Klink; patch
>  based on Michael Biebl's work for Debian). Add missing timezone-data and
>  mobile-broadband-provider-info rdeps.
Comment 12 Florian Klink 2012-01-13 13:36:29 UTC
No problem, thanks for the fix!