<div dir="ltr">Thomas, Andrey,<div><br></div><div>Thanks a lot for having taken the time to write this. This helped *a lot*. This is the sort of info that you just can't guess or work out by just reading the docs or the commit log (at least if you're not already intimately familiar with the platform in question).</div>
<div><br></div><div>So I eventually managed to get fingerterm to build and run both in the emulator and on the device. But it was painful to say the least. </div><div><br></div><div>So in case anyone else wants to do the same and is also new to Nemo / Sailfish, here is what I did, the problems I ran into and how I solved them.</div>
<div><br></div><div>I started off with installing the Sailfish SDK (<a href="https://sailfishos.org/develop.html">https://sailfishos.org/develop.html</a>) and making sure I could build and run the sample HelloWorld app template that comes with it.</div>
<div><br></div><div>I then cloned the fingerterm repo: <a href="https://github.com/nemomobile/fingerterm">https://github.com/nemomobile/fingerterm</a> </div><div><br></div><div>As Thomas and Andrey mentioned, the version in the master branch is the one that currently ships on Jolla. But the version in the Siliica branch also builds and runs, although it's not very usable at the moment. </div>
<div><br></div><div>Opening the <a href="http://fingerterm.pro">fingerterm.pro</a> in Qt Creator worked and Qt Creator prompted me to create build settings for it. I created build settings for both arm and i486 and accepted the suggested defaults.</div>
<div><br></div><div>--- Problem 1 ---</div><div>Building either the arm or i486 version failed with the following error:</div><div><br></div><div><div>Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.NG9kue</div><div>sed: can't read <a href="http://fingerterm.pro">fingerterm.pro</a>: No such file or directory</div>
<div>error: Bad exit status from /var/tmp/rpm-tmp.NG9kue (%build)</div></div><div><br></div><div>I spent more time than I care to admit troubleshooting this issue. I ended up discovering the rpm/fingerterm.spec file, which contained the culprit:</div>
<div><br></div><div><div>sed -i 's,/opt/fingerterm/,/usr/,' <a href="http://fingerterm.pro">fingerterm.pro</a></div></div><div><br></div><div>According to the Sailfish SDK doc (<a href="https://sailfishos.org/develop-packaging-apps.html">https://sailfishos.org/develop-packaging-apps.html</a>), .spec files are normally automatically generated from .yaml files during the build process. But the fingerterm repo doesn't contain any .yaml file. So I'm guessing that this .spec file has been written by hand. </div>
<div><br></div><div>And the line highlighted above assumes that that the <a href="http://fingerterm.pro">fingerterm.pro</a> file is located in the working directory. And it wasn't.</div><div><br></div><div>Some more troubleshooting later revealed that Qt Creator had enabled Shadow Build by default when it created Build settings for the project. Shadow build results in builds being run in a folder separate from the source folder (by default a folder called build-PROJECT_NAME-MerSDK_SailfishOS_ARCHITECTURE-CONFIG located in the project's root folder). </div>
<div><br></div><div>So Shadow build caused the sed command to fail miserably as the fingerterm.spec file seems to assume that the build is being run in the source folder. The fix is easy: go to Projects -> Build & Run in Qt Creator and deselect "Shadow build" for both Build Settings.</div>
<div><br></div><div>--- Problem 2 ---</div><div>Once shadow build had been disabled, I was able to build the arm version fine and run it on my device. But when I tried to build the i486 version, the build failed with:</div>
<div><br></div><div><div>/opt/cross/bin/i486-meego-linux-gnu-ld: terminal.o: Relocations in generic ELF (EM: 40)</div><div>terminal.o: could not read symbols: File in wrong format</div><div>collect2: ld returned 1 exit status</div>
<div>make: *** [fingerterm] Error 1</div><div><br></div><div>error: Bad exit status from /var/tmp/rpm-tmp.2kusms (%build)</div><div> Bad exit status from /var/tmp/rpm-tmp.2kusms (%build)</div></div><div><br></div><div>
If you'd done it the other way around (built the i486 version first and then tried to build the arm version), the error would have been this instead:</div><div><br></div><div><div>/opt/cross/bin/armv7hl-meego-linux-gnueabi-ld: i386 architecture of input file `moc_dbusadaptor.o' is incompatible with arm output</div>
<div>make: *** [fingerterm] Error 1</div><div><br></div><div>error: Bad exit status from /var/tmp/rpm-tmp.Rqvpgd (%build)</div><div> Bad exit status from /var/tmp/rpm-tmp.Rqvpgd (%build)</div></div><div><br></div><div>
In either case, the problem is caused by the fact that since we've disabled Shadow build, both the arm and the i486 builds are run in the same folder. They therefore generate their object files (.o) in the same place. And when the linker comes along, it ends up trying to link object files build with two different architectures together. Which leads to an avalanche of cryptic error messages followed by another miserable failure. </div>
<div><br></div><div>So you need to clean your source folder before switching architectures. I tried to add a "make clean" step to the build settings in Qt Creator to try and clean things up to no avail. I ended up going down the brute-force route and using git to cleanup my working copy (beware before running this command - it might delete files you didn't intend to delete):</div>
<div><br></div><div>git clean -dxf</div><div><br></div><div>Once your source folder is clean, you should be able to build again. There's bound to be a better way.</div><div><br></div><div>--- Problem 3 ---</div><div>Once I was able to build the i486 version, I then ran into an issue trying to run it in the emulator. Fingerterm would always crash on startup with:</div>
<div><br></div><div>[W] unknown:23 - qrc:/qml/Main.qml:23:1: module "com.nokia.meego" is not installed <br></div><div><br></div><div>Thomas actually already answered this question in another thread: <a href="https://lists.sailfishos.org/pipermail/devel/2013-April/000109.html">https://lists.sailfishos.org/pipermail/devel/2013-April/000109.html</a></div>
<div><br></div><div>Here is what needs to be done in more details:</div><div><br></div><div>1) SSH into the emulator as root as documented here: <a href="https://sailfishos.org/develop-faq.html">https://sailfishos.org/develop-faq.html</a> i.e.:</div>
<div>ssh -p 2223 -i ~/SailfishOS/vmshare/ssh/private_keys/SailfishOS_Emulator/root root@localhost<br></div><div><br></div><div>2) Install the qt-components-qt5 package:</div><div><br></div><div>pkcon install qt-components-qt5</div>
<div><br></div><div>or if you want to use zypper, install zypper first:</div><div>pkcon install zypper<br></div><div><br></div><div>Then install the qt-components-qt5 package:</div><div>zypper in qt-components-qt5</div><div>
<br></div><div><div>--- Problem 4 ---</div></div><div>Once I had fixed the com.nokia.meego issue, fingerterm would still crash on startup, this time with:</div><div><br></div><div><div>[W] unknown:21 - qrc:/qml/MenuFingerterm.qml:21:1: module "QtQuick.XmlListModel" is not installed </div>
</div><div><br></div><div>This is part of the qt5-qtdeclarative-import-xmllistmodel package (don't ask me how you're supposed to figure that out - Google knew). So install that in the emulator too just like we did for the qt-components-qt5 package:</div>
<div><br></div><div>pkcon install qt5-qtdeclarative-import-xmllistmodel</div><div><br></div><div>And this time, fingerterm should run. Phew...</div><div><br></div><div>Now, after a day spent getting it to build and run, off to try and customise it...</div>
<div><br></div><div>Cheers,</div><div>Mehdi</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br>
</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 13, 2014 at 8:29 AM, Thomas Perl <span dir="ltr"><<a href="mailto:th.perl@gmail.com" target="_blank">th.perl@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Hi,<div class=""><br>
<br>
<div>On 2014-04-12 22:53, Andrey Kozhevnikov
wrote:<br>
</div>
<blockquote type="cite">
Silica version not finished because of some design and
implementation problems.<br>
Sailfish contains meego components ported to qt5, you may notice
2.0 version (instead of 1.0/1.1 in harmattan), its okay and means
nothing except backward compability.</blockquote>
<br></div>
Yes, as Andrey said, the Silica version isn't finished, and there
are some bugs. The version of Fingerterm that is shipped with
Sailfish OS as the Terminal application in developer mode is built
directly from the master branch sources (the tags correspond to the
RPM package versions, see [1]).<br>
<br>
The Qt Components usage is just historic, and in case of Fingerterm
it mostly provides a rotating window only (the rest of Fingerterm is
done using pure Qt Quick 2.0 components and a custom component for
rendering the terminal itself).<br>
<br>
The "silica" branch replaces Qt Components usage with Sailfish
Silica, uses libsailfishapp for startup boosting, uses theme colors
for some parts (notably the virtual keyboard keys) and uses Silica
pages for the menu.<br>
<br>
Eventually the "silica" branch will be used on Sailfish OS once the
remaining bugs (see issues on Github) have been fixed, and once it
has feature parity with the "old" one, but the master branch / Qt
Components will probably not go away, as Nemo Mobile does not have
Silica. But maybe there will be some special Glacier UI port of
Fingerterm, in which case the Qt Components branch will probably
eventually go unmaintained once the new UI-specific ports have
picked up.<br>
<br>
In that case, we should probably split the terminal emulator parts
into its own library as in [2], which will make the code a bit
cleaner and allow for different experimental terminal emulator apps
to be written (or even terminal emulators to be integrated into
other QML apps). With that said, a very good Terminal Emulator
library for QML exists called yat [3], but yat lacks a custom
virtual keyboard, which can be seen as an advantage (using the
native input method instead) or disadvantage (the fingerterm
keyboard has some keys [Tab, Ctrl, Cursor keys...] that are useful
for terminals, but not so useful everywhere else). Maybe we can just
theme the vkb in fingerterm's "silica" branch so that it looks like
Maliit (the native VKB used on Sailfish OS)? Or maybe Maliit is
extensible enough to still get rid of the custom VKB in fingerterm
but "inject" tab, ctrl, cursor keys, etc.. into the native VKB?<br>
<br>
<br>
HTH :)<br>
Thomas<br>
<br>
[1]
<a href="https://wiki.merproject.org/wiki/Nemo/Development#With_tar_git_service" target="_blank">https://wiki.merproject.org/wiki/Nemo/Development#With_tar_git_service</a><br>
[2] <a href="https://github.com/nemomobile/fingerterm/issues/29" target="_blank">https://github.com/nemomobile/fingerterm/issues/29</a><br>
[3] <a href="https://github.com/jorgen/yat" target="_blank">https://github.com/jorgen/yat</a><br>
</div>
<br>_______________________________________________<br>
SailfishOS.org Devel mailing list<br></blockquote></div><br></div>