(see LICENSE.FDL for license text)

This set of scripts should help you build Qt for Tizen emulator (version 2.1b).
It was tested against Qt 5.0.2 and Qt 5.1 beta (stable branch) and Ubuntu 12.10 and Ubuntu 13.04.


Build steps:

1. Create tizen emulator workdir (for downloading rpm packages, preparing rootfs, buildng Qt
   etc. - you should have a few GB of empty space)
2. Copy scripts to this directory
3. Download copy of tizen-base and tizen-main repos by executing ./download_repos.sh scripts
4. Download Qt5 sources from gitorious
   git clone -b stable https://git.gitorious.org/qt/qt5.gitorious
5. Init Qt5 repositories in qt5.gitorious directory with
   ./init-repository --http --module-subset=qtbase,qtsvg,qtdeclarative,qtscript,qttools,qtxmlpatterns,qtjsbackend,qtimageformats,qtgraphicaleffects
6. Install patches
  6.2 on qtbase module
    cd qt5.Gitorious/qtbase
    patch -p1 < $TIZENBUILDTOOLS/emulator/1_TIZEN_EMULATOR_MKSPECS.patch
  6.1 on qtquickcontrols module 
    cd qt5.Gitorious/qtquickcontrols
    patch -p1 > $TIZENBUILDTOOLS/emulator/1_QT_QUICK_CONTROLS_STYLE.patch
7. Install Tizen SDK 
  7.1 Download appropriate installer from http://download.tizen.org/sdk/InstallManager/tizen-sdk-2.1b
  7.2 Download appropriate sdk image from http://download.tizen.org/sdk/sdk-images/2.1b or use
      installer online (it should already be set to proper target url)
  7.3 Run installer, choose image or use network image source, pick all available components.
8. Run Emulator Manager and create new emulator. It must have HW Virtualization, GPU and File
   Sharing enabled (set created in 1. tizen emulator workidir as File Sharing Path)
9. Wait until download_repos.sh prints "echo "Tizen emulator repositories ready"
10. Run created emulator from Emulator Manager
11. Go to terminal and log into emulator:
    sdb shell
12. Created in 1. (and set in 8. as File Sharing Path) directory is mounted in /mnt/host dir on
    emulator. 
    cd /mnt/host
13. Install development packages on emulator by running install_development_packages.sh scripts
    with root  privileges
    su -c ./install_development_packages.sh
    After this operation rootfs directory appeared in tizen emulator workdir
14. log out from emulator and go to tizen emulator workdir
15. Create Qt5 shadowbuild directory
    mkdir buildQt5TizenEmulator
16. Compile Qt5 by invoking compile_tizenemulator.sh and set appropriate parameters
    cd Qt5TizenEmulator
    ../compile_tizenemulator.sh -h

    Assuming that tizen emulator workdir is /home/user/tizen-emulator, 
    Tizen SDK is installed in /home/user/tizen-sdk, 
    Qt sources are cloned to /home/user/tizen-emulator/qt5.gitorious
    Script could be executed like:

    ../compile_tizenemulator.sh /home/user/tizen-emulator/qt5.gitorious \
      /home/user/tizen-emulator/rootfs \
      /home/user/tizen-sdk/platforms/tizen2.1/rootstraps/tizen-emulator-2.1.native \
      /home/user/tizen-sdk/tizen-sdk/tools/i386-linux-gnueabi-gcc-4.5 \
      /home/user/tizen-emulator/qt5HostInstall

17. After compilation process you should have Qt binaries and development headers
    in /home/user/tizen-emulator/rootfs/opt/usr/qt5. 
    You should copy it to emulator(to /opt/usr/qt5) - don't use it from /mnt/host directory 
    because there are some issues. You can cross compile Qt applications for Tizen emulator 
    with from /home/user/tizen-emulator/qt5HostInstall/bin/qmake without additional configuration.
