Skip to content

Commit

Permalink
[data] Generate app icons add build time. Resolves #152
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaodan committed Dec 8, 2021
1 parent 19fe8bc commit be706c5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
30 changes: 30 additions & 0 deletions data/data.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
TEMPLATE = aux
TARGET = harbour-communi

SIZES = 86 108 128 172

for(size, SIZES) {
icon_src$${size}x$${size}.depends = $$PWD/artwork/$${TARGET}.svg
icon_src$${size}x$${size}.target = \
$$top_builddir/data/icons/$${size}x$${size}/$${TARGET}.png
icon_src$${size}x$${size}.commands = mkdir -p \
$$top_builddir/data/icons/$${size}x$${size};cairosvg -f png \
--output-height $$size \
--output-width $$size \
--output $$top_builddir/data/icons/$${size}x$${size}/$${TARGET}.png \
$$PWD/$${TARGET}.svg
icon_src$${size}x$${size}.files = \
$$top_builddir/data/icons/$${size}x$${size}/$${TARGET}.png
QMAKE_EXTRA_TARGETS += icon_src$${size}x$${size}
PRE_TARGETDEPS += \
$$top_builddir/data/icons/$${size}x$${size}/$${TARGET}.png
}

for(size, SIZES) {
icon$${size}x$${size}.depends = \
$$top_builddir/data/icons/$${size}x$${size}/$${TARGET}.png
icon$${size}x$${size}.files = \
$$top_builddir/data/icons/$${size}x$${size}/$${TARGET}.png
icon$${size}x$${size}.path = /usr/share/icons/hicolor/$${size}x$${size}/apps
INSTALLS += icon$${size}x$${size}
}
2 changes: 1 addition & 1 deletion harbour-communi.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TEMPLATE = subdirs
SUBDIRS += src
SUBDIRS += src data

!no_submodules {
!exists(src/shared/shared.pri)|!exists(src/backend/src/src.pro)): \
Expand Down
3 changes: 2 additions & 1 deletion rpm/harbour-communi.spec
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(sailfishapp) >= 0.0.10
BuildRequires: qt5-qttools-linguist
BuildRequires: python3-cairosvg

%description
A simple and elegant IRC client for Sailfish OS, based on Qt and the Communi IRC framework.
Expand All @@ -41,4 +42,4 @@ make INSTALL_ROOT=$RPM_BUILD_ROOT install
%{_bindir}/%{name}
%{_datadir}/%{name}/*
%attr(644,root,root) %{_datadir}/applications/%{name}.desktop
%attr(644,root,root) %{_datadir}/icons/hicolor/86x86/apps/%{name}.png
%attr(644,root,root) %{_datadir}/icons/hicolor/*/apps/%{name}.png
2 changes: 1 addition & 1 deletion src/app/app.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = harbour-communi
CONFIG += c++11 sailfishapp
CONFIG += c++11 sailfishapp_nodata
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x000000
QT += dbus
VERSION = 1.0-alpha
Expand Down
Binary file removed src/app/harbour-communi.png
Binary file not shown.

0 comments on commit be706c5

Please sign in to comment.