[SailfishDevel] installing extra files via rpm

Artem Marchenko artem.marchenko at gmail.com
Fri Nov 22 12:03:27 UTC 2013


How I used to do it in the past building for both Symbian and MeeGo was to
have .pro file hierarchy as you anyway need to have some .pro file
specifics. I know several ways you can go

**.pro level**
1. Just different .pro for the different platforms and that's it
They even might include different .cpp and .qml files though if platform
differences are minor you can use compiler macros on .cpp level keep
different qmls in the different folders (who cares if extra unused qmls are
packaged in).

2. Different top level .pro files including the common part via .pri
*That's the approach I would go for nowadays*

3. Common .pro file including appropriate platform specific part via QMake
macros
Just have a look at the old harmattan's wizard generated .pri files (I
think first Sailfish SDK used similar approach)

**.cpp level**
Preprocessor  macros such as mentioned __ARMEL__ are your friend

**.qml level**
Here is gets tricky as QML doesn't have conditional imports. If I remember
correctly, idea was killed by one of the sailors (J ;)) at times he was
working for Nokia, because "you have Loader, use it for loading
conditionally". So the options I see are

1. Forget about reuse, QML is so easy to work with that you can create new
UI from scratch for every platform. You will anyway want it as UI is
exactly the most platform-specific part of app.
Then you just include different folders on the .pro and .cpp levels
That I believe is the official Qt point of view or close to it. Too bad
it's not very comfortable for my preferred approach that is to put 95% of
everything to QML.

2. Use common QML components (utilizing only common imports, non-UI
components could be good) and inherit then with platform specifics
I used it and it happened to be rather clumsy as all the structures happen
to be quite inter-dependent and there were annoying situations when the
import is the same, but on some platform you have just different property
for the icon path (maybe it doesn't happen in the past-harmattan times).

3. Use common QML components and include them into platform-specific
screens or pages.
This way you still recreate pages per platform but you can use large
reusable blocks inside. *That's the approach I will probably go nowadays*

4. Bonus: have some UI constants class somewhere
I tend to create CommonSettings.qml and inherit SymbianSettings.qml,
SailfishSettings.qml, etc from it. Makes managing UI constants easier.

Well, that was my experience so far.
I hope it helps

Cheers,
Artem.



On Fri, Nov 22, 2013 at 1:09 PM, Luciano Montanaro <mikelima at gmail.com>wrote:

> On Thu, Nov 21, 2013 at 5:10 PM, Andrey Kozhevnikov
> <coderusinbox at gmail.com> wrote:
> > check __ARMEL__ or __ARM_ARCH_7__
>
>
> Thank you, Andrey, but that is not what I was referring to.
>
> Basically, I would like to have my package built for sailfish (and
> install the sailfish qml files) when I select a sailfish target, and
> say, the harmattan files when I start it from the nokia sdk. The
> architecture is not enough... I need either to check for a specific
> library being present, or something similar.
>
> Regards,
> Luciano
>
> --
> Luciano Montanaro
>
> Anyone who is capable of getting themselves made President should on
> no account be allowed to do the job. -- Douglas Adams
> _______________________________________________
> SailfishOS.org Devel mailing list
>



-- 
Artem Marchenko
http://agilesoftwaredevelopment.com
http://twitter.com/AgileArtem
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.sailfishos.org/pipermail/devel/attachments/20131122/950ab123/attachment.html>


More information about the Devel mailing list