Tryton client build procedure on Mac OS X

232 views
Skip to first unread message

Fabien Castarède

unread,
Jun 10, 2016, 4:45:23 AM6/10/16
to tryton-dev
Anybody could remember me the procedure to build the client on Mac OS X platform ? I'm stuck after the creation of the GTK environment with jhbuild like explained here : https://wiki.gnome.org/Projects/GTK%2B/OSX/Building and https://wiki.gnome.org/Projects/GTK%2B/OSX/Python.

P.S. : I'm on Mac OS X El Capitan (10.11.5)

Cédric Krier

unread,
Jun 10, 2016, 6:05:03 AM6/10/16
to tryton-dev
On 2016-06-10 01:45, Fabien Castarède wrote:
> Anybody could remember me the procedure to build the client on Mac OS X
> platform ? I'm stuck after the creation of the GTK environment with jhbuild
> like explained here : https://wiki.gnome.org/Projects/GTK%2B/OSX/Building
> and https://wiki.gnome.org/Projects/GTK%2B/OSX/Python.

You just need to setup inside the jhbuild env a correct Python
environment (installing missing dependencies) and run:

$ python setup.py py2app

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Fabien Castarède

unread,
Jun 10, 2016, 9:54:44 AM6/10/16
to tryton-dev


Le vendredi 10 juin 2016 12:05:03 UTC+2, Cédric Krier a écrit :
On 2016-06-10 01:45, Fabien Castarède wrote:
> Anybody could remember me the procedure to build the client on Mac OS X
> platform ? I'm stuck after the creation of the GTK environment with jhbuild
> like explained here : https://wiki.gnome.org/Projects/GTK%2B/OSX/Building
> and https://wiki.gnome.org/Projects/GTK%2B/OSX/Python.

You just need to setup inside the jhbuild env a correct Python
environment (installing missing dependencies) and run:

    $ python setup.py py2app

Thanks. I installed also the librsvg lib (and libcroco on which it depends). The lib is in my GTK install (~/gtk/inst/lib/) :

bash-3.2$ ls -l ~/gtk/inst/lib/librsvg*
-rwxr-xr-x  1 gtkosxbuilder  staff  296132 10 jui 15:34 /Users/gtkosxbuilder/gtk/inst/lib/librsvg-2.2.dylib
-rw-r--r--  1 gtkosxbuilder  staff  389792 10 jui 15:34 /Users/gtkosxbuilder/gtk/inst/lib/librsvg-2.a
lrwxr-xr-x  1 gtkosxbuilder  staff      17 10 jui 15:34 /Users/gtkosxbuilder/gtk/inst/lib/librsvg-2.dylib -> librsvg-2.2.dylib
-rwxr-xr-x  1 gtkosxbuilder  staff    1251 10 jui 15:34 /Users/gtkosxbuilder/gtk/inst/lib/librsvg-2.la

But struggle with this error :

bash-3.2$ python setup.py py2app
running py2app
Traceback (most recent call last):
  File "setup.py", line 169, in <module>
    **args
  File "/Users/gtkosxbuilder/gtk/inst/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/Users/gtkosxbuilder/gtk/inst/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/Users/gtkosxbuilder/gtk/inst/lib/python2.7/distutils/dist.py", line 971, in run_command
    cmd_obj.ensure_finalized()
  File "/Users/gtkosxbuilder/gtk/inst/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
    self.finalize_options()
  File "/Users/gtkosxbuilder/gtk/inst/lib/python2.7/site-packages/py2app-0.10-py2.7.egg/py2app/build_app.py", line 491, in finalize_options
    res = macholib.dyld.dyld_find(fn)
  File "/Users/gtkosxbuilder/gtk/inst/lib/python2.7/site-packages/macholib/dyld.py", line 156, in dyld_find
    raise ValueError("dylib %s could not be found" % (name,))
ValueError: dylib librsvg-2.2.dylib could not be found


Cédric Krier

unread,
Jun 10, 2016, 10:15:03 AM6/10/16
to tryton-dev
If I remember correctly, new MacOS version has a protection by default
against library in $HOME. This protection should be disabled but I don't
remember the name.

Fabien Castarède

unread,
Jun 10, 2016, 11:51:39 AM6/10/16
to tryton-dev
Oh great! Thanks a lot! I didn't know this feature. Found informations on it and how to disable it for those who need it :

Then, I could launch

python setup.py py2app

... but it ends like this :

Modules not found (unconditional imports):
 * ElementC14N (xml.etree.ElementTree)
 * __builtin__.open (repr)
 * __main__.__requires__ (pdb)
 * _weakref.CallableProxyType (_weakrefset)
 * _weakref.ProxyType (_weakrefset)
 * _weakref.ReferenceType (_weakrefset)
 * _weakref.getweakrefcount (_weakrefset)
 * _weakref.getweakrefs (_weakrefset)
 * _weakref.proxy (_weakrefset)
 * _winreg.CloseKey (urllib)
 * _winreg.HKEY_LOCAL_MACHINE (urllib)
 * _winreg.OpenKeyEx (urllib)
 * _winreg.QueryValueEx (urllib)
 * _xmlrpclib (xmlrpclib)
 * cdecimal (tryton.client)
 * errno.EINVAL (os)
 * errno.ENOENT (os)
 * gdk (gtk)
 * goocanvas (goocalendar._calendar, tryton.gui.window.view_form.view.calendar_gtk.toolbar)
 * gtkspell (tryton.gui.main, tryton.gui.window.view_form.view.form_gtk.textbox)
 * imp.reload (inspect)
 * java (xml.sax._exceptions)
 * java.System (java.lang)
 * java.lang.Exception (platform)
 * nt._getfullpathname (os)
 * nt._isdir (os)
 * org (org.python.core, pickle)
 * org.PyStringMap (org.python)
 * org.python (copy, pickle, xml.sax)
 * org.python.core (copy)
 * org.python.core.PyStringMap (pickle, xml.sax)
 * org.python.core.imp (copy, pickle)
 * packaging (pkg_resources)
 * packaging.specifiers (pkg_resources)
 * pwd.getpwnam (distutils.util)
 * six.moves (dateutil.rrule, dateutil.tz.win)
 * six.moves._thread (dateutil.tz.win)
 * six.moves.winreg (dateutil.rrule)
 * sys.getwindowsversion (os)
 * sys.modules (os)
 * sys.py3kwarning (os)
 * sys.version_info (os)
 * thread._local (collections)
 * thread.allocate_lock (collections)
 * thread.stack_size (collections)

Modules not found (conditional imports):
 * _md5 (hashlib)
 * _sha (hashlib)
 * _sha256 (hashlib)
 * _sha512 (hashlib)
 * goocanvas (tryton.gui.window.view_form.view.calendar_)
 * importlib._bootstrap (pkg_resources)
 * java (platform)
 * java.lang (platform, xml.sax._exceptions)
 * org.python.core (xml.sax)
 * riscospath (os)
 * urllib.parse (pkg_resources)

Done!
Traceback (most recent call last):
  File "setup.py", line 284, in <module>
    shutil.copytree(os.path.join(gtk_dir, 'lib', 'pango'), pango_dist_dir)
  File "/Users/gtkosxbuilder/gtk/inst/lib/python2.7/shutil.py", line 171, in copytree
    names = os.listdir(src)
OSError: [Errno 2] No such file or directory: '/Users/gtkosxbuilder/gtk/inst/lib/pango'

I've installed the pango lib, but there is still not 'pango' in ~/gtk/inst/lib, I've just thoses files :

bash-3.2$ ls -l ~/gtk/inst/lib/libpango*
-rwxr-xr-x  1 gtkosxbuilder  staff  367856 10 jui 17:14 /Users/gtkosxbuilder/gtk/inst/lib/libpango-1.0.0.dylib
lrwxr-xr-x  1 gtkosxbuilder  staff      20 10 jui 17:14 /Users/gtkosxbuilder/gtk/inst/lib/libpango-1.0.dylib -> libpango-1.0.0.dylib
-rwxr-xr-x  1 gtkosxbuilder  staff    1146 10 jui 17:14 /Users/gtkosxbuilder/gtk/inst/lib/libpango-1.0.la
-rwxr-xr-x  1 gtkosxbuilder  staff  111288 10 jui 17:14 /Users/gtkosxbuilder/gtk/inst/lib/libpangocairo-1.0.0.dylib
lrwxr-xr-x  1 gtkosxbuilder  staff      25 10 jui 17:14 /Users/gtkosxbuilder/gtk/inst/lib/libpangocairo-1.0.dylib -> libpangocairo-1.0.0.dylib
-rwxr-xr-x  1 gtkosxbuilder  staff    1286 10 jui 17:14 /Users/gtkosxbuilder/gtk/inst/lib/libpangocairo-1.0.la

And the built app doesn't launch, I have this log in my console :

10/06/2016 17:15:20,933 Tryton[12461]: ** (process:12461): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
10/06/2016 17:15:20,933 Tryton[12461]: ** (process:12461): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
10/06/2016 17:15:20,934 Tryton[12461]: ** (process:12461): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
10/06/2016 17:15:21,156 Tryton[12461]: /Users/gtkosxbuilder/DEV/tryton/dist/Tryton.app/Contents/Resources/lib/python2.7/site-packages.zip/tryton/config.py:185: GtkWarning: Cannot open pixbuf loader module file '/Users/gtkosxbuilder/DEV/tryton/dist/Tryton.app/Contents/Resources/../Resources/gdk-pixbuf.loaders': No such file or directory
10/06/2016 17:15:21,156 Tryton[12461]: This likely means that your installation is broken.
10/06/2016 17:15:21,156 Tryton[12461]: Try running the command
10/06/2016 17:15:21,156 Tryton[12461]:   gdk-pixbuf-query-loaders > /Users/gtkosxbuilder/DEV/tryton/dist/Tryton.app/Contents/Resources/../Resources/gdk-pixbuf.loaders
10/06/2016 17:15:21,156 Tryton[12461]: to make things work again for the time being.
10/06/2016 17:15:21,156 Tryton[12461]: Traceback (most recent call last):
10/06/2016 17:15:21,156 Tryton[12461]:   File "/Users/gtkosxbuilder/DEV/tryton/dist/Tryton.app/Contents/Resources/__boot__.py", line 351, in <module>
10/06/2016 17:15:21,156 Tryton[12461]:     _run()
10/06/2016 17:15:21,156 Tryton[12461]:   File "/Users/gtkosxbuilder/DEV/tryton/dist/Tryton.app/Contents/Resources/__boot__.py", line 336, in _run
10/06/2016 17:15:21,156 Tryton[12461]:     exec(compile(source, path, 'exec'), globals(), globals())
10/06/2016 17:15:21,156 Tryton[12461]:   File "/Users/gtkosxbuilder/DEV/tryton/dist/Tryton.app/Contents/Resources/tryton", line 45, in <module>
10/06/2016 17:15:21,156 Tryton[12461]:     from tryton import client
10/06/2016 17:15:21,156 Tryton[12461]:   File "tryton/client.pyc", line 24, in <module>
10/06/2016 17:15:21,157 Tryton[12461]:   File "tryton/common/__init__.pyc", line 3, in <module>
10/06/2016 17:15:21,157 Tryton[12461]:   File "tryton/common/common.pyc", line 16, in <module>
10/06/2016 17:15:21,157 Tryton[12461]:   File "tryton/config.pyc", line 185, in <module>
10/06/2016 17:15:21,157 Tryton[12461]: glib.GError: Couldn't recognize the image file format for file '/Users/gtkosxbuilder/DEV/tryton/dist/Tryton.app/Contents/Resources/../Resources/data/pixmaps/tryton/tryton-icon.png'
10/06/2016 17:15:21,230 Tryton[12461]: Tryton Error
10/06/2016 17:15:21,230 Tryton[12461]: 2016-06-10 17:15:21.230 Tryton[12461:42486] Tryton Error


Step by step I have the feeling that I'm near the goal... but it seems it remains a lot of steps :-)

Cédric Krier

unread,
Jun 11, 2016, 6:05:03 AM6/11/16
to tryton-dev
On 2016-06-10 08:51, Fabien Castarède wrote:
> Traceback (most recent call last):
> File "setup.py", line 284, in <module>
> shutil.copytree(os.path.join(gtk_dir, 'lib', 'pango'), pango_dist_dir)
> File "/Users/gtkosxbuilder/gtk/inst/lib/python2.7/shutil.py", line 171,
> in copytree
> names = os.listdir(src)
> OSError: [Errno 2] No such file or directory:
> '/Users/gtkosxbuilder/gtk/inst/lib/pango'
>
> I've installed the pango lib, but there is still not 'pango' in
> ~/gtk/inst/lib, I've just thoses files :

It looks like the new version of pango (1.38.1 in current jhbuild)
doesn't include anymore modules (stored in lib/pango/modules).
I think it is because of the switch to Harfbuzz.
I did not discover it on our machine because previous build (1.36.8)
created the directory.
So I think you can fill a bug to make the script smarter by not failing
if this folder is missing.

On another level, I have the feeling that the build scripts like py2app
and py2exe should be moved out of the main repository because they
depend too much on external changes which makes them difficult to align
with the release time frame of Tryton.
Reply all
Reply to author
Forward
0 new messages