Monday, 23 April 2012

N9: A trick to get pyside-assistant to build into a Nokia store-compliant path

I'm experimenting with building applications for the Nokia Store on N9.

My current foray involves using PySide in Python.

PySide provides an incomplete harmattan package template in their pyside-assistant tool. Incomplete in that its output would not pass QA on the Nokia Store.

Nokia Store requires that your application's files live under /opt. However pyside-assistant, through python distutils, installs at least the python scripts to /usr instead. (It seems to be following whatever your Python system is set to - I'm on Ubuntu 11.04 and that is what I get.)

However by making a symlink on your computer from /usr to /opt/packagename and adding the line:

sys.prefix = sys.exec_prefix = '/opt/packagename'

The resulting package is rooted in the /opt folder instead.

(Of course there are other more trivial changes that must be made too, and I have yet to try for QA on this application.)

Hope this helps someone.