Installing Qt for Symbian on Linux

*** These instructions have been superseded by the GnuPoc and Qt for Symbian unofficial installers, described in this post***

 

Update (2009-09-24): Add workaround for GCCE issue.
Update (2009-10-05): Update gnupoc patch to apply against 20091005 snapshot. Remove workarounds from “Known Issues” sections that are already integrated into new patch.
Update (2009-10-07): Add instruction for installing gnupoc build dependencies.
Update (2009-10-23): New patch version (v9), that now applies cleanly to latest snapshots.
Update (2009-11-17): New patch version (v10), now applies against the 4.6.0 RC1 release.

In a previous post, I provided instructions on running Qt for Symbian (the “Tower” release) on Linux. However, for those who want to play with the bleeding edge Qt for Symbian development, you might want to try out the latest 4.6 development code from Qt GIT. I put some instructions for compiling Qt for Symbian from GIT on Linux as well, but unfortunately it requires the RVCT compiler to build.

Fortunately, today espenr announced daily snapshots, that will allow those who don’t have access to RVCT to try out the latest 4.6 development as well :D. So how to get this thing running on Linux? The snapshots so far consist only of the Windows installer and a .zip containing the source code.

By “merging” information from my two previous posts, I will describe below how to install the Qt for Symbian daily snapshots on Linux. Even if you have a previous installation of the Symbian SDK, you will need to follow the full instructions again (sorry), as these instructions contain a bunch of bug fixes to the Symbian SDK. Hopefully this requirement will go away at some point, when all Symbian SDK portability issues are addressed.

These instructions also work for the just released 4.6.0 RC1.

These instructions were tested only in the following environment:

  • Host: x86 32-bits (running Ubuntu 8.10)
  • Device and SDK: S60 5.0 (N97 and 5800)

Preparation

Download all required files:

(many thanks to Francisco Keppler for hosting this last file on his web site!)

For building the native tools from gnupoc, you will need:

  • the GCC C/C++ compilers
  • development files for zlib
  • development files for openssl

On Ubuntu, you can install these using the following command:

sudo apt-get install build-essential zlib1g-dev libssl-dev

Installation

  1. First, set some environment variables to be used on the following steps (feel free to modify them to install the SDK on some other location). NOTE: these variables are not necessary after installation.
  2. # root directory where all SDK files will be installed
    GNUPOC_ROOT=$HOME/gnupoc
     
    # toolchain directory
    TOOLCHAIN_DIR=$GNUPOC_ROOT/csl_gcc
     
    # Symbian SDK directory
    S60_SDK_DIR=$GNUPOC_ROOT/symbian-sdks/5.0
     
    # Qt SDK directory
    QT_S60_DIR=$GNUPOC_ROOT/qt_s60
     
    # wrapper directory (used by gnupoc)
    WRAPPER_DIR=$GNUPOC_ROOT/bin
     
    # where all downloaded files are located
    SRC_DIR=$HOME/downloads

  3. Install ARM toolchain:
  4. mkdir -p $TOOLCHAIN_DIR
    tar -C $TOOLCHAIN_DIR -xvjf \
      $SRC_DIR/gnu-csl-arm-2005Q1C-arm-none-symbianelf-i686-pc-linux-gnu.tar.bz2

  5. Unpack gnupoc sources and apply the patch that adds Qt for Symbian support:
  6. tar -xvzf $SRC_DIR/gnupoc-package-1.13.tar.gz
    cd gnupoc-package-1.13
    patch -p1 -i $SRC_DIR/qt_s60_gnupoc_v10.patch

  7. Install Symbian SDK:
  8. cd sdks
    ./install_gnupoc_s60_50 \
      $SRC_DIR/S60_5th_Edition_SDK_v1_0_en.zip \
      $S60_SDK_DIR

  9. Install gnupoc wrappers and native tools:
  10. ./install_wrapper $WRAPPER_DIR
    cd ../tools
    ./install_eka2_tools $TOOLCHAIN_DIR
    # adjust EKA2TOOLS variable to point to correct location
    sed -i "s,EKA2TOOLS=.*,EKA2TOOLS=$TOOLCHAIN_DIR/bin," \
      $WRAPPER_DIR/gnupoc-common.sh

  11. Create a “gnupoc_env.sh” script to be used for gnupoc environment setup, by running this command:
  12. cat > $GNUPOC_ROOT/gnupoc_env.sh << EOF
    export PATH=$WRAPPER_DIR:\$PATH
    export EPOCROOT=$S60_SDK_DIR/ # trailing "/" is required!
    EOF

    (Note: the “cat << EOF … EOF” snippet above will generate a “gnupoc_env.sh” file in $GNUPOC_ROOT.)

  13. Initialize the Symbian SDK environment (you will need to do this every time you close the current shell session):
  14. . $GNUPOC_ROOT/gnupoc_env.sh

  15. Install OpenC:
  16. cd ../sdks
    chmod +x install_openc_16_s60
    ./install_openc_16_s60 \
      $SRC_DIR/s60_open_c_cpp_plug_in_v1_6_en.zip \
      $S60_SDK_DIR

  17. Install Qt for Symbian (it will take some time because some tools need to be compiled for Linux):
  18. chmod +x install_qt_s60
    ./install_qt_s60 \
      $SRC_DIR/qt-symbian-opensource-<version>.exe \
      $S60_SDK_DIR \
      $QT_S60_DIR

    If installation went well, you should see the following:
    ...
    Qt is now configured for building. To start the build run:make debug-winscw|debug-armv5|release-armv5.
    To reconfigure, run 'make confclean' and configure.

    Of course, you do not want to build Qt, so just ignore it and proceed with the next step.

  19. Create a “qt_s60_env.sh” script to be used to setup Qt for Symbian environment, by running this command:
  20. cat > $GNUPOC_ROOT/qt_s60_env.sh << EOF
    export PATH=$QT_S60_DIR/bin:\$PATH
    export QMAKESPEC=symbian-abld
    EOF

    (Note: the “cat << EOF … EOF” snippet above will generate a “qt_s60_env.sh” file in $GNUPOC_ROOT.)

  21. Initialize the Qt for Symbian environment (you will need to do this every time you close the current shell session):
  22. . $GNUPOC_ROOT/qt_s60_env.sh

  23. Install the following SIS files on your device:
    • $EPOCROOT/nokia_plugin/openc/s60opencsis/pips_s60_1_6_ss.sis
    • $EPOCROOT/nokia_plugin/openc/s60opencsis/openc_ssl_s60_1_6_ss.sis
    • $EPOCROOT/nokia_plugin/opencpp/s60opencppsis/stdcpp_s60_1_6_ss.sis
    • $QT_S60_DIR/qt_selfsigned.sis
  24. Unset all temporary variables we used earlier:
  25. unset GNUPOC_ROOT TOOLCHAIN_DIR S60_SDK_DIR \
      QT_S60_DIR WRAPPER_DIR SRC_DIR

Usage

You need to setup the environment, so tools like qmake, bldmake, abld, makesis etc. are found (not necessary if you just did the installation, unless you closed the shell session):

. /path/to/gnupoc_env.sh
. /path/to/qt_s60_env.sh

Note the “.” (dot) before the gnupoc_env.sh. It says that the contents of the gnupoc_env.sh file will be run in the current shell session, as if you typed them by hand.

To actually build some Qt code, use these commands:

cd path/to/source
qmake # assuming the code already has a .pro file
make debug-gcce # or make debug-armv5 (if using RVCT)
make sis # to generate .sis file

And to clean the source:

make distclean

Notes:

  • Be sure to use qmake from Qt for Symbian. Otherwise the generated Makefiles will be for your host system
  • The trailing slash on the EPOCROOT variable is important (this is assumed in many places on Symbian SDK scripts)

Known Issues

  • The snapshots contain only the the “debug” libraries. Therefore, only the debug targets will work, i.e. use only “make debug-gcce” (if using GCCE compiler) or “make debug-armv5” (if using RVCT)

See also the more general known issues related to Qt for Symbian.

Ideas for improvements and TODO items

  • Add Symbian support to Qt configure script, eliminating the need to compile configure.bin
  • Create a nice GUI installer for Linux
  • Allow to easily upgrade Qt for Symbian SDK installation, without requiring to reinstall the entire Symbian SDK
  • Itegration with Qt Creator, KDevelop or some other IDE

Feel free to contribute with your ideas or even better, help implementing them 😀

About lizardo

My hobby: figure out how systems are expected to work; induce them to work unexpectedly; and responsibly disclose.
This entry was posted in General and tagged , , , . Bookmark the permalink.

9 Responses to Installing Qt for Symbian on Linux

  1. Pingback: Anselmo Lacerda Silveira de Melo (anselmolsm) 's status on Thursday, 24-Sep-09 14:45:02 UTC - Identi.ca

  2. You forgot to tag this article, it didn’t show up in the s60 rss feed.

    Anyway, thanks for the article. Just a little question, do you or anyone else know why the 2005 version of GCCE must be used? Did anyone try it with 2009q1?

    • lizardo says:

      I just added the missing tags…

      It seems 2005 is used because it is the one “certified” by Nokia for Symbian development. I don’t know of anyone who tried the 2009 version.

      If you try it, tells us whether it works or not 🙂

  3. Thanks for these instructions.

    Very useful stuff.

  4. These instructions were tested with the S60 3rd ed. SDK and we managed to build and run applications for N85 as well. =)

  5. Pingback: Installing Qt for Symbian SDK 4.6.1 on Linux « Anderson Lizardo's Blog

  6. Very useful!

    Thanks Lizardo! 🙂

  7. Clement Mason says:

    Hi friends,
    Really amazing blog post.I saw and read your blog,This site is useful to symbian phone.I know that it will help me in my own symbian phone.I think it may be relevant.
    Thank You
    http://clementmasonsblog.blogspot.com/2010/11/symbian-software-support-and.html

  8. Pingback: Compiling Qt Mobility Apps for Symbian on Linux | Kodira

Leave a reply to Frederico SImas Duarte Cancel reply