Skip to content

Commit

Permalink
Merge #4104 Support icons from libraries for deb and rpm
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jun 7, 2024
2 parents 0c35797 + 1ef9bb9 commit e92777c
Show file tree
Hide file tree
Showing 22 changed files with 47 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions ConsoleUI/AuthTokenAddDialog.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;

using Autofac;

using CKAN.ConsoleUI.Toolkit;
using CKAN.Configuration;

Expand Down
4 changes: 3 additions & 1 deletion ConsoleUI/AuthTokenListScreen.cs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/DownloadImportDialog.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Collections.Generic;

using CKAN.ConsoleUI.Toolkit;

namespace CKAN.ConsoleUI {
Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/ExitScreen.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Collections.Generic;

using CKAN.ConsoleUI.Toolkit;

namespace CKAN.ConsoleUI {
Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/GameInstanceAddScreen.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;

using CKAN.ConsoleUI.Toolkit;

namespace CKAN.ConsoleUI {
Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/GameInstanceEditScreen.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;

using CKAN.Versioning;
using CKAN.ConsoleUI.Toolkit;

Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/GameInstanceScreen.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.IO;

using CKAN.ConsoleUI.Toolkit;

namespace CKAN.ConsoleUI {
Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/InstallFilterAddDialog.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;

using CKAN.ConsoleUI.Toolkit;

namespace CKAN.ConsoleUI {
Expand Down
2 changes: 1 addition & 1 deletion ConsoleUI/InstallFromCkanDialog.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System;
using System.IO;
using System.Linq;

using CKAN.ConsoleUI.Toolkit;
using System.Linq;

namespace CKAN.ConsoleUI {

Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/ModListHelpDialog.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Text;

using CKAN.ConsoleUI.Toolkit;

namespace CKAN.ConsoleUI {
Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/ProgressScreen.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;

using CKAN.ConsoleUI.Toolkit;

namespace CKAN.ConsoleUI {
Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/RepoAddScreen.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;

using CKAN.Games;

namespace CKAN.ConsoleUI {
Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/RepoScreen.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;

using CKAN.ConsoleUI.Toolkit;
using CKAN.Games;

Expand Down
1 change: 1 addition & 0 deletions ConsoleUI/SplashScreen.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;

using CKAN.ConsoleUI.Toolkit;

namespace CKAN.ConsoleUI {
Expand Down
13 changes: 8 additions & 5 deletions debian/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 $@)
Expand Down
2 changes: 1 addition & 1 deletion debian/ckan-cmdprompt.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion debian/ckan-consoleui.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion debian/ckan.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file removed debian/ckan.ico
Binary file not shown.
3 changes: 2 additions & 1 deletion rpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 16 additions & 6 deletions rpm/ckan.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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}/*
Expand Down

0 comments on commit e92777c

Please sign in to comment.