From 54b0d7511bc1d398ca1a0dee5fad0738eeb35bd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Lepp=C3=A4nen?= Date: Sun, 15 Sep 2024 22:51:38 +0300 Subject: [PATCH] Add packaging for Sailfish MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tomi Leppänen --- .gitignore | 1 + harbour-trites.desktop | 20 ++++---- rpm/harbour-trites.spec | 39 ++++++++++++++ trites.pro | 110 +++++++++++++++++++++++----------------- 4 files changed, 114 insertions(+), 56 deletions(-) create mode 100644 .gitignore create mode 100644 rpm/harbour-trites.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..75c107b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pro.user diff --git a/harbour-trites.desktop b/harbour-trites.desktop index c955746..7893710 100644 --- a/harbour-trites.desktop +++ b/harbour-trites.desktop @@ -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= diff --git a/rpm/harbour-trites.spec b/rpm/harbour-trites.spec new file mode 100644 index 0000000..073048c --- /dev/null +++ b/rpm/harbour-trites.spec @@ -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 diff --git a/trites.pro b/trites.pro index f5eb87e..91fcccc 100644 --- a/trites.pro +++ b/trites.pro @@ -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 \ No newline at end of file