[slic3r] Instead of single ico file, ship multiple pngs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 52dcceb2608817ff9c664810551559f0e0e33d4f
Author: Miro Hrončok <miro@xxxxxxxxxx>
Date:   Wed Mar 19 17:49:12 2014 +0100

    Instead of single ico file, ship multiple pngs

 slic3r.desktop |    2 +-
 slic3r.spec    |   40 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 37 insertions(+), 5 deletions(-)
---
diff --git a/slic3r.desktop b/slic3r.desktop
index 5bafc06..b2644fe 100644
--- a/slic3r.desktop
+++ b/slic3r.desktop
@@ -1,7 +1,7 @@
 [Desktop Entry]
 Name=Slic3r
 Exec=slic3r
-Icon=/usr/share/pixmaps/slic3r.ico
+Icon=slic3r
 Terminal=false
 Type=Application
 Categories=Graphics;3DGraphics;
diff --git a/slic3r.spec b/slic3r.spec
index f6c4c7b..884941c 100644
--- a/slic3r.spec
+++ b/slic3r.spec
@@ -2,7 +2,7 @@ Name:           slic3r
 Version:        1.0.0
 %global rcrc    RC3
 %global verrc   %{version}%{rcrc}
-Release:        0.4.%{rcrc}%{?dist}
+Release:        0.5.%{rcrc}%{?dist}
 Summary:        G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)
 License:        AGPLv3 and CC-BY
 # Images are CC-BY, code is AGPLv3
@@ -70,6 +70,7 @@ BuildRequires:  polyclipping-devel
 %endif
 
 BuildRequires:  desktop-file-utils
+BuildRequires:  ImageMagick
 Requires:       perl(Class::XSAccessor)
 Requires:       perl(Growl::GNTP)
 
@@ -108,6 +109,20 @@ perl ./Build.PL installdirs=vendor optimize="$RPM_OPT_FLAGS"
 cd -
 # Building non XS part only runs test, so skip it and run it in tests
 
+# prepare pngs in mutliple sizes
+for res in 16 32 48 128 256; do
+  mkdir -p hicolor/${res}x${res}/apps
+done
+cd hicolor
+convert ../var/Slic3r.ico %{name}.png
+cp %{name}-0.png 256x256/apps/%{name}.png
+cp %{name}-1.png 128x128/apps/%{name}.png
+cp %{name}-2.png 48x48/apps/%{name}.png
+cp %{name}-3.png 32x32/apps/%{name}.png
+cp %{name}-4.png 16x16/apps/%{name}.png
+rm %{name}-*.png
+cd -
+
 %install
 cd xs
 ./Build install destdir=%{buildroot} create_packlist=0
@@ -119,14 +134,14 @@ find %{buildroot} -type f -name '*.bs' -size 0 -exec rm -f {} \;
 mkdir -p %{buildroot}%{_bindir}
 mkdir -p %{buildroot}%{perl_vendorlib}
 mkdir -p %{buildroot}%{_datadir}/%{name}
-mkdir -p %{buildroot}%{_datadir}/pixmaps
+mkdir -p %{buildroot}%{_datadir}/icons
 mkdir -p %{buildroot}%{_datadir}/appdata
 
 cp -a %{name}.pl %{buildroot}%{_bindir}/%{name}
 cp -ar lib/* %{buildroot}%{perl_vendorlib}
 
 cp -a var/* %{buildroot}%{_datadir}/%{name}
-ln -s ../%{name}/Slic3r.ico %{buildroot}%{_datadir}/pixmaps/%{name}.ico
+cp -r hicolor %{buildroot}%{_datadir}/icons
 desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
 
 cp %{SOURCE2} %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml
@@ -140,13 +155,27 @@ cd -
 SLIC3R_NO_AUTO=1 perl Build.PL installdirs=vendor
 # the --gui runs no tests, it only checks requires
 
+%post
+/sbin/ldconfig
+/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
+
+%postun
+/sbin/ldconfig
+if [ $1 -eq 0 ] ; then
+    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
+    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+fi
+
+%posttrans
+/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
+
 %files
 %doc README.md
 %{_bindir}/%{name}
 %{perl_vendorlib}/Slic3r*
 %{perl_vendorarch}/Slic3r*
 %{perl_vendorarch}/auto/Slic3r*
-%{_datadir}/pixmaps/%{name}.ico
+%{_datadir}/icons/hicolor/*/apps/%{name}.png
 %{_datadir}/applications/%{name}.desktop
 %if 0%{?fedora} < 21
 %dir %{_datadir}/appdata
@@ -155,6 +184,9 @@ SLIC3R_NO_AUTO=1 perl Build.PL installdirs=vendor
 %{_datadir}/%{name}
 
 %changelog
+* Wed Mar 19 2014 Miro Hrončok <mhroncok@xxxxxxxxxx> - 1.0.0-0.5.RC3
+- Instead of single ico file, ship multiple pngs
+
 * Wed Mar 05 2014 Miro Hrončok <mhroncok@xxxxxxxxxx> - 1.0.0-0.4.RC3
 - New RC version
 - Include appdata file
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel





[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux