Qt5-Maemo5/Development

(Prepare your build environment)
(changed from github to gitlab and adapted to modified version of init-repository)
 
(16 intermediate revisions not shown)
Line 1: Line 1:
 +
If you like to commit to the repositories, create an account on gitlab.com and ask in the [http://talk.maemo.org/showthread.php?t=84782 TMO thread]. See the group [https://gitlab.com/groups/qt5-maemo5] page, for an overview of repositories.
 +
= Building Qt5 for the N900 (using scratchbox) =
= Building Qt5 for the N900 (using scratchbox) =
Prerequisites:
Prerequisites:
* any scratchbox ARMEL target, tested with [[CSSU-thumb toolchain setup (gcc4.7.2-linaro)]]
* any scratchbox ARMEL target, tested with [[CSSU-thumb toolchain setup (gcc4.7.2-linaro)]]
-
** We still run this build commands '''outside''' of scratchbox and only use the toolchain and sysroot (like with MADDE or for Raspberry Pi etc.)
+
* Xlib-xcb.h and libX11-xcb.so build from http://maemo.org/packages/source/view/fremantle_sdk_free_source/libx11/1.1.99.6+0m5 (build with --with-xcb)  
-
* Xlib-xcb.h and libX11-xcb.so build from http://maemo.org/packages/source/view/fremantle_sdk_free_source/libx11/1.1.99.6+0m5 (build with --with-xcb) moved to ${MADDEROOT}/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr/include/X11/ (/usr/lib resp.)
+
** We would need to deliver libX11.so.6 too, but --with-xcb breaks keyboard support for system apps
-
** <strike>Binaries available here: [http://repos.fuhlbrueck.net/qt5-maemo5/pool/main/libx/libx11/ repos.fuhlbrueck.net/qt5-maemo5/pool/main/libx/libx11/]</strike>
+
** Solution: we install a copy of libX11.so with XCB supoort, named libXc11.so and link against this copy, so system binaries don't load it (tested, works reliably)
-
*** This does not work, we need a libX11.so build with xcb support, however this stops the keyboard from working in other applications
+
*** apt-get install libxc11-xcb-dev (with frafl's temporary Qt5 repo enabled, see [[Qt5-Maemo5]])
-
** We install a copy of libX11.so with XCB supoort, named libXc11.so and link against this copy
+
-
*** apt-get install -o Dpkg::Options::="--path-exclude=/usr/share/" libxc11-xcb-dev
+
*** all "-lX11" (and "-lX11-xcb") in the Qt sources have been changed to "-lX'''c'''11" ("-lX'''c'''11-xcb" respectively)
*** all "-lX11" (and "-lX11-xcb") in the Qt sources have been changed to "-lX'''c'''11" ("-lX'''c'''11-xcb" respectively)
=== Prepare your build environment ===
=== Prepare your build environment ===
-
GITROOT=`pwd`/qt5-maemo5/
 
-
USER=YourScratchboxUserName
 
-
TARGET=FREMANTLE_ARMEL_GCC472
 
-
COMPILER=linaro-4.7-2012.07-fremantle-armv7a
 
-
#make some dynamic links relative
 
-
rm /scratchbox/users/${USER}/targets/${TARGET}/usr/lib/libdl.so
 
-
ln -s ../../libdl.so.2 /scratchbox/users/${USER}/targets/${TARGET}/usr/lib/libdl.so
 
-
rm /scratchbox/users/${USER}/targets/${TARGET}/usr/lib/libm.so
 
-
ln -s ../../libm.so.6 /scratchbox/users/${USER}/targets/${TARGET}/usr/lib/libm.so
 
-
#make our X11 copy Xc11 also relative
 
-
rm /scratchbox/users/${USER}/targets/${TARGET}/usr/lib/libXc11.so.6.2.0
 
-
ln -s ../../opt/maemo/usr/lib/libXc11.so.6.2.0 /scratchbox/users/${USER}/targets/${TARGET}/usr/lib/libXc11.so.6.2.0
 
-
rm /scratchbox/users/${USER}/targets/${TARGET}/usr/lib/libXc11-xcb.so.1.0.0
 
-
ln -s ../../opt/maemo/usr/lib/libXc11-xcb.so.1.0.0 /scratchbox/users/${USER}/targets/${TARGET}/usr/lib/libXc11-xcb.so.1.0.0
 
  #clone the repo
  #clone the repo
-
  git clone git://gitorious.org/+qt5-maemo5/qt/qt5-maemo5.git
+
  git clone https://gitlab.com/qt5-maemo5/qt5-maemo5.git
-
  cd qt5-maemo5 && git remote set-url --push origin git@gitorious.org:+qt5-maemo5/qt/qt5-maemo5.git
+
  cd qt5-maemo5 && git remote set-url --push origin git@gitlab.com:qt5-maemo5/qt5-maemo5.git
  git checkout maemo5
  git checkout maemo5
-
  git clone git://gitorious.org/+qt5-maemo5/qt/qt5-maemo5-qtbase.git qtbase
+
  ./init-repository -f --module-subset=all
-
git config --add submodule.qtbase.url git://gitorious.org/+qt5-maemo5/qt/qt5-maemo5-qtbase.git
+
  cd qtbase && git remote set-url --push origin git@gitlab.com:qt5-maemo5/qt5-maemo5-qtbase.git && cd ..
-
cd qtbase && git checkout maemo5 && git remote set-url --push origin git@gitorious.org:+qt5-maemo5/qt/qt5-maemo5-qtbase.git && cd ..
+
  cd qtdeclarative && git remote set-url --push origin git@gitlab.com:qt5-maemo5/qt5-maemo5-qtdeclarative.git && cd .. 
-
git clone git://gitorious.org/+qt5-maemo5/qt/qt5-maemo5-qtdeclarative.git
+
  cd qtmaemo5 && git remote set-url --push origin git@gitlab.com:qt5-maemo5/qt5-maemo5-qtmaemo5.git && cd ..
-
git config --add submodule.qtdeclarative.url git://gitorious.org/+qt5-maemo5/qt/qt5-maemo5-qtdeclarative.git
+
  cd debian && ./setupdebianlinks.sh && cd ..
-
cd qtdeclarative && git checkout maemo5 && git remote set-url --push origin git@gitorious.org:+qt5-maemo5/qt/qt5-maemo5-qtdeclarative.git && cd ..
+
-
./init-repository -f
+
  #if you like to use the Thumb2 instructions check for -mthumb in QMAKE_CFLAGS
  #if you like to use the Thumb2 instructions check for -mthumb in QMAKE_CFLAGS
  vim qtbase/mkspecs/devices/linux-maemo-n900-g++/qmake.conf
  vim qtbase/mkspecs/devices/linux-maemo-n900-g++/qmake.conf
 +
=== Now it's time to configure ===
 +
configure for a normal build within scratchbox (now standard)
 +
  PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig/ PKG_CONFIG_SYSROOT_DIR=/ ./configure -no-c++11 -developer-build -opensource -nomake examples -nomake tests -gtkstyle -confirm-license -device linux-maemo-n900-g++ -qt-xcb -make libs -prefix /opt/qt5
-
If you like to commit to the repository, create an account on gitorious.org and ask in this thread: http://talk.maemo.org/showthread.php?t=84782
+
configure for a build '''outside of scratchbox''' instead (should still work, see wiki history for additional prerequisites)
-
 
+
-
=== Now it's time to configure ===
+
  #-no-c++11 is only needed because of a single bug (related to gcc4.7?)
  #-no-c++11 is only needed because of a single bug (related to gcc4.7?)
  ./configure -no-c++11 -developer-build -opensource -nomake examples -nomake tests -confirm-license -device linux-maemo-n900-g++ -device-option CROSS_COMPILE=/scratchbox/compilers/${COMPILER}/bin/arm-none-linux-gnueabi- -sysroot /scratchbox/users/${USER}/targets/${TARGET}/ -qt-xcb -make libs -prefix /opt/qt5
  ./configure -no-c++11 -developer-build -opensource -nomake examples -nomake tests -confirm-license -device linux-maemo-n900-g++ -device-option CROSS_COMPILE=/scratchbox/compilers/${COMPILER}/bin/arm-none-linux-gnueabi- -sysroot /scratchbox/users/${USER}/targets/${TARGET}/ -qt-xcb -make libs -prefix /opt/qt5
Line 50: Line 35:
=== Finally, we build Qt ===
=== Finally, we build Qt ===
  make module-qtbase module-qtdeclarative
  make module-qtbase module-qtdeclarative
-
 
+
#or, especially for additional modules, but works for base and declarative, too
-
 
+
cd qtSOMEMODULE
-
=== Use Qt5 ===
+
  ../qtbase/bin/qmake
-
If you like to compile any Qt program with the newly created Qt build
+
-
  ${GITROOT}/qtbase/bin/qmake
+
-
#qmake already knows about sysroot and toolchain as configured above
+
  make
  make
-
  #copy results to N900
+
  #if debianized (i.e. debian exists)
 +
dpkg-buildpackage -b
 +
#attention: no prober clean rules in debian (to save some time)
 +
#so remove debian/tmp to force prober reinstall
-
Theoretically, you can even install this Qt build in scratchbox (untested):
+
installation (build '''in''' scratchbox (s.a.))
-
#only the first step should require root privileges
+
  cd qtbase && fakeroot make install && cd ..
-
ln -s  /scratchbox/users/${USER}/targets/${TARGET}/opt/qt5 /opt/qt5
+
  cd qtjsbackend && fakeroot make install && cd ..
-
  cd ${GITROOT}/qtbase && make install
+
  cd qtsvg && fakeroot make install && cd ..
-
  cd ${GITROOT}/qtdeclarative && make install
+
  cd qtdeclarative && fakeroot make install && cd ..
-
  cd ${GITROOT}/qtjsbackend && make install
+
  ln -s /opt/qt5/bin/qmake /usr/bin/qmake-qt5
-
  #... (some more as needed by qtdeclarative, e.g. qtsvg)
+
-
  /scratchbox/login
+
-
#change target to the target TARGET
+
-
cd /your/qt/program/
+
-
/opt/qt5/bin/qmake
+
-
make
+
= Building Qt5 for the N900 (using MADDE) =
= Building Qt5 for the N900 (using MADDE) =
 +
'''Deprecated'''
Prerequisites:
Prerequisites:
* [[MADDE]]
* [[MADDE]]
-
* Xlib-xcb.h and libX11-xcb.so build from http://maemo.org/packages/source/view/fremantle_sdk_free_source/libx11/1.1.99.6+0m5 (build with --with-xcb) moved to ${MADDEROOT}/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim/usr/include/X11/ (/usr/lib resp.)
+
* The same as for scratchbox
-
** Binaries available here: [http://repos.fuhlbrueck.net/qt5-maemo5/pool/main/libx/libx11/ repos.fuhlbrueck.net/qt5-maemo5/pool/main/libx/libx11/]
+
 
-
If you want to help porting Qt5 to Maemo5 do:
 
  MADDEROOT=/opt/QtSDK/Maemo/4.6.2
  MADDEROOT=/opt/QtSDK/Maemo/4.6.2
-
  git clone git://gitorious.org/+qt5-maemo5/qt/qt5-maemo5.git
+
  #see scratchbox
-
cd qt5-maemo5 && git remote set-url --push origin git@gitorious.org:+qt5-maemo5/qt
+
  git clone ...
-
checkout maemo5
+
-
  git clone git://gitorious.org/+qt5-maemo5/qt/qt5-maemo5-qtbase.git qtbase
+
-
git config --add submodule.qtbase.url git://gitorious.org/+qt5-maemo5/qt/qt5-maemo5-qtbase.git
+
-
cd qtbase && checkout maemo5 && git remote set-url --push origin git@gitorious.org:+qt5-maemo5/qt/qt5-maemo5-qtbase.git && cd ..
+
-
./init-repository -f
+
  #-sysroots redirects everything to a path under ${MADDEROOT}
  #-sysroots redirects everything to a path under ${MADDEROOT}
  ln -s `pwd` ${MADDEROOT}/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim`pwd`
  ln -s `pwd` ${MADDEROOT}/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim`pwd`
Line 93: Line 67:
  vim qtbase/mkspecs/devices/linux-maemo-n900-g++/qmake.conf
  vim qtbase/mkspecs/devices/linux-maemo-n900-g++/qmake.conf
-
Now it's time to configure:
+
Now it's time to configure and build:
  #change if your host is not x86_64
  #change if your host is not x86_64
-
  ./configure -developer-build -opensource -nomake examples -nomake tests -no-gtkstyle -confirm-license -device linux-maemo-n900-g++ -device-option CROSS_COMPILE=${MADDEROOT}/toolchains/arm-2007q3-51sb6-gdb71-arm-none-linux-gnueabi_linux_x86_64/bin/arm-none-linux-gnueabi- -sysroot ${MADDEROOT}/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim -qt-xcb -make libs -prefix /opt/qt5
+
  ./configure -developer-build -opensource -nomake examples -nomake tests -confirm-license -device linux-maemo-n900-g++ -device-option CROSS_COMPILE=${MADDEROOT}/toolchains/arm-2007q3-51sb6-gdb71-arm-none-linux-gnueabi_linux_x86_64/bin/arm-none-linux-gnueabi- -sysroot ${MADDEROOT}/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim -qt-xcb -make libs -prefix /opt/qt5
-
make module-qtbase module-qtdeclarative
+
make module-qtbase module-qtdeclarative
-
 
+
-
If you like to commit to the repository, create an account on gitorious.org and ask in this thread: http://talk.maemo.org/showthread.php?t=84782
+
-
 
+
-
= Testing Qt5 on the N900 =
+
-
# as root, e.g. with sudo gainroot
+
-
#not endless bandwidth, so use with care:
+
-
echo "deb http://repos.fuhlbrueck.net/qt5-maemo5 fremantle main" >> /etc/apt/sources.list.d/hildon-application-manager.list
+
-
#libX11-xcb1 is not optified, but tiny
+
-
apt-get install libx11-xcb1 qt5-base qt5-declarative
+
-
#only for now:
+
-
ldconfig /opt/qt5/lib
+
-
 
+
-
# as a normal user
+
-
# get some example
+
-
wget http://repos.fuhlbrueck.net/qt5-maemo5-examples/EXAMPLE
+
-
chmod 755 EXAMPLE
+
-
./EXAMPLE
+
-
#don't be confused, if it shows some debug output
+
-
#report any errors to http://talk.maemo.org/showthread.php?t=84782
+

Latest revision as of 19:29, 12 August 2015

If you like to commit to the repositories, create an account on gitlab.com and ask in the TMO thread. See the group [1] page, for an overview of repositories.

Contents

[edit] Building Qt5 for the N900 (using scratchbox)

Prerequisites:

  • any scratchbox ARMEL target, tested with CSSU-thumb toolchain setup (gcc4.7.2-linaro)
  • Xlib-xcb.h and libX11-xcb.so build from http://maemo.org/packages/source/view/fremantle_sdk_free_source/libx11/1.1.99.6+0m5 (build with --with-xcb)
    • We would need to deliver libX11.so.6 too, but --with-xcb breaks keyboard support for system apps
    • Solution: we install a copy of libX11.so with XCB supoort, named libXc11.so and link against this copy, so system binaries don't load it (tested, works reliably)
      • apt-get install libxc11-xcb-dev (with frafl's temporary Qt5 repo enabled, see Qt5-Maemo5)
      • all "-lX11" (and "-lX11-xcb") in the Qt sources have been changed to "-lXc11" ("-lXc11-xcb" respectively)


[edit] Prepare your build environment

#clone the repo
git clone https://gitlab.com/qt5-maemo5/qt5-maemo5.git
cd qt5-maemo5 && git remote set-url --push origin git@gitlab.com:qt5-maemo5/qt5-maemo5.git
git checkout maemo5
./init-repository -f --module-subset=all
 cd qtbase && git remote set-url --push origin git@gitlab.com:qt5-maemo5/qt5-maemo5-qtbase.git && cd ..
 cd qtdeclarative && git remote set-url --push origin git@gitlab.com:qt5-maemo5/qt5-maemo5-qtdeclarative.git && cd ..  
 cd qtmaemo5 && git remote set-url --push origin git@gitlab.com:qt5-maemo5/qt5-maemo5-qtmaemo5.git && cd ..
 cd debian && ./setupdebianlinks.sh && cd ..
#if you like to use the Thumb2 instructions check for -mthumb in QMAKE_CFLAGS
vim qtbase/mkspecs/devices/linux-maemo-n900-g++/qmake.conf

[edit] Now it's time to configure

configure for a normal build within scratchbox (now standard)

 PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig/ PKG_CONFIG_SYSROOT_DIR=/ ./configure -no-c++11 -developer-build -opensource -nomake examples -nomake tests -gtkstyle -confirm-license -device linux-maemo-n900-g++ -qt-xcb -make libs -prefix /opt/qt5

configure for a build outside of scratchbox instead (should still work, see wiki history for additional prerequisites)

#-no-c++11 is only needed because of a single bug (related to gcc4.7?)
./configure -no-c++11 -developer-build -opensource -nomake examples -nomake tests -confirm-license -device linux-maemo-n900-g++ -device-option CROSS_COMPILE=/scratchbox/compilers/${COMPILER}/bin/arm-none-linux-gnueabi- -sysroot /scratchbox/users/${USER}/targets/${TARGET}/ -qt-xcb -make libs -prefix /opt/qt5

[edit] Finally, we build Qt

make module-qtbase module-qtdeclarative
#or, especially for additional modules, but works for base and declarative, too
cd qtSOMEMODULE
../qtbase/bin/qmake
make
#if debianized (i.e. debian exists)
dpkg-buildpackage -b
#attention: no prober clean rules in debian (to save some time)
#so remove debian/tmp to force prober reinstall

installation (build in scratchbox (s.a.))

cd qtbase && fakeroot make install && cd ..
cd qtjsbackend && fakeroot make install && cd ..
cd qtsvg && fakeroot make install && cd .. 
cd qtdeclarative && fakeroot make install && cd ..
ln -s /opt/qt5/bin/qmake /usr/bin/qmake-qt5

[edit] Building Qt5 for the N900 (using MADDE)

Deprecated

Prerequisites:

  • MADDE
  • The same as for scratchbox


MADDEROOT=/opt/QtSDK/Maemo/4.6.2
#see scratchbox
git clone ...
#-sysroots redirects everything to a path under ${MADDEROOT}
ln -s `pwd` ${MADDEROOT}/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim`pwd`
#**Remove** -mthumb in QMAKE_CFLAGS (does not work with current MADDE)
vim qtbase/mkspecs/devices/linux-maemo-n900-g++/qmake.conf

Now it's time to configure and build:

#change if your host is not x86_64
./configure -developer-build -opensource -nomake examples -nomake tests -confirm-license -device linux-maemo-n900-g++ -device-option CROSS_COMPILE=${MADDEROOT}/toolchains/arm-2007q3-51sb6-gdb71-arm-none-linux-gnueabi_linux_x86_64/bin/arm-none-linux-gnueabi- -sysroot ${MADDEROOT}/sysroots/fremantle-arm-sysroot-20.2010.36-2-slim -qt-xcb -make libs -prefix /opt/qt5
make module-qtbase module-qtdeclarative