Create a binary file from the TASTE GUI for Windows sources for Linux

From TASTE
Revision as of 21:01, 4 August 2017 by Ttsiodras (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Requirements

There are lots of alternatives to package a python script to a stand-alone executable. For example: PyInstaller, py2exe, cx_Freeze all offer cross-platform solutions.

To package the Windows TASTE GUI, which uses PySide bindings for Qt to a Linux binary file PyInstaller is used.

The following packages are needed:

  • PySide (package python-pyside on Debian Squeeze testing/Sid) - http://www.pyside.org/ (This package depends upon Qt so Qt libraries will also be installed ).
  • Also make sure ldd and objdump are installed.

Finally, you will also need the TASTE GUI python sources to build the executable. In order to get the sources you need an SVN client (package subversion on Debian Squeeze - http://subversion.apache.org).

How to

Download the PyInstaller tar.gz file from http://www.pyinstaller.org/.

Next, open a terminal and extract the directory of the tar.gz file. Download the taste GUI code:

assert@assertvm:~/pyinstaller$ svn export https://tecsvn.estec.esa.int/svn/taste/trunk/misc/experiments/win-gui-draft/tags/debug_release/ tasteGUI

Type the following to configure the PyInstaller setup:

assert@assertvm:~/pyinstaller$ python Configure.py

This will only have to be run once unless you change your python version.

Next, create a spec file for the project: Type the following to configure the PyInstaller setup:

assert@assertvm:~/pyinstaller$ python Makespec.py tasteGUI/tasteGUI.py

Finally, build the project to a stand-alone binary:

assert@assertvm:~/pyinstaller$ python Build.py tasteGUI/tasteGUI.spec

The final generated directory will be placed in the dist directory under ./tasteGUI.

Note: If you want to generate the executable and associated *.so with the minimum size possible download UPX from http://upx.sourceforge.net/, install it and make sure you add it to your path before you run configure the PyInstaller setup. Then, add the -X option when generating the spec file:

assert@assertvm:~/pyinstaller$ python Makespec.py -X tasteGUI/tasteGUI.py

Next step is to extract Ellidiss tools to ./tasteGUI/dist/tasteGUI and rename the TASTE-linux directory to taste. Then you need to copy ocarina_components.aadl file to the taste directory. For now, the way to get ocarina_components.aadl would be by copying it from the TASTE virtual machine from the path:

/home/assert/tool-inst/share/ocarina/AADLv2/ocarina_components.aadl

Finally, create a directory called doc and place there the taste documentation in .pdf format as taste-documentation-current.pdf (http://download.tuxfamily.org/taste/snapshots/doc/taste-documentation-current.pdf).

Now the ./tasteGUI/dist/tasteGUI folder can by compressed and distributed.