We have moved to a new Sailfish OS Forum. Please start new discussions there.
2

How to add app icons to RPM?

asked 2016-06-09 10:01:18 +0300

mobilitio gravatar image

It is now possible to add a number of app icons to the RPM package. I suppose that it's since Saimaa SailfishOS 2.0.0?

The SDK Harbour tools RPM validator is giving warnings, like described for example in : https://together.jolla.com/question/120058/error-in-rpm-validation/

However, it looks like the complete procedure instruction is missing... I spent several hours digging up (searching) that scattered information and doing trial and error.

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
6

answered 2016-06-09 10:38:21 +0300

mobilitio gravatar image

updated 2016-06-09 11:00:36 +0300

The icons can be added to RPM as follows (I hope I got it right:)

Get informedabout design guidelines for app launcher icons for SalifishOS: https://sailfishos.org/wp-content/uploads/bsk-pdf-manager/48_SAILFISH-APPS-ICON-STORY.PDF

Get templatesfrom https://sailfishos.org/wp-content/uploads/2015/01/Sailfish-Apps-icon-template.zip

Create your app launcher icon in a SVG drawing progam such as Inkscape. The icon must be square (i.e. equal height and width).

Export your icons in PNG format in pixel sizes 86x86, 108x108, 128x128 and 256x256. Name them as {myapp}.png (e.g. harbour-myapp.png) and put them to in your development host to the folders by sizes. Remove execute permission of the image file (chmod -x *.png) to save you from a validation round. For an imaginary harbour-myapp the icons folder structure would look be then:

harbour-myapp/icons/86x86/harbour-myapp.png
harbour-myapp/icons/108x108/harbour-myapp.png
harbour-myapp/icons/128x128/harbour-myapp.png 
harbour-myapp/icons/256x256/harbour-myapp.png

Add the following lines the end of harbour-myapp/harbour-myapp.pro:

SAILFISHAPP_ICONS += 86x86 108x108 128x128 256x256

DISTFILES += icons/86x86/harbour-myapp.png \
icons/108x108/harbour-myapp.png \
icons/128x128/harbour-myapp.png \
icons/256x256/harbour-myapp.png

Add different sizes to the harbour-myapp.yaml file, in the end of All installed files section, so that it looks like

   # All installed files
    Files:
      - '%{_bindir}'
      - '%{_datadir}/%{name}'
      - '%{_datadir}/applications/%{name}.desktop'
      - '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png'
      - '%{_datadir}/icons/hicolor/108x108/apps/%{name}.png'
      - '%{_datadir}/icons/hicolor/128x128/apps/%{name}.png'
      - '%{_datadir}/icons/hicolor/256x256/apps/%{name}.png'

Update harbour-myapp.spec file so that in files section:

%files
%defattr(-,root,root,-)
%{_bindir}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/86x86/apps/%{name}.png
%{_datadir}/icons/hicolor/108x108/apps/%{name}.png
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png

References:

Someone Knowledgeable, please comment, if this makes sense. It's just my reverse engineering...

I would like more culture of "grandma guides" - which enable the "Grandma living in a cottage to do the job"? (A.k.a. "Mummo-ohjeet, joiden avulla mökin mummokin osaa") ;-D https://www.urbaanisanakirja.com/word/mummo-ohje/

edit flag offensive delete publish link more

Comments

It does not work in my case :(
EDIT: Sorry, just deployed the app on the emulator. It works on the phone.
Thank you!

ploth ( 2016-09-09 01:23:38 +0300 )edit

Thank you! For me it was the .spec file update that needed to be done manually.

Direc ( 2018-06-28 01:25:35 +0300 )edit
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2016-06-09 10:01:18 +0300

Seen: 847 times

Last updated: Jun 09 '16