README.rst 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. This is an example of building a Windows installer for a pygtk application that
  2. includes matplotlib and numpy.
  3. Requirements
  4. ------------
  5. This example needs 7zip in order to work. You can install it for example on
  6. Debian-style distributions using:
  7. ::
  8. sudo apt-get install p7zip
  9. Running the Example
  10. -------------------
  11. In order to build the example application on Linux you have to run the following
  12. two commands in the example directory:
  13. ::
  14. sh grab_files.sh
  15. python -m nsist installer.cfg
  16. The first line will download the dependencies, extract them and copy them into
  17. the :code:`pynsist_pkgs`-directory. It will then remove the temporary directories
  18. used for extraction, but will leave the downloaded archives intact in the
  19. example directory.
  20. Matplotlib
  21. ----------
  22. The example downloads the 32-bit Python 2.7 bindings of Matplotlib 1.4.3
  23. (matplotlib-1.4.3.win32-py2.7.exe).
  24. In the :code:`installer.cfg` Matplotlib additionally requires the six, dateutil
  25. and pyparsing packages:
  26. ::
  27. [Include]
  28. packages=pygtk
  29. numpy
  30. matplotlib
  31. six
  32. dateutil
  33. pyparsing
  34. Numpy
  35. -----
  36. The example downloads the 32-bit Python 2.7 bindings of Numpy 1.9.2
  37. (numpy-1.9.2-win32-superpack-python2.7.exe).
  38. PyGTK
  39. -----
  40. PyGTK is a bit more complex than the other examples, because the GTK runtime
  41. needs to be set up. This needs two things:
  42. 1. The pieces of the GTK runtime and its Python bindings. The script ``grab_files.sh``
  43. downloads these, unpacks them, trims out unnecessary pieces, and places them
  44. where pynsist will find them.
  45. 2. The ``PATH`` environment variable must be modified before we try to import
  46. the Python GTK bindings. This is done by the ``extra_preamble`` field in
  47. ``installer.cfg``.
  48. I referred to the following sources of information to work this out:
  49. Bundling pygtk using py2exe:
  50. http://faq.pygtk.org/index.py?file=faq21.005.htp&req=show
  51. https://web.archive.org/web/20060208162511/http://www.anti-particle.com/py2exe-0.5.shtml
  52. Installing pygtk & deps: http://www.pygtk.org/downloads.html
  53. (inc links for pygtk, pycairo and pygobject installers)
  54. GTK bundles for Windows: http://www.gtk.org/download/win32.php
  55. Installer.cfg
  56. -------------
  57. The example is customized for 32-bit and Python 2.7. This is expressed in the
  58. :code:`installer.cfg`-file like this:
  59. ::
  60. version=2.7.9
  61. bitness=32
  62. The include section requires pygtk, numpy and matplotlib. In order to satisfy the
  63. requirements of Matplotlib the packages six, dateutil, and pyparsing are needed.
  64. ::
  65. [Include]
  66. packages=pygtk
  67. numpy
  68. matplotlib
  69. six
  70. dateutil
  71. pyparsing