注:2006年06月02日,因为Qtopia PDA GPL的最新版本为2.2.0,Qtopia Phone的最新版本为4.1.2,所以本文内容已经比较陈旧了,希望大家参考以下文档,谢谢。 最近开始学习Qtopia了,发现这个东西的安装还是比较麻烦的,装了很多遍,就想写点东西,也许对大家有些用处。 Qtopia分为PDA版和Phone版,其中PDA版大家可以拿到自由版,Phone版只有付费的用户才可以拿到。但安装过程大致相同,我这里就挑选PDA自由版的1.7.0、2.1.1和Phone版的2.1.0 Eval和2.1.2作为介绍对象。 (备注:因为各个Linux发行版的不同,所以在build的过程中,会有一些包的依赖关系的问题。我这里使用的是SUSE 9.3,系统已经有了Qt X11 Free 3.3.4,在/usr/lib/qt3,大家如果使用其它Linux发行版,请大家注意修改有关这个的设置。一般默认安装情况下,我们还需要e2fsprogs-devel和libjpeg-devel两个包,请大家自己安装好。我们需要前一个包里面的uuid和后一个包里面的jpeg的头文件。) (注:2005年10月31日加入Qtopia Phone 2.1.0 Eval安装。) Qtopia的Phone Eval版需要下面这些包: qtopia-phone-source-eval-2.1.0.tar.gz
qt-embedded-2.3.9-eval.tar.gz
qt-x11-2.3.2-eval.tar.gz
qt-x11-eval-3.3.0.tar.gz qtopia-phone-source-2.1.2.tar.gz
qt-embedded-2.3.11-commercial.tar.gz
qt-x11-2.3.2-commercial.tar.gz
qt-x11-commercial-3.3.4.tar.gz 假设你已经把上面的各个包下载到$HOME/Trolltech下了。 tar zxvf tmake-1.13.tar.gz tar zxvf qtopia-free-1.7.0.tar.gz mv qtopia-free-1.7.0 qtopia-free-1.7.0-debug tar zxvf qt-embedded-2.3.7.tar.gz mv qt-2.3.7 qt-embedded-free-2.3.7-debug tar zxvf qtopia-free-source-2.1.1.tar.gz mv qtopia-free-2.1.1 qtopia-free-2.1.1-debug tar zxvf qt-embedded-2.3.10-free.tar.gz mv qt-2.3.10 qt-embedded-free-2.3.10-debug tar zxvf qt-x11-2.3.2.tar.gz mv qt-2.3.2 qt-x11-free-2.3.2-debug tar zxvf qtopia-phone-source-eval-2.1.0.tar.gz mv qtopia-eval-2.1.0 qtopia-phone-eval-2.1.0-debug tar zxvf qt-embedded-2.3.9-eval.tar.gz mv qt-2.3.9 qt-embedded-eval-2.3.9-debug tar zxvf qt-x11-2.3.2-eval.tar.gz mv qt-2.3.2 qt-x11-eval-2.3.2-debug tar zxvf qt-x11-eval-3.3.0.tar.gz mv qt-3.3.0 qt-x11-eval-3.3.0-debug tar zxvf qtopia-phone-source-2.1.2.tar.gz mv qtopia-phone-2.1.2 qtopia-phone-2.1.2-debug tar zxvf qt-embedded-2.3.11-commercial.tar.gz mv qt-2.3.11 qt-embedded-commercial-2.3.11-debug tar zxvf qt-x11-2.3.2-commercial.tar.gz mv qt-2.3.2 qt-x11-commercial-2.3.2-debug tar zxvf qt-x11-commercial-3.3.4.tar.gz mv qt-3.3.4 qt-x11-commercial-3.3.4-debug 安装的过程是参考$HOME/Trolltech/qtopia-free-2.1.1-debug/scripts/build_qtopia这个脚本文件进行的。启动脚本是参考$HOME/Trolltech/qtopia-phone-2.1.2-debug/bin/startphonedemo改写的。 第一步,我们先准备一个shell文件,我这里以bash为例: vi $HOME/shell/qtopia-free-1.7.0.sh TROLLTECHDIR=$HOME/Trolltech TMAKEDIR=$TROLLTECHDIR/tmake-1.13 QT2DIR=$TROLLTECHDIR/qt-x11-free-2.3.2-debug QTEDIR=$TROLLTECHDIR/qt-embedded-free-2.3.7-debug QPEDIR=$TROLLTECHDIR/qtopia-free-1.7.0-debug TMAKEPATH=$TMAKEDIR/lib/qws/linux-generic-g++ PATH=$QT2DIR/binQTEDIR/binQPEDIR/binDQTDIR/bin:$QT3DIR/bin:$QTDIR/bin:$TMAKEDIR/bin:$PATH LD_LIBRARY_PATH=$QT2DIR/lib:$QTEDIR/lib:$QPEDIR/lib:$DQTDIR/lib:$QT3DIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH export TROLLTECHDIR TMAKEDIE QT2DIR QTEDIR QPEDIR QT3DIR QTDIR DQTDIR TMAKEPATH QMAKESPEC PATH LD_LIBRARY_PATH source $HOME/shell/qtopia-free-1.7.0.sh 自由版中,因为Qtopia Desktop不能进行编译,所以编译过程中不需要编译Qt X11 3.x版本。我们这就开始编译了: cp $QPEDIR/src/qt/qconfig-qpe.h src/tools -f ./configure -debug -qconfig qpe -qvfb -depths 4,8,16,32 -keypad-mode -system-jpeg -gif export PATH=$QTDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure -debug -no-opengl -no-xft cp $QTDIR/bin/uic $QTEDIR/bin tmake qvfb.pro > Makefile export PATH=$QTDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH 编译已经完成了,Qtopia 1.7.0自由版中没有提供启动脚本,我们来写一个: vi $HOME/shell/startpdademo-1.7.0.sh source $HOME/shell/qtopia-free-1.7.0.sh export QTDIR=$HOME/Trolltech/qt-embedded-free-2.3.7-debug export QPEDIR=$HOME/Trolltech/qtopia-free-1.7.0-debug export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH export PATH=$QPEDIR/bin:$PATH
/bin/ps -e | /bin/sed -n -e '/\<'$1'\>/ s/^ *\([0-9][0-9]*\).*/\1/p'
[ "$pid" != "" ] && kill $pid
[ -x /sbin/fuser ] && ( /sbin/fuser -kn tcp 4242 || /sbin/fuser -kn tcp 4243 ) [ -x /bin/fuser ] && ( /bin/fuser -kn tcp 4242 || /bin/fuser -kn tcp 4243 ) echo "Stopping common sound deamons..." artsd_pid=`findproc artsd` [ "$artsd_pid" != "" ] && kill $artsd_pid [ "$esd_pid" != "" ] && kill $esd_pid qvfb -width 240 -height 320 & echo "Starting Qtopia PDA 1.7.0..." HOME=$HOME/Trolltech/qtopia-free-1.7.0-debug/demohome qpe echo "Restarting killed sound deamons..." [ "$artsd_pid" != "" ] && artsd & [ "$esd_pid" != "" ] && esd & 第一步,我们先准备一个shell文件,我这里以bash为例: vi $HOME/shell/qtopia-free-2.1.1.sh TROLLTECHDIR=$HOME/Trolltech TMAKEDIR=$TROLLTECHDIR/tmake-1.13 QT2DIR=$TROLLTECHDIR/qt-x11-free-2.3.2-debug QTEDIR=$TROLLTECHDIR/qt-embedded-free-2.3.10-debug QPEDIR=$TROLLTECHDIR/qtopia-phone-2.1.1-debug TMAKEPATH=$TMAKEDIR/lib/qws/linux-generic-g++ PATH=$QT2DIR/bin:$QTEDIR/bin:$QPEDIR/bin:$DQTDIR/bin:$QT3DIR/bin:$QTDIR/bin:$TMAKEDIR/bin:$PATH LD_LIBRARY_PATH=$QT2DIR/lib:$QTEDIR/lib:$QPEDIR/lib:$DQTDIR/lib:$QT3DIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH export TROLLTECHDIR TMAKEDIE QT2DIR QTEDIR QPEDIR QT3DIR QTDIR DQTDIR TMAKEPATH QMAKESPEC PATH LD_LIBRARY_PATH source $HOME/shell/qtopia-free-2.1.1.sh 自由版中,因为Qtopia Desktop不能进行编译,所以编译过程中不需要编译Qt X11 3.x版本。我们这就开始编译了: cp $QPEDIR/src/qt/qconfig-qpe.h src/tools -f ./configure -debug -qconfig qpe -qvfb -depths 4,8,16,32 -keypad-mode -system-jpeg -gif export PATH=$QTDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure -debug -no-opengl -no-xft cp $QTDIR/bin/uic $QTEDIR/bin tmake qvfb.pro > Makefile export PATH=$QTDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure -debug -edition pda -no-qtopiadesktop -displaysize 240x320 编译已经完成了,Qtopia 2.1.1自由版中没有提供启动脚本,我们来写一个: vi $HOME/shell/startpdademo-2.1.1.sh source $HOME/shell/qtopia-free-2.1.1.sh export QTDIR=$HOME/Trolltech/qtopia-free-2.1.1-debug/image/opt/Qtopia export QPEDIR=$HOME/Trolltech/qtopia-free-2.1.1-debug/image/opt/Qtopia export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH export PATH=$QPEDIR/bin:$PATH
/bin/ps -e | /bin/sed -n -e '/\<'$1'\>/ s/^ *\([0-9][0-9]*\).*/\1/p'
[ "$pid" != "" ] && kill $pid
[ -x /sbin/fuser ] && ( /sbin/fuser -kn tcp 4242 || /sbin/fuser -kn tcp 4243 ) [ -x /bin/fuser ] && ( /bin/fuser -kn tcp 4242 || /bin/fuser -kn tcp 4243 ) echo "Stopping common sound deamons..." artsd_pid=`findproc artsd` [ "$artsd_pid" != "" ] && kill $artsd_pid [ "$esd_pid" != "" ] && kill $esd_pid qvfb -width 240 -height 320 & echo "Starting Qtopia 2.1.1..." HOME=$HOME/Trolltech/qtopia-free-2.1.1-debug/image/opt/Qtopia/demohome qpe echo "Restarting killed sound deamons..." [ "$artsd_pid" != "" ] && artsd & [ "$esd_pid" != "" ] && esd & Qtopia Phone 2.1.0 Eval安装
第一步,我们先准备一个shell文件,我这里以bash为例: vi $HOME/shell/qtopia-phone-eval-2.1.0.sh TROLLTECHDIR=$HOME/Trolltech TMAKEDIR=$TROLLTECHDIR/tmake-1.13 QT2DIR=$TROLLTECHDIR/qt-x11-eval-2.3.2-debug QTEDIR=$TROLLTECHDIR/qt-embedded-eval-2.3.91-debug QPEDIR=$TROLLTECHDIR/qtopia-phone-eval-2.1.0-debug QT3DIR=$TROLLTECHDIR/qt-x11-eval-3.3.0-debug TMAKEPATH=$TMAKEDIR/lib/qws/linux-generic-g++ PATH=$QT2DIR/bin:$QTEDIR/bin:$QPEDIR/bin:$DQTDIR/bin:$QT3DIR/bin:$QTDIR/bin:$TMAKEDIR/bin:$PATH LD_LIBRARY_PATH=$QT2DIR/lib:$QTEDIR/lib:$QPEDIR/lib:$DQTDIR/lib:$QT3DIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH export TROLLTECHDIR TMAKEDIE QT2DIR QTEDIR QPEDIR QT3DIR QTDIR DQTDIR TMAKEPATH QMAKESPEC PATH LD_LIBRARY_PATH source $HOME/shell/qtopia-phone-eval-2.1.0.sh 因为需要编译Qtopia Desktop,所以需要编译Qt X11 3.x版本。我们这就开始编译了: cp $QPEDIR/src/qt/qconfig-qpe.h src/tools -f ./configure -debug -qconfig qpe -qvfb -depths 4,8,16,32 -keypad-mode -system-jpeg -gif export PATH=$QTDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure -debug -no-opengl -no-xft cp $QTDIR/bin/uic $QTEDIR/bin tmake qvfb.pro > Makefile export PATH=$QTDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure -debug -fast -thread cd tools/linguist/lrelease export PATH=$QTDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure -debug -edition phone -qtopiadesktop -displaysize 176x208 cp *.xml $QPEDIR/image/opt/Qtopia/etc cp $QTEDIR/bin/qvfb $QPEDIR/image/opt/Qtopia/bin cp $QTEDIR/tools/qvfb/*.skin $QPEDIR/image/opt/Qtopia/bin -rf 编译已经完成了,Qtopia Phone 2.1.0 Eval中提供了一个启动脚本,但是我们还是重写一个: vi $HOME/shell/startphonedemo-eval-2.1.0.sh source $HOME/shell/qtopia-phone-eval-2.1.0.sh export QTDIR=$HOME/Trolltech/qtopia-phone-eval-2.1.0-debug/image/opt/Qtopia export QPEDIR=$HOME/Trolltech/qtopia-phone-eval-2.1.0-debug/image/opt/Qtopia export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH export PATH=$QPEDIR/bin:$PATH if [ -z "$QTOPIA_PHONE_DEVICE" ]; then
export QTOPIA_PHONE_DEVICE=sim:localhost
echo "lease select a phone demo mode:" echo "
1. Touchscreen Phone" echo "Your choice (default 1): " PHONESKIN=$QPEDIR/bin/SmartPhone.skin PHONESKIN=$QPEDIR/bin/TouchscreenPhone.skin
/bin/ps -e | /bin/sed -n -e '/\<'$1'\>/ s/^ *\([0-9][0-9]*\).*/\1/p'
[ "$pid" != "" ] && kill $pid
[ -x /sbin/fuser ] && ( /sbin/fuser -kn tcp 4242 || /sbin/fuser -kn tcp 4243 ) [ -x /bin/fuser ] && ( /bin/fuser -kn tcp 4242 || /bin/fuser -kn tcp 4243 ) echo "Stopping common sound deamons..." artsd_pid=`findproc artsd` [ "$artsd_pid" != "" ] && kill $artsd_pid [ "$esd_pid" != "" ] && kill $esd_pid echo "Stopping phone simulator..." if [ $QTOPIA_PHONE_DEVICE = "sim:localhost" ]; then
echo "Starting phone simulator..."
phonesim -gui $QPEDIR/etc/troll.xml &
echo "Starting Qtopia Phone 2.1.0 Eval..." HOME=$HOME/Trolltech/qtopia-phone-eval-2.1.0-debug/image/opt/Qtopia/demohome qpe if [ $QTOPIA_PHONE_DEVICE = "sim:localhost" ]; then
echo "Stopping phone simulator..."
echo "Restarting killed sound deamons..." [ "$artsd_pid" != "" ] && artsd & [ "$esd_pid" != "" ] && esd & 第一步,我们先准备一个shell文件,我这里以bash为例: vi $HOME/shell/qtopia-phone-2.1.2.sh TROLLTECHDIR=$HOME/Trolltech TMAKEDIR=$TROLLTECHDIR/tmake-1.13 QT2DIR=$TROLLTECHDIR/qt-x11-commercial-2.3.2-debug QTEDIR=$TROLLTECHDIR/qt-embedded-commercial-2.3.11-debug QPEDIR=$TROLLTECHDIR/qtopia-phone-2.1.2-debug QT3DIR=$TROLLTECHDIR/qt-x11-commercial-3.3.4-debug TMAKEPATH=$TMAKEDIR/lib/qws/linux-generic-g++ PATH=$QT2DIR/bin:$QTEDIR/bin:$QPEDIR/bin:$DQTDIR/bin:$QT3DIR/bin:$QTDIR/bin:$TMAKEDIR/bin:$PATH LD_LIBRARY_PATH=$QT2DIR/lib:$QTEDIR/lib:$QPEDIR/lib:$DQTDIR/lib:$QT3DIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH export TROLLTECHDIR TMAKEDIE QT2DIR QTEDIR QPEDIR QT3DIR QTDIR DQTDIR TMAKEPATH QMAKESPEC PATH LD_LIBRARY_PATH source $HOME/shell/qtopia-phone-2.1.2.sh 因为需要编译Qtopia Desktop,所以需要编译Qt X11 3.x版本。我们这就开始编译了: cp $QPEDIR/src/qt/qconfig-qpe.h src/tools -f ./configure -debug -qconfig qpe -qvfb -depths 4,8,16,32 -keypad-mode -system-jpeg -gif export PATH=$QTDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure -debug -no-opengl -no-xft cp $QTDIR/bin/uic $QTEDIR/bin tmake qvfb.pro > Makefile export PATH=$QTDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure -debug -fast -thread cd tools/linguist/lrelease export PATH=$QTDIR/bin:$PATH export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH ./configure -debug -edition phone -qtopiadesktop -displaysize 176x208 cp *.xml $QPEDIR/image/opt/Qtopia/etc cp $QTEDIR/bin/qvfb $QPEDIR/image/opt/Qtopia/bin cp $QTEDIR/tools/qvfb/*.skin $QPEDIR/image/opt/Qtopia/bin -rf 编译已经完成了,Qtopia Phone 2.1.2中提供了一个启动脚本,但是我们还是重写一个: vi $HOME/shell/startphonedemo-2.1.2.sh source $HOME/shell/qtopia-phone-2.1.2.sh export QTDIR=$HOME/Trolltech/qtopia-phone-2.1.2-debug/image/opt/Qtopia export QPEDIR=$HOME/Trolltech/qtopia-phone-2.1.2-debug/image/opt/Qtopia export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH export PATH=$QPEDIR/bin:$PATH if [ -z "$QTOPIA_PHONE_DEVICE" ]; then
export QTOPIA_PHONE_DEVICE=sim:localhost
echo "lease select a phone demo mode:" echo "
1. Touchscreen Phone" echo "Your choice (default 1): " PHONESKIN=$QPEDIR/bin/SmartPhone.skin PHONESKIN=$QPEDIR/bin/TouchscreenPhone.skin
/bin/ps -e | /bin/sed -n -e '/\<'$1'\>/ s/^ *\([0-9][0-9]*\).*/\1/p'
[ "$pid" != "" ] && kill $pid
[ -x /sbin/fuser ] && ( /sbin/fuser -kn tcp 4242 || /sbin/fuser -kn tcp 4243 ) [ -x /bin/fuser ] && ( /bin/fuser -kn tcp 4242 || /bin/fuser -kn tcp 4243 ) echo "Stopping common sound deamons..." artsd_pid=`findproc artsd` [ "$artsd_pid" != "" ] && kill $artsd_pid [ "$esd_pid" != "" ] && kill $esd_pid echo "Stopping phone simulator..." if [ $QTOPIA_PHONE_DEVICE = "sim:localhost" ]; then
echo "Starting phone simulator..."
phonesim -gui $QPEDIR/etc/troll.xml &
echo "Starting Qtopia Phone 2.1.2..." HOME=$HOME/Trolltech/qtopia-phone-2.1.2-debug/image/opt/Qtopia/demohome qpe if [ $QTOPIA_PHONE_DEVICE = "sim:localhost" ]; then
echo "Stopping phone simulator..."
echo "Restarting killed sound deamons..." [ "$artsd_pid" != "" ] && artsd & [ "$esd_pid" != "" ] && esd & 关于本文,有什么意见或者建议的话,请来信指教,谢谢。 |