Skip to content

Commit

Permalink
Add packaging for Sailfish
Browse files Browse the repository at this point in the history
Signed-off-by: Tomi Leppänen <[email protected]>
  • Loading branch information
Tomin1 committed Sep 16, 2024
1 parent 7e8ea65 commit 54b0d75
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 56 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pro.user
20 changes: 11 additions & 9 deletions harbour-trites.desktop
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=trites
Exec=/opt/trites/bin/trites
Icon=trites64
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
Name=Trites
Exec=sailfish-qml harbour-trites
Icon=harbour-trites
X-Nemo-Application-Type=silica-qt5

X-Desktop-File-Install-Version=0.26

[X-Sailjail]
OrganizationName=site.tomin.apps
ApplicationName=Trites
Permissions=
39 changes: 39 additions & 0 deletions rpm/harbour-trites.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Name: harbour-trites
Summary: Trites
Version: 0.1.0
Release: 1
License: GPLv3+
BuildArch: noarch
URL: http://example.org/
Source0: %{name}-%{version}.tar.bz2
Requires: sailfishsilica-qt5 >= 0.10.9
Requires: libsailfishapp-launcher
BuildRequires: pkgconfig(sailfishapp) >= 1.0.3
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: desktop-file-utils
BuildRequires: librsvg-tools
BuildRequires: qt5-qttools-linguist

%description
%{summary}.

%prep
%autosetup -n %{name}-%{version}

%build
%qmake5

%make_build

%install
%qmake5_install

desktop-file-install --delete-original --dir %{buildroot}%{_datadir}/applications %{buildroot}%{_datadir}/applications/%{name}.desktop

%files
%defattr(-,root,root,-)
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
110 changes: 63 additions & 47 deletions trites.pro
Original file line number Diff line number Diff line change
@@ -1,47 +1,63 @@
# Add more folders to ship with the application, here
folder_01.source = qml/trites
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01

# Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =

symbian:TARGET.UID3 = 0xE0B76A13

# Smart Installer package's UID
# This UID is from the protected range and therefore the package will
# fail to install if self-signed. By default qmake uses the unprotected
# range value if unprotected UID is defined for the application and
# 0x2002CCCF value if protected UID is given to the application
#symbian:DEPLOYMENT.installer_header = 0x2002CCCF

# Allow network access on Symbian
symbian:TARGET.CAPABILITY += NetworkServices

# If your application uses the Qt Mobility libraries, uncomment the following
# lines and add the respective components to the MOBILITY variable.
# CONFIG += mobility
# MOBILITY +=

# Speed up launching on MeeGo/Harmattan when using applauncherd daemon
CONFIG += qdeclarative-boostable

# Add dependency to Symbian components
# CONFIG += qt-components

# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp

# Please do not modify the following two lines. Required for deployment.
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()

OTHER_FILES += \
qtc_packaging/debian_harmattan/rules \
qtc_packaging/debian_harmattan/README \
qtc_packaging/debian_harmattan/manifest.aegis \
qtc_packaging/debian_harmattan/copyright \
qtc_packaging/debian_harmattan/control \
qtc_packaging/debian_harmattan/compat \
qtc_packaging/debian_harmattan/changelog

TARGET = harbour-trites

CONFIG += sailfishapp_qml

DISTFILES += qml/harbour-trites.qml \
qml/BasePiece.qml \
qml/Block.qml \
qml/game.js \
qml/MenuButton.qml \
qml/PieceI.qml \
qml/PieceJ.qml \
qml/PieceL.qml \
qml/PieceO.qml \
qml/PieceS.qml \
qml/PieceT.qml \
qml/PieceZ.qml \
qml/data/author.svg \
qml/data/block_blue.png \
qml/data/block_green.png \
qml/data/block_purple.png \
qml/data/block_yellow.png \
qml/data/menubutton_pressed.svg \
qml/data/pausebutton_pressed.svg \
qml/data/background.png \
qml/data/block_cyan.png \
qml/data/block_orange.png \
qml/data/block_red.png \
qml/data/logo.svg \
qml/data/menubutton_unpressed.svg \
qml/data/pausebutton_unpressed.svg \
COPYING \
rpm/harbour-trites.spec \
harbour-trites.desktop \
harbour-trites.svg \
README.md

ICON_SIZES = 86 108 128 172
ICON_SOURCE = $$PWD/harbour-trites.svg
for (size, ICON_SIZES) {
icon_dir = $$shadowed(icons/$${size}x$${size})
icon_path = $${icon_dir}/$${TARGET}.png

icon_$${size}.commands = mkdir -p $$icon_dir $$escape_expand(\n\t)
icon_$${size}.commands += rsvg-convert --width=$${size} --height=$${size} \
--output $$icon_path $$ICON_SOURCE $$escape_expand(\n\t)
icon_$${size}.depends = $$ICON_SOURCE
icon_$${size}.output = $$icon_path
icon_$${size}.target = $$icon_path

icon_$${size}_install.CONFIG = no_check_exist
icon_$${size}_install.depends = $$icon_path
icon_$${size}_install.files = $$icon_path
icon_$${size}_install.path = /usr/share/icons/hicolor/$${size}x$${size}/apps

QMAKE_EXTRA_TARGETS += icon_$${size}
PRE_TARGETDEPS += $$icon_path
QMAKE_CLEAN += $$icon_path
INSTALLS += icon_$${size}_install
}

static_files.files = COPYING README.md $$ICON_SOURCE
static_files.path = /usr/share/$${TARGET}
INSTALLS += static_files

0 comments on commit 54b0d75

Please sign in to comment.