在Linux上进行Symbian开发的实验性包

我们写一个时候你可以做的如何开发Linux。但是这个过程十分复杂,要求有许多自定义的设置。我们现在已经要更进一步,现在我们已经预先装好的环境,完整的编译器,库和所有你需要开始开发工具!

我有责任向报告我们的免责声明:尽管这些包是完全得不到来自诺基亚。他们是由一个“最佳的努力"的基础上的,并不见得就一定能正确地作用在您的系统上!也提到了,包是没有保证的得到更新,并且在未来可能实现相同的功能给不同形式,例如通过Qt的SDK。

此外,现在你不能使用这种方法的发展,因为Qt 4.7.1 N8不是安装的。当N8得到了第一个电话更新无论如何,它将会升级为Qt 4.7.1,那么你应该能够使用它。

现在,随着的方式,让我们赶紧体验其中的乐趣!

自己作为一个Linux用户,指出,这是很自然的开始让所谓的ebuilds描述文件(包装)。报告指出对于那些不熟悉颊带,它没有真正的包裹,只是制作安装包。大多数软件包编译从源这种方式,但这是不严格要求,因为你的食谱也包含引用precompiled二进制文件。我的优势是拥有这样配方为建设,我能只创造包裹包Debian使用相同的配方,从而得到两个包类型几乎一本书的价钱!

换句话说,包装类型,并指出了ebuilds Debian .deb包装。RPM用户应该能够使用.deb。

为Debian用户:

下载并安装以下软件(32位版本只有):

gcce-4.4.172-r1。

s60-sdk-5.0.deb
runonphone-4.7.1.deb
qt-symbian-libs-4.7.1-r1.deb(老版本:qt-symbian-libs-4.7.1.deb)

下载并安装以下软件(32位版本只有):

gcce- -fc13.i686.rpm -4.4.172- 1.
s60- -sdk- 5.0 - 1. -fc13.i686.rpm
runonphone- -fc13.i686.rpm -4.7.1- 1.
qt- -symbian- -libs- -fc13.i686.rpm -4.7.1- 1.

对于RPM(Fedora)用户:下载并且安装下列包(仅提供32位版本):

gcce-4.4.172-1.fc13.i686.rpm

s60-sdk-5.0-1.fc13.i686.rpm

runonphone-4.7.1-1.fc13.i686.rpm

qt-symbian-libs-4.7.1-1.fc13.i686.rpm

对于Gentoo用户:

如果您还没有安装layman,那么请安装它,使用 emerge -av layman

layman -o http://qt.gitorious.org/qt-labs/ ... er/repositories.xml -L (首先我们需要列出安装仓库让layman知道哪些是可用的)

layman -o http://qt.gitorious.org/qt-labs/ ... er/repositories.xml -A qt-symbian-overlay

为了说明您要接受哪种协议,请把 ACCEPT_LICENSE="nokia-eula sourcery-g++" 添加到 /etc/make.conf

emerge -av qt-symbian-libs

对于所有用户:

在安装完之后,请重新打开您的控制台或者(重新启动)来包含由这些包所导致的环境变化。

还有一些软件是手机本身所需要的,很不走运,没有任何方法来自动化这一过程。您需要检查的第一件事情是您是否有App TRK;一些手机已经内置了,但绝大多数手机没有。通过如下方式可以很简单地检查:

通过USB数据线连接手机。

如果出现了带有“Debug Services are available”的文字,那么App TRK已经内置在您的手机中了。

如果不是上述情况,那么请根据Qt文档:App TRK的指示安装它。

另外,还有一些库需要安装。

您可以进入“Application Manager”(程序管理器)查看您的手机是否包含所需的软件。对于大多数手机来说它在主菜单的“Settings”(设置)或者主菜单的“Applications”(应用程序)中。

请查找“PIPS Installer”和“Standard C++ library Common”。如果它们都至少是1.06版本的,那么就不用再安装了。

否则,您需要从这里下载并且安装它们:http://pepper.troll.no/s60prereleases/OpenC-1.7-sis-files.zip。您可以使用刚刚安装的runonphone工具通过 runonphone -s 来安装它们。

最后,我们需要把Qt自己安装到手机上,您可以通过如下命令来做到:

runonphone -s /usr/share/qt4/qt-symbian/lib/Qt.sis

runonphone -s /usr/share/qt4/qt-symbian/lib/QtWebKit.sis

当然您的应用程序的用户不需要做这些。为了使针对用户的发布更容易,请参考Symbian发布指导,特别是Smart Installer那一部分。

就是这些!您现在已经准备好进行开发了!当使用这些包进行Symbian开发的时候,唯一要注意的问题是,您必须使用qmake-symbian,而不是qmake。通过使用它,您应该可以通过如下命令试试您的第一个Hello World应用程序:

cd

qmake-symbian

make runonphone

一些已知问题:

有时在运行rcomp工具的时候,Wine会报错,“Failed to write UIDs”。这应该是安装程序在安装的时候考虑的,很不走运的是目前除了手动修改没有其它可以适合每一个用户的永久方案。解决办法很简单,就是运行这条命令:cp /usr/s60-sdk/epoc32/tools/uidcrc.exe `find ~/.wine/ -ipath '*windows/system32'`

让gcce的ebuild正常工作还是有点麻烦。有的时候它会无原因的停在那里;如果发生这种情况,请您重试一下,也许第二次它就会正常工作,但是如果它不工作,您也别太惊奇。如果您很不幸遇到了这种情况,请您通过运行sh /usr/portage/distfiles/symbian-adt-4.4-172-arm-none-symbianelf.bin手动安装它。然后您可以把sys-devel/gcce-4.4.172添加到/etc/portage/profile/package.provided来欺骗Portage您已经安装了。

除了上述之外,runonphone会在您插入手机之后自动检测USB端口的时候失败。如果出现这种情况,请阅读Qt文档中关于如何配置USB串口驱动的一节。在运行runonphone的时候,您也许可以通过为-p指定如/dev/ttyUSB1或者/dev/ttyACM1的参数来解决这一问题,详细描述在这里。

A while back we wrote about how you could do development for Symbian in Linux. However, the process was complicated and required a lot of manual setup. We have now taken the concept one step further and we now have prepackaged environments, complete with compiler, libraries and all you need to start developing!

I’m obligated to report our disclaimer though: These packages are completely unsupported by Nokia. They are provided on a “best effort” basis only, and are not guaranteed to work correctly on your system! Also note that the packages are not guaranteed to receive updates, and in the future the same functionality may be delivered in a different format, for example through the Qt SDK.

In addition, currently you cannot use this approach to develop for the N8, because Qt 4.7.1 is not installable there. When N8 receives its first phone update however, it will be upgraded to Qt 4.7.1, and then you should be able to deploy on it.

Now, with that out of the way, let’s dive into the fun!

Being a Gentoo Linux user myself, it was natural to start by making so-called ebuilds (the package descriptions files for Gentoo). For those not familiar with Gentoo, it doesn’t have real packages, but just recipes for how to install packages. Most packages compile from source this way, but this is not strictly required, since your recipe can also contain references to precompiled binaries. The advantage for me was that by having this recipe for building the packages, I could just create Debian packages using the same recipe, and hence get two package types almost for the price of one!

So in other words, the package types provided are Gentoo ebuilds, and Debian .deb packages. RPM users should be able to use the .deb packages by using alien.

Update: A fellow troll was kind enough to provide RPM packages based on Fedora, so RPM users don’t have to use alien anymore!

For Debian (and Ubuntu) users:

Download and install the following packages (32-bit versions only):

gcce-4.4.172-r1.deb
s60-sdk-5.0.deb
runonphone-4.7.1.deb
qt-symbian-libs-4.7.1-r1.deb (Old version: qt-symbian-libs-4.7.1.deb)
For RPM (Fedora) users:

Download and install the following packages (32-bit versions only):

gcce-4.4.172-1.fc13.i686.rpm
s60-sdk-5.0-1.fc13.i686.rpm
runonphone-4.7.1-1.fc13.i686.rpm
qt-symbian-libs-4.7.1-1.fc13.i686.rpm
For Gentoo users:

Install layman if you haven’t already, using emerge -av layman
layman -o http://qt.gitorious.org/qt-labs/symbian-overlay/blobs/raw/master/repositories.xml -L (It’s necessary to list the repositories first to update layman’s idea of what is available)
layman -o http://qt.gitorious.org/qt-labs/symbian-overlay/blobs/raw/master/repositories.xml -A qt-symbian-overlay
To indicate your acceptance of the licenses, add ACCEPT_LICENSE="nokia-eula sourcery-g++" to your /etc/make.conf
emerge -av qt-symbian-libs
For all users:

After installing, please reopen your shell (or reboot) to include the environment changes made by the packages.

Some software is still required on the phone itself and unfortunately, there is no way to automate this. The first thing you need to check is if you have App TRK; some phones have it built in, but most phones don’t. It’s easy to check:

Plug it into your computer using the USB cable.
If it says something along the lines of “Debug Services are available”, then App TRK is built in on your phone.
If this is not the case, please use the instructions from the Qt Documentation for App TRK to get it installed.
In addition, some libraries also need to be preinstalled.

You can check if your phone has the required software by entering the Application Manager. On most phones this is available from either Settings in the main manu, or from within Applications on the main menu.
Look for “PIPS Installer” and “Standard C++ library Common”. If they are both at least version 1.06, then you are fine.
Otherwise you need to install the libraries from here: http://pepper.troll.no/s60prereleases/OpenC-1.7-sis-files.zip.You can use the newly installed runonphone tool to install them by doing runonphone -s .
Finally, Qt itself needs to be installed on the phone, which you can do with the commands:
runonphone -s /usr/share/qt4/qt-symbian/lib/Qt.sis
runonphone -s /usr/share/qt4/qt-symbian/lib/QtWebKit.sis
Of course the users of your application shouldn’t have to do this. To make deployment easy for users, see the Deployment guide for Symbian, particularly the part about Smart Installer.

And that’s it! You are now ready to start developing! The only notable difference when developing for Symbian using this package, is that you must use qmake-symbian rather than just qmake. Using that, you should be able to try your first hello world application with the following commands:

cd
qmake-symbian
make runonphone
Some known issues:

Wine sometimes fails with “Failed to write UIDs” when running the rcomp tool. This is something the installer takes into account when installing, but unfortunately there is no way to fix it permanently for every user without manual intervention. The fix is simple, just execute this on the command line: cp /usr/s60-sdk/epoc32/tools/uidcrc.exe `find ~/.wine/ -ipath '*windows/system32'`
The gcce ebuild has turned out to be tricky to get right. Sometimes it hangs for no reason; if this happens you can retry it and it may work the second time, but don’t be surprised if it doesn’t work. If this is the case for you, you can install it manually by executing sh /usr/portage/distfiles/symbian-adt-4.4-172-arm-none-symbianelf.bin. Then you can fool Portage into believing you have installed by adding sys-devel/gcce-4.4.172 to /etc/portage/profile/package.provided.
More often than not, runonphone fails to autodetect the USB port for your phone when it’s plugged in. If this happens for you, read the section about configuring the USB serial driver in the Qt Documentation. You may also have to specify the -p parameter with /dev/ttyUSB1 or /dev/ttyACM1 to runonphone, as described here.
Good luck!

侯业伟

houyewei@gmail.com

For more complete information about compiler optimizations, see our Optimization Notice.