After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 732131 - cerbero: Add support for Arch Linux
cerbero: Add support for Arch Linux
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: packages
git master
Other Linux
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 742876 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-06-23 21:00 UTC by Lubosz Sarnecki
Modified: 2015-04-22 15:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add support for Arch Linux (8.00 KB, patch)
2014-06-23 21:00 UTC, Lubosz Sarnecki
none Details | Review
Change shebang to python2 (522 bytes, patch)
2014-06-23 21:03 UTC, Lubosz Sarnecki
none Details | Review
rebased to current master (7.88 KB, patch)
2015-02-03 16:46 UTC, Lubosz Sarnecki
none Details | Review
add support for arch linux (8.35 KB, patch)
2015-04-22 15:10 UTC, Lubosz Sarnecki
none Details | Review
add support for arch linux (8.37 KB, patch)
2015-04-22 15:13 UTC, Lubosz Sarnecki
none Details | Review
add support for arch linux (8.24 KB, patch)
2015-04-22 15:25 UTC, Lubosz Sarnecki
committed Details | Review

Description Lubosz Sarnecki 2014-06-23 21:00:56 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
Comment 1 Lubosz Sarnecki 2014-06-23 21:03:39 UTC
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.
Comment 2 Edward Hervey 2014-06-24 04:20:03 UTC
(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
Comment 3 Lubosz Sarnecki 2014-06-24 13:37:07 UTC
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:

  • File "./cerbero/build/oven.py", line 139 in _cook_recipe
    stepfunc = getattr(recipe, step)
AttributeError: 'Recipe' object has no attribute 'fetch'

This stackoverflow post points out that this is bad practice
http://stackoverflow.com/questions/9241251/getattr-function-problems-python-3
Comment 4 Matthieu Bouron 2015-01-14 15:00:44 UTC
*** Bug 742876 has been marked as a duplicate of this bug. ***
Comment 5 Lubosz Sarnecki 2015-02-03 16:46:01 UTC
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.
Comment 6 Matthieu Bouron 2015-04-22 15:00:40 UTC
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.
Comment 7 Matthieu Bouron 2015-04-22 15:04:11 UTC
(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).
Comment 8 Lubosz Sarnecki 2015-04-22 15:10:21 UTC
Created attachment 302158 [details] [review]
add support for arch linux
Comment 9 Lubosz Sarnecki 2015-04-22 15:13:55 UTC
Created attachment 302159 [details] [review]
add support for arch linux

remove unnecessary import
Comment 10 Lubosz Sarnecki 2015-04-22 15:25:42 UTC
Created attachment 302160 [details] [review]
add support for arch linux

remove correct import of subprocess