×
Namespaces

Variants
Actions

Archived:Build PySymbian

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngAquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.

Article Metadata
Article
Created: rcu (19 Dec 2010)
Last edited: hamishwillee (31 May 2013)

This article shows how to build the PySymbian 2.0 runtime and extensions from source.

Needs-update.pngThis article needs to be updated: If you found this article useful, please fix the problems below then delete the {{ArticleNeedsUpdate}} template from the article to remove this warning.

Reasons: hamishwillee (14 Nov 2011)
Compiler required to build no longer available (was linked at http URL (//tools.ext.nokia.com/download/beta_build.php). It also doesn't explain where the source can be obtained.

Steps to build PySymbian 2.0:

Note: to build PySymbian 2.0 I got inspired from pys60-2.0.0_src.zip\src\README_BUILD_INSTRUCTIONS.txt.

To build we need:

To configure the build, open a command prompt:

  • give: set EPOCROOT=\
  • give: subst t: C:\Symbian\9.1\S60_3rd_MR (for example)
  • (make sure that Python 2.5.4 is in your PATH.)
  • unzip pys60-2.0.0_src.zip in T:\PySymbian_2_0
  • give: T: and then cd PySymbian_2_0
  • give: python setup.py configure -s 30gcce -k selfsigned --caps "LocalServices NetworkServices ReadUserData WriteUserData UserEnvironment" >stdout_config

(Note: I was not able to successfully run python setup.py build --device because the GCCE compiler crashes (:o) at _sre.c - somebody else had the same issue: http://www.developer.nokia.com/Community/Discussion/showthread.php?165341-PySymbian-1.9.3-compilation-problem-(in-order-to-compile-modules)/page2 . Therefore I use Carbide directly.)

To build:

  • open Carbide:
  • import in Carbide C:\Symbian\9.1\S60_3rd_MR\PySymbian_2_0\newcore\Symbian\group\bld.inf. (do not import T:\...\bld.inf, since Carbide and the project need to reside on the same drive, otherwise you receive errors).
  • build GCCE release.

Then I have C:\Symbian\9.1\S60_3rd_MR\Epoc32\BUILD\Symbian\9.1\S60_3rd_MR\PySymbian_2_0\newcore\Symbian\group\PYTHON25\GCCE\UREL\python25.dll. :))) But a few modules didn't compile :(.

Notes about ARMV5 and GCCE build configurations:

Building PyS0 extensions

First:

  • Install S60 SDK – tried with 3rd edition FP1.
  • Install Carbide (tested on 2.7 and 2.3).
  • Install PySymbian 2.0 SDK and copy the header files, etc in Symbian\9.2\S60_3rd_FP1, etc!!!!.

Then:

  • At least for S60 3rd FP1 edit C:\Symbian\9.2\S60_3rd_FP1\Epoc32\include\python25\pyconfig.h:
     commented (not necessary in amigaconfig.h)
     #define HAVE_STDINT_H 1
     #define HAVE_UINTPTR_T 1
     #define HAVE_SYS_SELECT_H 1
     #define HAVE_WCHAR_H 1
     uncommented (probably not necessary) /* #undef HAVE_USABLE_WCHAR_T */
     added also in the automatically generated .mmp by Py_XT_create - SYSTEMINCLUDE \epoc32\include\libc 
     edited /Symbian/9.2/S60_3rd_FP1/EPOC32/include/python25/Python-ast.h - add newline at EOF
  • Also, to build sysagent module on 3rd edition FP1
       Copied SharedData\epoc32\include\psvariables.h, coreapplicationuisinternalpskeys.h and telephonyinternalpskeys.h from S60_3rd_SDK_MR_API_Plug-In_Pack_v5_43.zip.
       (note that it is MR and not FP1)


In Carbide:

  • import project - Symbian OS\Symbian OS Bld.inf file
  • import bld.inf in Carbide - select All Build config
  • Build Configuration\Set Active - Phone Release (GCCE)
  • put the project on the same drive as the Carbide installation
  • then build project
  • then find generated .pyd in C:\Symbian\9.2\S60_3rd_FP1\Epoc32\release\gcce\urel\


If converting PySymbian 1.4.5 extensions to PySymbian 2.0 consult PySymbian manual. Reproduced here: The changes needed for porting existing native PySymbian extensions are as follows:

  • From Symbian 9.1 onwards Symbian allows Writable Static Data in a DLL by making use of EPOCALLOWDLLDATA keyword in the mmp file. Main reason for this one is for porting some non-Symbian applications onto Symbian. Thus TLS functionality is no longer needed. Use EPOCALLOWDLLDATA in the MMP file if the module has initialized static data.
  • Use PyGILState_Ensure() and PyGILState_Release() functions for acquiring and releasing the global interpreter lock, instead of using PyEval_RestoreThread(PYTHON_TLS->thread_state) and PyEval_SaveThread().
  • The interpreter DLL name is changed to python25.lib. This change has to be reflected in the MMP file so that the module is linked against this DLL instead of python222.lib used in 1.4.x.
  • The Python header files are now in \epoc32\include\Python25 and hence the MMP file needs to be updated accordingly.
  • The pyd name should be kf_module-name.pyd.
   Note: This change is required only for the pyd name and module name is not required to have this prefix.
  • Packaging an extension module is explained in section 8.1.3, Distributing extension modules.
   Note: The init-function still needs to be exported in the pyd at ordinal 1.


IMPORTANT NOTES:

   Be careful to choose the Carbide project name the same as the folder name, otherwise it will give error at import.
   While importing project, be sure also to choose the right workspace path (e.g., the folder containing group, src, inc of each project).


Py_XT_Creator - movie on YouTube says:

  • enter name, UID
  • import bld.inf in Carbide - select All Build config
  • Build Configuration\Set Active - Phone Release (GCCE)
  • Go to Project Properties\SIS builder tab, give Add, choose PKG File the one sis\....pkg
This page was last modified on 31 May 2013, at 04:06.
58 page views in the last 30 days.
×