GNOME Bugzilla – Bug 732131
cerbero: Add support for Arch Linux
Last modified: 2015-04-22 15:29:31 UTC
Created attachment 279072 [details] [review] Add support for Arch Linux These patches are needed for cerbero to work in Arch Linux. * Implements Bootstrapper for Arch * Checks if multilib is enabled on amd64, since the gcc package is called differently * Use python2 for gobject-introspection build * Grab arch version from lsb_release, since Arch support was not merged into Python2's platform (3 works) * libkate: use Arch's global LDFLAGS to fix build * add Arch directories to gtk and glib
Created attachment 279073 [details] [review] Change shebang to python2 I separated this from the patch, since it was rejected last time I proposed this patch: https://bugs.freedesktop.org/show_bug.cgi?id=60939 cerbero still works on Arch Linux, when it is run with the python interpreter specified. python2 ./cerbero-uninstalled This should be noted in the documentation or cerbero should support python3, or change the shebang.
(In reply to comment #1) > Created an attachment (id=279073) [details] [review] > Change shebang to python2 This can't be accepted since it will fail on systems on which python2 is not available (such as macosx). Is there really that much of cerbero itself (and not the recipes) that fails with python3 ? Might be better to fix cerbero to work with both python2 and python3 instead
I experimented with 2to3 and fixed some exceptions to support Python3. Mainly these are syntax related and also point out some encoding issues where Python2 is not as restrictive. Luckily most changes are backwards compatible with Python 2 (at least with recent versions, I guess). For the remaining changes one have to branch the code. The main problem I currently have to finish Python 3 support is related to inheritance. Things changed here with Python 3. Maybe this is related to Source class inheriting from "object" 1. The recipe checker does not inherit properly: WARNING: Error loading recipe in file /home/bmonkey/workspace/gst/cerbero/recipes/nettle/nettle.recipe 'Recipe' object has no attribute 'replace_name_and_version' 2. Super class members cannot be obtained with getattr in the Python 3 inheritance model anymore:
+ Trace 233725
stepfunc = getattr(recipe, step)
This stackoverflow post points out that this is bad practice http://stackoverflow.com/questions/9241251/getattr-function-problems-python-3
*** Bug 742876 has been marked as a duplicate of this bug. ***
Created attachment 296044 [details] [review] rebased to current master maybe just this could be merged and the shebang left to /usr/bin/python. i guess arch users will figure out to do: $ python2 cerbero-uninstalled the shebang issue will be resolved with a python 3 port.
Here is an updated version of your patch: http://cgit.collabora.com/git/user/mateo/cerbero.git/commit/?h=archlinux I've updated the way cerbero checks if it is running on a arch linux distro. The code is copied from the python3 code.
(In reply to Matthieu Bouron from comment #6) > Here is an updated version of your patch: > http://cgit.collabora.com/git/user/mateo/cerbero.git/commit/?h=archlinux > > I've updated the way cerbero checks if it is running on a arch linux distro. > The code is copied from the python3 code. Sorry i forgot to comment why I made this change: lsb_release is not necessarily installed on an arch distribution (at least on my machines).
Created attachment 302158 [details] [review] add support for arch linux
Created attachment 302159 [details] [review] add support for arch linux remove unnecessary import
Created attachment 302160 [details] [review] add support for arch linux remove correct import of subprocess