Thomas, Andrey,

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).

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.

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.

I started off with installing the Sailfish SDK (
https://sailfishos.org/develop.html) and making sure I could build and run
the sample HelloWorld app template that comes with it.

I then cloned the fingerterm repo: https://github.com/nemomobile/fingerterm

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.

Opening the fingerterm.pro 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.

--- Problem 1 ---
Building either the arm or i486 version failed with the following error:

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.NG9kue
sed: can't read fingerterm.pro: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.NG9kue (%build)

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:

sed -i 's,/opt/fingerterm/,/usr/,' fingerterm.pro

According to the Sailfish SDK doc (
https://sailfishos.org/develop-packaging-apps.html), .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.

And the line highlighted above assumes that that the fingerterm.pro file is
located in the working directory. And it wasn't.

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).

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.

--- Problem 2 ---
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:

/opt/cross/bin/i486-meego-linux-gnu-ld: terminal.o: Relocations in generic
ELF (EM: 40)
terminal.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [fingerterm] Error 1

error: Bad exit status from /var/tmp/rpm-tmp.2kusms (%build)
    Bad exit status from /var/tmp/rpm-tmp.2kusms (%build)

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:

/opt/cross/bin/armv7hl-meego-linux-gnueabi-ld: i386 architecture of input
file `moc_dbusadaptor.o' is incompatible with arm output
make: *** [fingerterm] Error 1

error: Bad exit status from /var/tmp/rpm-tmp.Rqvpgd (%build)
    Bad exit status from /var/tmp/rpm-tmp.Rqvpgd (%build)

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.

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):

git clean -dxf

Once your source folder is clean, you should be able to build again.
There's bound to be a better way.

--- Problem 3 ---
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:

[W] unknown:23 - qrc:/qml/Main.qml:23:1: module "com.nokia.meego" is not
installed

Thomas actually already answered this question in another thread:
https://lists.sailfishos.org/pipermail/devel/2013-April/000109.html

Here is what needs to be done in more details:

1) SSH into the emulator as root as documented here:
https://sailfishos.org/develop-faq.html i.e.:
ssh -p 2223 -i
~/SailfishOS/vmshare/ssh/private_keys/SailfishOS_Emulator/root
root@localhost

2) Install the qt-components-qt5 package:

pkcon install qt-components-qt5

or if you want to use zypper, install zypper first:
pkcon install zypper

Then install the qt-components-qt5 package:
zypper in qt-components-qt5

--- Problem 4 ---
Once I had fixed the com.nokia.meego issue, fingerterm would still crash on
startup, this time with:

[W] unknown:21 - qrc:/qml/MenuFingerterm.qml:21:1: module
"QtQuick.XmlListModel" is not installed

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:

pkcon install qt5-qtdeclarative-import-xmllistmodel

And this time, fingerterm should run. Phew...

Now, after a day spent getting it to build and run, off to try and
customise it...

Cheers,
Mehdi
















On Sun, Apr 13, 2014 at 8:29 AM, Thomas Perl <th.p...@gmail.com> wrote:

>  Hi,
>
>
> On 2014-04-12 22:53, Andrey Kozhevnikov wrote:
>
> Silica version not finished because of some design and implementation
> problems.
> 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.
>
>
> 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]).
>
> 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).
>
> 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.
>
> 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.
>
> 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?
>
>
> HTH :)
> Thomas
>
> [1] https://wiki.merproject.org/wiki/Nemo/Development#With_tar_git_service
> [2] https://github.com/nemomobile/fingerterm/issues/29
> [3] https://github.com/jorgen/yat
>
> _______________________________________________
> SailfishOS.org Devel mailing list
>
_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to