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?
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 :)
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
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?
Created attachment 298767 [details, diff] patch removing libnm-glib and libnm-util dependency
Created attachment 298769 [details] gnome-shell-3.2.1-r2.ebuild
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.
(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.
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?
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 :/)
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
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.
No problem, thanks for the fix!