How to build Windows Tryton Client?

Here’s a procedure to build Windows Tryton Client:

First you need a Windows 32 bits (i’m using a Windows 7):

In msys interface:

  • Update database packages and system packages:
pacman -Syu
  • Close msys window and relaunch msys32 to update packages:
pacman -Su
  • Check installed packages:
pacman -Qqe
  • Install some needed packages:
pacman -S mercurial tar mingw-w64-i686-atk mingw-w64-i686-gcc mingw-w64-i686-gdk-pixbuf2 mingw-w64-i686-python2-gobject mingw-w64-i686-gobject-introspection mingw-w64-i686-goocanvas mingw-w64-i686-gtk3 mingw-w64-i686-nsis mingw-w64-i686-python2-babel mingw-w64-i686-python2-setuptools mingw-w64-i686-python2-pygtk mingw-w64-i686-librsvg
  • Download and install cx_Freeze 5.0.2 (there’s a bug with latest available cx_Freeze 5.1.1):
wget http://repo.msys2.org/mingw/i686/mingw-w64-i686-python2-cx_Freeze-5.0.2-1-any.pkg.tar.xz
pacman -U mingw-w64-i686-python2-cx_Freeze-5.0.2-1-any.pkg.tar.xz
  • Install pip:
pacman -S python-pip
pip install python-dateutil
  • Clone Tryton and go to latest stable branch:
hg clone http://hg.tryton.org/tryton
cd tryton
hg up 4.8
  • Execute client compilation script:
sh make-win32-installer.sh

Now, you should get tryton-setup-4.8.2.exe
Hope this help ! Remarks and comments are welcome.

5 Likes

It is probably better to redirect to the homepage of MSYS2 and request to download the executable as the link may change in the future.

It will be good to have a link to the bug report so reader can see if it still apply on future versions.

I think it is not needed to point to the last stable. Reader will update the source to its target.

There is no need for the ./ so I think it will be clearer to remove it.

I updated guidelines following your suggestions…
About the bug, this is very strange… after building Tryton with cx_Freeze 5.0.2, i updated cx_Freeze to 5.1.1 and building Tryton was still working without any error! I made some tests, error is happening when building directly with cx_Freeze 5.1.1, if you build with previous version 5.0.2 and then update to 5.1.1 building the same Tryton folder is ok.
I made a comparison between Tryton folder build with 5.02 and Tryton folder build with 5.1.1 but can’t find which file is causing the error ( https://snag.gy/pl3G7P.jpg )

For me, it just mean that the dist folder kept the _gi dll. I guess you will be able to reproduce it if you clear dist folder before building.

I made a comparison between dist folder (with tryton.exe working) and another one recreated with cx_freeze 5.1.1 (tryton.exe not working): there’s no difference ! There’s no _gi.dll file in the both dist directory. So for me the only difference is in the generated tryton.exe file.

There is lib/gi/_gi.dll.a which is probably the dll that it tries to import.

I forget to add dll comparison in Meld :slight_smile:
Missing dll’s are : LIBEAY32.dll, SSLEAY32.dll, libgdk-win32-2.0-0.dll, libgirepository-1.0-1.dll, libgthread-2.0-0.dll, libgtk-win32-2.0-0.dll, libjasper-4.dll, libjpeg-8.dll, libpyglib-2.0-python2-0.dll, libtiff-5.dll

If i copy LIBEAY32.dll, SSLEAY32.dll, libgirepository-1.0-1.dll, into dist (5.1.1), tryton.exe is now working!

All thoses files are in /dist/lib directory and should be in /dist directory. Don’t know if problem is from generated setup-freeze.py or from cx_Freeze ?

Latest tryton client is using python3 as a requirement.
Can this be updated to python3 ?
Otherwise, how can one build latest tryton client on windows ?

Thank You for this guide

For me, it is just a matter of changing python2 by python3 and we can use last version of cx_Freeze from pacman.

Thanks ced,

I’m able to build the new windows client.
Apparently, pygtk2 is not needed anymore.

once i run

sh make-win32-installer.sh
``` on my msys2 i get this error
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'compile_catalog'

You are missing Babel.

new error
running compile_catalog
compiling catalog tryton/data/locale/bg/LC_MESSAGES/tryton.po to tryton/data/locale/bg/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/ca/LC_MESSAGES/tryton.po to tryton/data/locale/ca/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/cs/LC_MESSAGES/tryton.po to tryton/data/locale/cs/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/de/LC_MESSAGES/tryton.po to tryton/data/locale/de/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/es/LC_MESSAGES/tryton.po to tryton/data/locale/es/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/es_419/LC_MESSAGES/tryton.po to tryton/data/locale/es_419/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/fa/LC_MESSAGES/tryton.po to tryton/data/locale/fa/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/fr/LC_MESSAGES/tryton.po to tryton/data/locale/fr/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/hu_HU/LC_MESSAGES/tryton.po to tryton/data/locale/hu_HU/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/it_IT/LC_MESSAGES/tryton.po to tryton/data/locale/it_IT/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/ja_JP/LC_MESSAGES/tryton.po to tryton/data/locale/ja_JP/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/lo/LC_MESSAGES/tryton.po to tryton/data/locale/lo/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/lt/LC_MESSAGES/tryton.po to tryton/data/locale/lt/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/nl/LC_MESSAGES/tryton.po to tryton/data/locale/nl/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/pl/LC_MESSAGES/tryton.po to tryton/data/locale/pl/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/pt_BR/LC_MESSAGES/tryton.po to tryton/data/locale/pt_BR/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/ru/LC_MESSAGES/tryton.po to tryton/data/locale/ru/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/sl/LC_MESSAGES/tryton.po to tryton/data/locale/sl/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/zh_CN/LC_MESSAGES/tryton.po to tryton/data/locale/zh_CN/LC_MESSAGES/tryton.mo
Traceback (most recent call last):
File “setup-freeze.py”, line 5, in
import user
ModuleNotFoundError: No module named ‘user’

It looks like you are building with Python3 a version prior to 5.0 which does not support without tryton: ab5658e40e22
The user module was used to load ~/.pythonrc.py to setup custom environment variables.

now this
running compile_catalog
compiling catalog tryton/data/locale/bg/LC_MESSAGES/tryton.po to tryton/data/locale/bg/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/ca/LC_MESSAGES/tryton.po to tryton/data/locale/ca/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/cs/LC_MESSAGES/tryton.po to tryton/data/locale/cs/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/de/LC_MESSAGES/tryton.po to tryton/data/locale/de/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/es/LC_MESSAGES/tryton.po to tryton/data/locale/es/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/es_419/LC_MESSAGES/tryton.po to tryton/data/locale/es_419/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/fa/LC_MESSAGES/tryton.po to tryton/data/locale/fa/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/fr/LC_MESSAGES/tryton.po to tryton/data/locale/fr/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/hu_HU/LC_MESSAGES/tryton.po to tryton/data/locale/hu_HU/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/it_IT/LC_MESSAGES/tryton.po to tryton/data/locale/it_IT/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/ja_JP/LC_MESSAGES/tryton.po to tryton/data/locale/ja_JP/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/lo/LC_MESSAGES/tryton.po to tryton/data/locale/lo/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/lt/LC_MESSAGES/tryton.po to tryton/data/locale/lt/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/nl/LC_MESSAGES/tryton.po to tryton/data/locale/nl/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/pl/LC_MESSAGES/tryton.po to tryton/data/locale/pl/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/pt_BR/LC_MESSAGES/tryton.po to tryton/data/locale/pt_BR/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/ru/LC_MESSAGES/tryton.po to tryton/data/locale/ru/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/sl/LC_MESSAGES/tryton.po to tryton/data/locale/sl/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/zh_CN/LC_MESSAGES/tryton.po to tryton/data/locale/zh_CN/LC_MESSAGES/tryton.mo
Traceback (most recent call last):
File “setup-freeze.py”, line 8, in
from cx_Freeze import setup, Executable
ModuleNotFoundError: No module named ‘cx_Freeze’

Well the error message is pretty obvious, isn’t it?

no cx_freeze i think

Traceback (most recent call last):
File “setup-freeze.py”, line 37, in
raise Exception(’%s not found’ % dll)
Exception: librsvg-2-2.dll not found

Added to How to build Windows Tryton Client? librsvg.

after building i tried to build with 5.0.4
i got this
$ sh make-win32-installer.sh
running compile_catalog
compiling catalog tryton/data/locale/bg/LC_MESSAGES/tryton.po to tryton/data/locale/bg/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/ca/LC_MESSAGES/tryton.po to tryton/data/locale/ca/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/cs/LC_MESSAGES/tryton.po to tryton/data/locale/cs/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/de/LC_MESSAGES/tryton.po to tryton/data/locale/de/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/es/LC_MESSAGES/tryton.po to tryton/data/locale/es/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/es_419/LC_MESSAGES/tryton.po to tryton/data/locale/es_419/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/fa/LC_MESSAGES/tryton.po to tryton/data/locale/fa/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/fr/LC_MESSAGES/tryton.po to tryton/data/locale/fr/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/hu_HU/LC_MESSAGES/tryton.po to tryton/data/locale/hu_HU/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/it_IT/LC_MESSAGES/tryton.po to tryton/data/locale/it_IT/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/ja_JP/LC_MESSAGES/tryton.po to tryton/data/locale/ja_JP/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/lo/LC_MESSAGES/tryton.po to tryton/data/locale/lo/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/lt/LC_MESSAGES/tryton.po to tryton/data/locale/lt/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/nl/LC_MESSAGES/tryton.po to tryton/data/locale/nl/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/pl/LC_MESSAGES/tryton.po to tryton/data/locale/pl/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/pt_BR/LC_MESSAGES/tryton.po to tryton/data/locale/pt_BR/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/ru/LC_MESSAGES/tryton.po to tryton/data/locale/ru/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/sl/LC_MESSAGES/tryton.po to tryton/data/locale/sl/LC_MESSAGES/tryton.mo
compiling catalog tryton/data/locale/zh_CN/LC_MESSAGES/tryton.po to tryton/data/locale/zh_CN/LC_MESSAGES/tryton.mo
Traceback (most recent call last):
File “./setup-freeze.py”, line 75, in
with open(gir_file, ‘r’, encoding=‘utf-8’) as src:
FileNotFoundError: [Errno 2] No such file or directory: ‘/usr/share/gir-1.0/Atk-1.0.gir’