GNOME Bugzilla – Bug 507174
Convert from popt to GOption
Last modified: 2009-04-29 10:46:40 UTC
see GNOME Goal #1 at http://live.gnome.org/GnomeGoals/PoptGOption . gnome-python seems to be one of the very last modules still using popt, it would be great to have some efforts to finally get rid of popt for GNOME 2.22. (also see bug 136953 for some historical reference of popt in gnome-python.)
I don't think this will get fixed for GNOME 2.22, unless someone contributes a patch real quick. API/ABI freeze is already next monday, and I'm short on hacking time these days.
*ping*
I'm still short on hacking time; working for a phd tends to have that effect :P Patches are welcome.
Created attachment 112936 [details] [review] goption support This is an initial patch to add support for goption to gnome.init(). popt support has not been changed.
Created attachment 112937 [details] [review] pygobject changes required to build
Created attachment 113617 [details] [review] tweaked patch I did some minor tweaks and cleanups on the patch; otherwise looks good to commit as soon as the needed pygobject changes go in.
Maybe it's time to get it in trunk to be available on 2.24.
Sure but it needs pygobject changes to go in first, otherwise it won't compile.
This is the last and only module still requiring Popt according to the wiki page. Can we PLEASE get this in for 2.24?
The PyGObject changes are not good. They need to be updated to trunk, since the GOption bindings moved to the glib module. The struct fields should be considered private and not exported in public headers, that'll need some work before this can go into pygobject.
Created attachment 117380 [details] [review] updated pyobject patch to add a OptionContext._get_context method
Created attachment 117381 [details] [review] gnome-python patch using _get_context method
Can we get a review here and/or this committed? Gustavo, Johan? This is the very last module waiting to get ported, and hardcode freeze is on next monday.
The status is: gnome-python needs pygobject changes; the pygobject patch is not ready to be committed according to the maintainers; I am not willing to commit development resources to this, interested parties please fix the patches.
Hi Tristan thanks for working on a patch. Can you spend some more time on the pygobject changes with help from some gnome-python people? I am sure you will find someone who will support you with some advice. I bet Andre will reserve a "honourable mention" in one of his posts on planet.gnome.org if you rid GNOME of libpopt :) The changes in question seems to be "The struct fields should be considered private and not exported in public headers, that'll need some work before this can go into pygobject." Thanks for your work again.
Any update on this ? This is the last project missing, so completing this task will complete the GNOME Goal.
> The changes in question seems to be > > "The struct fields should be considered private and not exported in public > headers, that'll need some work before this can go into pygobject." In the pygobject patch in comment #11 a getter on the python object was added to avoid using the struct field from gnome-python - I don't know whether this is sufficient. Also note the patch doesn't remove the popt python wrapper (and hence use of libpopt) they just allow use of the goption parser from gnome-python. I am unsure whether popt support needs to be retained to not break backward compatibility with gnome-python being a library rather than a program.
Comment on attachment 113617 [details] [review] tweaked patch This patch is obsoleted by "gnome-python patch using _get_context method", right?
correct
I committed the pygobject part. I will commit the gnome-python when I branch gnome-python right after the gnome 2.26.1 release (and after the git migration). Time to finish this once and for all.
Hi, in the commit of this, http://git.gnome.org/cgit/gnome-python/commit/?id=d62b041db415ff2e072bc55b064f6c3e7696f7af it seems there is a typo, +m4_define(pyobject_required_version, 2.15.0) It should be pygobject, no?
Yes, thanks for the notice. I had not tested the autotools build system yet.