How to build Windows 64 bits Tryton Client?

Did you install package cx_freeze?

pacman -S mingw-w64-x86_64-python3-cx_Freeze

yes. but it still gives me this error (this is a fresh MSYS2 install with just the steps mentioned above + the 2 pip install commands i mentioned)

Building 6.2 I have exactly the same problems as @LordVan,
I have installed babel following the guide:
pacman -S merc ... mingw-w64-x86_64-python3-babel ... mingw-w64-x86_64-python3-cx_Freeze
But the compile_catalog error was raised, so I install it via pip.
After that the second error raises:
ModuleNotFoundError: No module named 'cx_Freeze'
and cx_Freeze was installed from the first command I mention.

Maybe the default python is not python3.

Is there any known problem to not build Tryton with Docker image?

So the problem I have was because I was executing msys2 and should be using mingw64 instead.
Now I have the following:

$ sh make-win32-installer.sh
running compile_catalog
error: tryton/data/locale/fa/LC_MESSAGES/tryton.po:108: placeholders are incompatible
error: tryton/data/locale/fa/LC_MESSAGES/tryton.po:558: placeholders are incompatible
2 errors encountered.
Traceback (most recent call last):
  File "C:\msys64\home\zipus\tryton\tryton\setup-freeze.py", line 81, in <module>
    gir_file = glob.glob(
IndexError: list index out of range


I was just testing the same because I also ran into this a while ago. Normally I cannot find a reason to build the client myself but it’s a nice exercise to show why I’m using GNU/Linux :laughing:

My advice now is to just start from scratch again (which I did back then). Uninstall MSYS2 and reinstall a fresh copy and do it all over again.

@acaubet You need to install Evince (it should be added to the list of packages to install but i can’t edit my first post)

pacman -S mingw-w64-x86_64-evince

And it works :slight_smile:

1 Like

I already updated the first post so the package is included on the list of packages to be installed.
Thanks for the pointer.

1 Like

Thanks Pokoli (Section with patch could be also removed :slight_smile: )

Yes that was the problem. By adding a print-statement I also came across this missing package.

1 Like

If it’s possible make also some changes to make clear to use mingw64.exe instead of msys2.exe

Yes, to put this in Bold :slight_smile:

I applied the sugested remarks.

I’m wondering if it won’t be better to convert that post into a how-to of developers.

Do you think it make sense?

No because it is too specific and it breaks too often.

I’m trying to compile last 6.0 version with a clean installation of msys2.
After configure mingw64 with required packages the compilation script gives an error

include_files must be a list of string

So I modified “setup-freeze.py” to add string and not tuples in “include_files” list. It builds the .exe and tryton client can be installed.

But it doesn’t run and gives the following error:

Traceback ...
...
C:/msys64/mingw64/lib/python3.10/site-packages/gi/__init__.py, line 126, in require_version

raise ValueError('Namespace %s not available' % namespace)

ValueError: Namespacfe Gtk not available

Any idea?

Yes your include_files does not include the gtk-3.0 files.

They seem to be there, but probably the problem is the fact command requires list of strings because in this case paths should be relative instead 2-tuples that supports absolute path in first element.

[
'tryton/data',
'tryton/plugins',
'C:/msys64/mingw64/share/glib-2.0/schemas',
'C:/msys64/mingw64/lib/gtk-3.0',
'C:/msys64/mingw64/lib/gdk-pixbuf-2.0',
'C:/msys64/mingw64/lib/evince',
'C:/msys64/mingw64/share/locale',
'C:/msys64/mingw64/share/icons/Adwaita',
'win32/gtk-3.0/gtk.immodules',
'win32/gtk-3.0/gdk-pixbuf.loaders',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/Atk-1.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/EvinceDocument-3.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/EvinceView-3.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/GLib-2.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/GModule-2.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/GObject-2.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/Gdk-3.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/GdkPixbuf-2.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/Gio-2.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/GooCanvas-3.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/Gtk-3.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/HarfBuzz-0.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/Pango-1.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/PangoCairo-1.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/PangoFT2-1.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/Rsvg-2.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/cairo-1.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/fontconfig-2.0.typelib',
'C:/Users/Datalife/AppData/Local/Temp/tmpy0c0hylc/freetype2-2.0.typelib',
'C:\\msys64\\mingw64\\bin/libgobject-2.0-0.dll',
'C:\\msys64\\mingw64\\bin/libevview3-3.dll',
'C:\\msys64\\mingw64\\bin/libatk-1.0-0.dll',
'C:\\msys64\\mingw64\\bin/libgdk-3-0.dll',
'C:\\msys64\\mingw64\\bin/libgdk_pixbuf-2.0-0.dll',
'C:\\msys64\\mingw64\\bin/libgtk-3-0.dll',
'C:\\msys64\\mingw64\\bin/libgoocanvas-3.0-9.dll',
'C:\\msys64\\mingw64\\bin/libpangocairo-1.0-0.dll',
'C:\\msys64\\mingw64\\bin/libpangoft2-1.0-0.dll',
'C:\\msys64\\mingw64\\bin/libgmodule-2.0-0.dll',
'C:\\msys64\\mingw64\\bin/libpango-1.0-0.dll',
'C:\\msys64\\mingw64\\bin/librsvg-2-2.dll',
'C:\\msys64\\mingw64\\bin/libepoxy-0.dll',
'C:\\msys64\\mingw64\\bin/libevdocument3-4.dll',
'C:\\msys64\\mingw64\\bin/libcairo-gobject-2.dll',
'C:\\msys64\\mingw64\\bin/libgio-2.0-0.dll',
'C:\\msys64\\mingw64\\bin/libglib-2.0-0.dll',
'C:\\msys64\\mingw64\\bin/libharfbuzz-gobject-0.dll',
'C:/msys64/mingw64/etc/ssl/cert.pem',
'C:/msys64/mingw64/etc/ssl/certs'
]

If you do not set a tuple, I do not know where the files are included. Tuple is supported: Setup script - cx_Freeze 6.14.1 documentation

Yes I saw it is supported, but it is not working.

...
running install_exe
error: 'include_files' must be a list of strings (got [('tryton/data', 'data'), ...

Installed version is mingw-w64-x86_64-python-cx-freeze 6.14.0-1