| 1 |
.. include:: ../icons.rst |
| 2 |
|
| 3 |
====================== |
| 4 |
Application Deployment |
| 5 |
====================== |
| 6 |
|
| 7 |
There is currently no nice deployment story, but it's not impossible. This is |
| 8 |
a list of random notes and examples. |
| 9 |
|
| 10 |
|linux-logo| Linux |
| 11 |
------------------ |
| 12 |
|
| 13 |
On Linux there is no single strategy. Quod Libet uses distutils, MyPaint uses |
| 14 |
SCons. Gramps uses distutils. |
| 15 |
|
| 16 |
|macosx-logo| macOS |
| 17 |
------------------- |
| 18 |
|
| 19 |
On OSX you can use `gtk-osx <https://gitlab.gnome.org/GNOME/gtk-osx>`__ which is |
| 20 |
based on jhbuild and then `gtk-mac-bundler |
| 21 |
<https://gitlab.gnome.org/GNOME/gtk-mac-bundler>`__ for packaging things up and |
| 22 |
making libraries relocatable. With macOS bundles you generally have a startup |
| 23 |
shell script which sets all the various env vars relative to the bundle, |
| 24 |
similar to jhbuild. |
| 25 |
|
| 26 |
|windows-logo| Windows |
| 27 |
---------------------- |
| 28 |
|
| 29 |
On Windows things are usually build to be relocatable by default, so no env |
| 30 |
vars are needed. You can build/install through MSYS2, copy the bits you need |
| 31 |
and you are done. For GUI application you'll also need an exe launcher that |
| 32 |
links against the python dll. |
| 33 |
|
| 34 |
Example Deployments |
| 35 |
------------------- |
| 36 |
|
| 37 |
* `Quod Libet <https://quodlibet.readthedocs.io/>`__ provides a Windows |
| 38 |
installer based on MSYS2 and NSIS3. On macOS, jhbuild is used for building, |
| 39 |
gtk.mac-bundler for packing things up and `dmgbuild |
| 40 |
<https://pypi.org/pypi/dmgbuild>`__ for creating a dmg. distutis is |
| 41 |
used for building/installing the application into the final environment. |
| 42 |
Most of this is automated and scripts can be found in the git repo. |
| 43 |
|
| 44 |
* `MyPaint <https://mypaint.app/>`__ provides a Windows installer based on |
| 45 |
MSYS2 and Inno Setup. It uses SCons for building/installing the application. |
| 46 |
|
| 47 |
* `Passphraser <https://github.com/zevlee/passphraser>`__ uses the Hello World |
| 48 |
GTK template build system (see below). |
| 49 |
|
| 50 |
Other options |
| 51 |
------------- |
| 52 |
|
| 53 |
* `PyInstaller <https://www.pyinstaller.org/>`_ is a program that freezes (packages) Python programs into stand-alone executables, under Windows, Linux, Mac OS X, and more. PyInstaller's packager has built-in support for automatically including PyGObject dependencies with your application without requiring additional configuration. |
| 54 |
* `Hello World GTK <https://github.com/zevlee/hello-world-gtk>`_ is a template build system for distributing Python-based GTK applications on Windows, macOS, and Linux. First, an application directory is assembled using PyInstaller. Then, a different program is used to package the resulting directory. For Windows, NSIS3 is used. For macOS, the built-in hdiutil is used. For Linux, AppImageKit is used. |