Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
The journey of building Cozy (GTK+3, python, gstreamer) for macOS using pyinstaller

The journey of building Cozy on macOS

  • Remove hombrew/macports completely or setup a clean macOS VM
  • Get the GTK+ setup shell script to setup the build environment. Everything which is installed from now on will be bundled with the macOS application later on:
alias jhbuild="PATH=gtk-prefix/bin:$PATH jhbuild"
jhbuild bootstrap
jhbuild build python3

cd gtk/inst/bin
ln -s python3 python
ln -s python3-config python-config

jhbuild shell
cd ~/gtk/inst/lib/python3.6/site-packages/
python six

jhbuild build meta-gtk-osx-bootstrap meta-gtk-osx-gtk3
jhbuild build meta-gtk-osx-python-gtk3
jhbuild build gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-libav gst-plugins-ugly
jhbuild build adwaita-icon-theme hicolor-icon-theme

curl -o
# install all dependencies needed by Cozy
pip install peewee meson
  • Copy libmagic.dylib to gtk folder
  • Install Cozy to ~/gtk/inst/ using meson/ninja
  • For theme support:
jhbuild build gsettings-desktop-schemas
  • Copy share/misc/magic to the gtk folder from other machine (e.g. homebrew installation)
  • Use pyinstaller to build a macOS Application

stack_size error

Drop to shell then:

find . -name "Makefile" -exec sed -i '' 's+-Wl,-stack_size,1000000 ++g' {} \;

libxml2 error

Drop to shell then:

cp ~/gtk/inst/lib/python2.7/sitepackages/* ~/gtk/inst/lib/python3.6/

foreign struct converter error

Add cairo to pyinstaller hidden imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.