From b7555409f60b9506cc3edb9fa3224dc051c027c6 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 27 Mar 2018 11:57:40 +0100 Subject: Allow icon resources to be included in the binary Include two styles of icon from the GNOME Adwaita theme. These are enabled by default and add 30 Kbytes to the size of the binary. --- Config.in | 25 +++++++++++++++++++++++++ Makefile | 4 +++- configs/mingw32_defconfig | 10 ++++++++-- configs/mingw64_defconfig | 10 ++++++++-- win32/icon/COPYING_CCBYSA3 | 7 +++++++ win32/icon/Kbuild.src | 15 +++++++++++++++ win32/icon/README | 9 +++++++++ win32/icon/aterm.ico | Bin 0 -> 15086 bytes win32/icon/dummy.c | 0 win32/icon/icon.rc | 8 ++++++++ win32/icon/sterm.ico | Bin 0 -> 15086 bytes 11 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 win32/icon/COPYING_CCBYSA3 create mode 100644 win32/icon/Kbuild.src create mode 100644 win32/icon/README create mode 100644 win32/icon/aterm.ico create mode 100644 win32/icon/dummy.c create mode 100644 win32/icon/icon.rc create mode 100644 win32/icon/sterm.ico diff --git a/Config.in b/Config.in index a18d26720..4697f2a4d 100644 --- a/Config.in +++ b/Config.in @@ -401,6 +401,31 @@ config FEATURE_PRNG_ISAAC endchoice +config FEATURE_ICON + bool "Include application icon in binary" + default y + depends on PLATFORM_MINGW32 + help + Microsoft Windows applications can contain icons which are used in + various places in the user interface. Each icon adds 15 Kbytes to + the size of the binary. + +choice + prompt "Application icon" + default FEATURE_ICON_ALL + depends on FEATURE_ICON + +config FEATURE_ICON_ATERM + bool "Adwaita terminal" + +config FEATURE_ICON_STERM + bool "Adwaita terminal (symbolic)" + +config FEATURE_ICON_ALL + bool "All available icons" + +endchoice + comment 'Build Options' config STATIC diff --git a/Makefile b/Makefile index 7e9ead1e3..44807cd9d 100644 --- a/Makefile +++ b/Makefile @@ -297,6 +297,7 @@ NM = $(CROSS_COMPILE)nm STRIP = $(CROSS_COMPILE)strip OBJCOPY = $(CROSS_COMPILE)objcopy OBJDUMP = $(CROSS_COMPILE)objdump +WINDRES = $(CROSS_COMPILE)windres PKG_CONFIG ?= $(CROSS_COMPILE)pkg-config AWK = awk GENKSYMS = scripts/genksyms/genksyms @@ -331,7 +332,7 @@ KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION \ ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \ - CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE \ + CPP AR NM STRIP OBJCOPY OBJDUMP WINDRES MAKE AWK GENKSYMS PERL UTS_MACHINE \ HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS export CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS LDFLAGS @@ -463,6 +464,7 @@ scripts_basic: include/autoconf.h # Objects we will link into busybox / subdirs we need to visit core-y := \ applets/ \ + win32/icon/ \ libs-y := \ archival/ \ diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig index 8128764a8..d2cc9bdb4 100644 --- a/configs/mingw32_defconfig +++ b/configs/mingw32_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.29.0.git -# Thu Mar 15 10:05:34 2018 +# Tue Mar 27 11:35:09 2018 # CONFIG_HAVE_DOT_CONFIG=y # CONFIG_PLATFORM_POSIX is not set @@ -19,7 +19,6 @@ CONFIG_SHOW_USAGE=y CONFIG_FEATURE_VERBOSE_USAGE=y CONFIG_FEATURE_COMPRESS_USAGE=y CONFIG_LFS=y -# CONFIG_GLOBBING is not set # CONFIG_PAM is not set # CONFIG_FEATURE_DEVPTS is not set # CONFIG_FEATURE_UTMP is not set @@ -38,6 +37,13 @@ CONFIG_BUSYBOX_EXEC_PATH="" # CONFIG_FEATURE_CLEAN_UP is not set # CONFIG_FEATURE_SYSLOG is not set # CONFIG_PLATFORM_LINUX is not set +# CONFIG_GLOBBING is not set +CONFIG_FEATURE_PRNG_SHELL=y +# CONFIG_FEATURE_PRNG_ISAAC is not set +CONFIG_FEATURE_ICON=y +# CONFIG_FEATURE_ICON_ATERM is not set +# CONFIG_FEATURE_ICON_STERM is not set +CONFIG_FEATURE_ICON_ALL=y # # Build Options diff --git a/configs/mingw64_defconfig b/configs/mingw64_defconfig index d96dc4540..4d990d0bb 100644 --- a/configs/mingw64_defconfig +++ b/configs/mingw64_defconfig @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.29.0.git -# Thu Mar 15 10:21:09 2018 +# Tue Mar 27 11:35:09 2018 # CONFIG_HAVE_DOT_CONFIG=y # CONFIG_PLATFORM_POSIX is not set @@ -19,7 +19,6 @@ CONFIG_SHOW_USAGE=y CONFIG_FEATURE_VERBOSE_USAGE=y CONFIG_FEATURE_COMPRESS_USAGE=y CONFIG_LFS=y -# CONFIG_GLOBBING is not set # CONFIG_PAM is not set # CONFIG_FEATURE_DEVPTS is not set # CONFIG_FEATURE_UTMP is not set @@ -38,6 +37,13 @@ CONFIG_BUSYBOX_EXEC_PATH="" # CONFIG_FEATURE_CLEAN_UP is not set # CONFIG_FEATURE_SYSLOG is not set # CONFIG_PLATFORM_LINUX is not set +# CONFIG_GLOBBING is not set +CONFIG_FEATURE_PRNG_SHELL=y +# CONFIG_FEATURE_PRNG_ISAAC is not set +CONFIG_FEATURE_ICON=y +# CONFIG_FEATURE_ICON_ATERM is not set +# CONFIG_FEATURE_ICON_STERM is not set +CONFIG_FEATURE_ICON_ALL=y # # Build Options diff --git a/win32/icon/COPYING_CCBYSA3 b/win32/icon/COPYING_CCBYSA3 new file mode 100644 index 000000000..fc45d7818 --- /dev/null +++ b/win32/icon/COPYING_CCBYSA3 @@ -0,0 +1,7 @@ +This work is licenced under the Creative Commons Attribution-Share Alike 3.0 +United States License. To view a copy of this licence, visit +http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative +Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA. + +When attributing the artwork, using "GNOME Project" is enough. +Please link to http://www.gnome.org where available. diff --git a/win32/icon/Kbuild.src b/win32/icon/Kbuild.src new file mode 100644 index 000000000..bde74091f --- /dev/null +++ b/win32/icon/Kbuild.src @@ -0,0 +1,15 @@ +# Makefile for busybox +# +# Copyright (C) 2018 by R M Yorston +# +# Licensed under GPLv2, see file LICENSE in this source tree. + +obj-y := + +obj-$(CONFIG_FEATURE_ICON) += icon.o + +quiet_cmd_windres = WINDRES $@ + cmd_windres = $(WINDRES) $< $@ + +win32/icon/icon.o: win32/icon/icon.rc .config + $(call cmd,windres) diff --git a/win32/icon/README b/win32/icon/README new file mode 100644 index 000000000..33a245386 --- /dev/null +++ b/win32/icon/README @@ -0,0 +1,9 @@ +The icons are based on those for GNOME terminal in the Adwaita theme. + +They were generated by importing the 16x16, 32x32 and 48x48 PNG files +into GIMP as separate layers then exporting as a single .ico file. + +The original files are dual-licensed under either the GNU LGPL v3 or +Creative Commons Attribution-Share Alike 3.0 United States License. + +The .ico files are licensed under the latter. diff --git a/win32/icon/aterm.ico b/win32/icon/aterm.ico new file mode 100644 index 000000000..e680216a2 Binary files /dev/null and b/win32/icon/aterm.ico differ diff --git a/win32/icon/dummy.c b/win32/icon/dummy.c new file mode 100644 index 000000000..e69de29bb diff --git a/win32/icon/icon.rc b/win32/icon/icon.rc new file mode 100644 index 000000000..d91c4a482 --- /dev/null +++ b/win32/icon/icon.rc @@ -0,0 +1,8 @@ +#include "../../include/autoconf.h" + +#if CONFIG_FEATURE_ICON_ATERM || CONFIG_FEATURE_ICON_ALL +1 ICON "aterm.ico" +#endif +#if CONFIG_FEATURE_ICON_STERM || CONFIG_FEATURE_ICON_ALL +2 ICON "sterm.ico" +#endif diff --git a/win32/icon/sterm.ico b/win32/icon/sterm.ico new file mode 100644 index 000000000..b9125b34d Binary files /dev/null and b/win32/icon/sterm.ico differ -- cgit v1.2.3-55-g6feb