diff --git a/CHANGELOG.md b/CHANGELOG.md index 52496032d8..3bd7f77d74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ All notable changes to this project will be documented in this file. - [ConsoleUI] Conflicting recommendations check for ConsoleUI (#4085 by: HebaruSan) - [Build] Linux: Improve desktop entries (#4092 by: mmvanheusden; reviewed: HebaruSan) - [ConsoleUI] Install from .ckan file option for ConsoleUI (#4103 by: HebaruSan) +- [Build] Support icons from libraries for deb and rpm (#4104 by: HebaruSan) ### Bugfixes diff --git a/ConsoleUI/AuthTokenAddDialog.cs b/ConsoleUI/AuthTokenAddDialog.cs index c362565d86..5f363ac810 100644 --- a/ConsoleUI/AuthTokenAddDialog.cs +++ b/ConsoleUI/AuthTokenAddDialog.cs @@ -1,5 +1,7 @@ using System; + using Autofac; + using CKAN.ConsoleUI.Toolkit; using CKAN.Configuration; diff --git a/ConsoleUI/AuthTokenListScreen.cs b/ConsoleUI/AuthTokenListScreen.cs index e7d20803ed..e6304e77fa 100644 --- a/ConsoleUI/AuthTokenListScreen.cs +++ b/ConsoleUI/AuthTokenListScreen.cs @@ -1,8 +1,10 @@ using System; using System.ComponentModel; using System.Collections.Generic; -using CKAN.ConsoleUI.Toolkit; + using Autofac; + +using CKAN.ConsoleUI.Toolkit; using CKAN.Configuration; namespace CKAN.ConsoleUI { diff --git a/ConsoleUI/DownloadImportDialog.cs b/ConsoleUI/DownloadImportDialog.cs index d3f219340a..2e8cb9e0c4 100644 --- a/ConsoleUI/DownloadImportDialog.cs +++ b/ConsoleUI/DownloadImportDialog.cs @@ -1,6 +1,7 @@ using System; using System.IO; using System.Collections.Generic; + using CKAN.ConsoleUI.Toolkit; namespace CKAN.ConsoleUI { diff --git a/ConsoleUI/ExitScreen.cs b/ConsoleUI/ExitScreen.cs index 7a2b7dc5b5..a78bd220f1 100644 --- a/ConsoleUI/ExitScreen.cs +++ b/ConsoleUI/ExitScreen.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Collections.Generic; + using CKAN.ConsoleUI.Toolkit; namespace CKAN.ConsoleUI { diff --git a/ConsoleUI/GameInstanceAddScreen.cs b/ConsoleUI/GameInstanceAddScreen.cs index 59e7f51ba6..3d2764f480 100644 --- a/ConsoleUI/GameInstanceAddScreen.cs +++ b/ConsoleUI/GameInstanceAddScreen.cs @@ -1,5 +1,6 @@ using System; using System.IO; + using CKAN.ConsoleUI.Toolkit; namespace CKAN.ConsoleUI { diff --git a/ConsoleUI/GameInstanceEditScreen.cs b/ConsoleUI/GameInstanceEditScreen.cs index ef268d020d..b229e2ea7d 100644 --- a/ConsoleUI/GameInstanceEditScreen.cs +++ b/ConsoleUI/GameInstanceEditScreen.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel; + using CKAN.Versioning; using CKAN.ConsoleUI.Toolkit; diff --git a/ConsoleUI/GameInstanceScreen.cs b/ConsoleUI/GameInstanceScreen.cs index 4122ef4152..efd81ae92a 100644 --- a/ConsoleUI/GameInstanceScreen.cs +++ b/ConsoleUI/GameInstanceScreen.cs @@ -1,5 +1,6 @@ using System; using System.IO; + using CKAN.ConsoleUI.Toolkit; namespace CKAN.ConsoleUI { diff --git a/ConsoleUI/InstallFilterAddDialog.cs b/ConsoleUI/InstallFilterAddDialog.cs index de2ea97265..bd7f450ac8 100644 --- a/ConsoleUI/InstallFilterAddDialog.cs +++ b/ConsoleUI/InstallFilterAddDialog.cs @@ -1,4 +1,5 @@ using System; + using CKAN.ConsoleUI.Toolkit; namespace CKAN.ConsoleUI { diff --git a/ConsoleUI/InstallFromCkanDialog.cs b/ConsoleUI/InstallFromCkanDialog.cs index 748db6e299..ea69db840d 100644 --- a/ConsoleUI/InstallFromCkanDialog.cs +++ b/ConsoleUI/InstallFromCkanDialog.cs @@ -1,8 +1,8 @@ using System; using System.IO; +using System.Linq; using CKAN.ConsoleUI.Toolkit; -using System.Linq; namespace CKAN.ConsoleUI { diff --git a/ConsoleUI/ModListHelpDialog.cs b/ConsoleUI/ModListHelpDialog.cs index 747c0562af..eb9d4b0a49 100644 --- a/ConsoleUI/ModListHelpDialog.cs +++ b/ConsoleUI/ModListHelpDialog.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using System.Text; + using CKAN.ConsoleUI.Toolkit; namespace CKAN.ConsoleUI { diff --git a/ConsoleUI/ProgressScreen.cs b/ConsoleUI/ProgressScreen.cs index b4bf38b69a..f684f03f4c 100644 --- a/ConsoleUI/ProgressScreen.cs +++ b/ConsoleUI/ProgressScreen.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; + using CKAN.ConsoleUI.Toolkit; namespace CKAN.ConsoleUI { diff --git a/ConsoleUI/RepoAddScreen.cs b/ConsoleUI/RepoAddScreen.cs index 99e972a45c..90e79c5c14 100644 --- a/ConsoleUI/RepoAddScreen.cs +++ b/ConsoleUI/RepoAddScreen.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; + using CKAN.Games; namespace CKAN.ConsoleUI { diff --git a/ConsoleUI/RepoScreen.cs b/ConsoleUI/RepoScreen.cs index d3c02b4f96..601dbb7bd3 100644 --- a/ConsoleUI/RepoScreen.cs +++ b/ConsoleUI/RepoScreen.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; + using CKAN.ConsoleUI.Toolkit; using CKAN.Games; diff --git a/ConsoleUI/SplashScreen.cs b/ConsoleUI/SplashScreen.cs index 62be6d1e19..4e56aa11ea 100644 --- a/ConsoleUI/SplashScreen.cs +++ b/ConsoleUI/SplashScreen.cs @@ -1,4 +1,5 @@ using System; + using CKAN.ConsoleUI.Toolkit; namespace CKAN.ConsoleUI { diff --git a/debian/Makefile b/debian/Makefile index 775a0486e1..53fd225937 100644 --- a/debian/Makefile +++ b/debian/Makefile @@ -14,8 +14,8 @@ DEBCHANGESRC:=changelog DEBCHANGEDEST:=$(DESTDIR)/usr/share/doc/ckan/changelog.Debian.gz MANSRC:=ckan.1 MANDEST:=$(DESTDIR)/usr/share/man/man1/ckan.1.gz -ICONSRC:=ckan.ico -ICONDEST:=$(DESTDIR)/usr/share/icons/ckan.ico +ICONSIZES=16 32 48 64 96 128 256 +ICONDEST:=$(foreach size,$(ICONSIZES),$(DESTDIR)/usr/share/icons/hicolor/$(size)x$(size)/apps/ckan.png) COPYRIGHTSRC:=copyright COPYRIGHTDEST:=$(DESTDIR)/usr/share/doc/ckan/copyright DESKTOPSRC:=ckan.desktop @@ -113,9 +113,12 @@ $(MANDEST): $(MANSRC) umask 0022 && mkdir -p $(shell dirname $@) umask 0022 && gzip --best -n -c $< > $@ -$(ICONDEST): $(ICONSRC) - umask 0022 && mkdir -p $(shell dirname $@) - umask 0022 && cp $< $@ +define icon_rule_template = +$$(DESTDIR)/usr/share/icons/hicolor/$(1)x$(1)/apps/ckan.png: ../assets/ckan-$(1).png + umask 0022 && mkdir -p $$(shell dirname $$@) + umask 0022 && cp $$< $$@ +endef +$(foreach size,$(ICONSIZES),$(eval $(call icon_rule_template,$(size)))) $(COPYRIGHTDEST): $(COPYRIGHTSRC) umask 0022 && mkdir -p $(shell dirname $@) diff --git a/debian/ckan-cmdprompt.desktop b/debian/ckan-cmdprompt.desktop index ebc7b8cab0..f4b16f3b21 100644 --- a/debian/ckan-cmdprompt.desktop +++ b/debian/ckan-cmdprompt.desktop @@ -2,7 +2,7 @@ Name=CKAN Command Prompt Comment=Comprehensive Kerbal Archive Network Command Prompt Keywords=Kerbal Space Program;KSP;Mod;Command Prompt; -Icon=/usr/share/icons/ckan.ico +Icon=ckan Categories=Game;PackageManager;ConsoleOnly; Exec=/usr/bin/ckan prompt Terminal=true diff --git a/debian/ckan-consoleui.desktop b/debian/ckan-consoleui.desktop index 2cadc5c829..e557d8f20a 100644 --- a/debian/ckan-consoleui.desktop +++ b/debian/ckan-consoleui.desktop @@ -2,7 +2,7 @@ Name=CKAN Console UI Comment=Comprehensive Kerbal Archive Network Console UI Keywords=Kerbal Space Program;KSP;Mod;Console; -Icon=/usr/share/icons/ckan.ico +Icon=ckan Categories=Game;PackageManager;ConsoleOnly; Exec=/usr/bin/ckan consoleui Terminal=true diff --git a/debian/ckan.desktop b/debian/ckan.desktop index df50616577..00666766b3 100644 --- a/debian/ckan.desktop +++ b/debian/ckan.desktop @@ -2,7 +2,7 @@ Name=CKAN Comment=Comprehensive Kerbal Archive Network Client Keywords=Kerbal Space Program;KSP;Mod; -Icon=/usr/share/icons/ckan.ico +Icon=ckan Categories=Game;PackageManager; Exec=/usr/bin/ckan Terminal=false diff --git a/debian/ckan.ico b/debian/ckan.ico deleted file mode 100644 index 66e3a2ccc7..0000000000 Binary files a/debian/ckan.ico and /dev/null differ diff --git a/rpm/Makefile b/rpm/Makefile index db32f3b08e..ab6022145a 100644 --- a/rpm/Makefile +++ b/rpm/Makefile @@ -9,7 +9,8 @@ MANSRC:=$(DEBDIR)/ckan.1 DESKTOPSRC:=$(DEBDIR)/ckan.desktop CONSOLEUIDESKTOPSRC:=$(DEBDIR)/ckan-consoleui.desktop CMDPROMPTDESKTOPSRC:=$(DEBDIR)/ckan-cmdprompt.desktop -ICONSRC:=$(DEBDIR)/ckan.ico +ICONSIZES=16 32 48 64 96 128 256 +ICONSRC:=$(foreach size,$(ICONSIZES),../assets/ckan-$(size).png) CONFIGURATION?=Release EXESRC:=$(shell pwd)/../_build/repack/$(CONFIGURATION)/ckan.exe CHANGELOGSRC:=../CHANGELOG.md diff --git a/rpm/ckan.spec b/rpm/ckan.spec index 4594f632b8..8385d4aee4 100644 --- a/rpm/ckan.spec +++ b/rpm/ckan.spec @@ -12,9 +12,15 @@ Source0: ckan Source1: ckan.exe Source2: ckan.1 Source3: ckan.desktop -Source4: ckan.ico -Source5: ckan-consoleui.desktop -Source6: ckan-cmdprompt.desktop +Source4: ckan-consoleui.desktop +Source5: ckan-cmdprompt.desktop +Source6: ckan-16.png +Source7: ckan-32.png +Source8: ckan-48.png +Source9: ckan-64.png +Source10: ckan-96.png +Source11: ckan-128.png +Source12: ckan-256.png %description KSP-CKAN official client. @@ -35,10 +41,14 @@ mkdir -p %{buildroot}%{_mandir}/man1 cp %{SOURCE2} %{buildroot}%{_mandir}/man1 mkdir -p %{buildroot}%{_datadir}/applications cp %{SOURCE3} %{buildroot}%{_datadir}/applications +cp %{SOURCE4} %{buildroot}%{_datadir}/applications cp %{SOURCE5} %{buildroot}%{_datadir}/applications -cp %{SOURCE6} %{buildroot}%{_datadir}/applications -mkdir -p %{buildroot}%{_datadir}/icons -cp %{SOURCE4} %{buildroot}%{_datadir}/icons +for SRC in %{SOURCE6} %{SOURCE7} %{SOURCE8} %{SOURCE9} %{SOURCE10} %{SOURCE11} %{SOURCE12} +do + DIM=$(basename "${SRC}" | sed -e 's/[^0-9]//g') + mkdir -p %{buildroot}%{_datadir}/icons/hicolor/${DIM}x${DIM}/apps + cp "${SRC}" %{buildroot}%{_datadir}/icons/hicolor/${DIM}x${DIM}/apps/ckan.png +done %files %{_bindir}/*