Skip to content

Commit

Permalink
build: drop the rendered icon stuff
Browse files Browse the repository at this point in the history
This is broken in multiple ways, does not exist in 0.14, appears in an
unreviewed mega-PR "porting" from a version of liquid-qt that I cannot
track down, and apparently has caused a fair bit of follow-on trouble
with icon integration.

Just put the icons in the repo like upstream does.

The committed icons were built using the Makefile prior to this
commit, starting from ./share/pixmaps/nsis-wizard.svg and
./src/qt/res/src/bitcoin.svg. They should be recreated manually
if they need to be changed in the future.
  • Loading branch information
apoelstra committed Mar 26, 2021
1 parent ee5d4e3 commit a1bac6d
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 84 deletions.
9 changes: 3 additions & 6 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ OSX_BACKGROUND_IMAGE_DPIS=36 72
OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py
OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
OSX_INSTALLER_ICONS=src/qt/res/rendered_icons/bitcoin.icns
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
OSX_QT_TRANSLATIONS = ar,bg,ca,cs,da,de,es,fa,fi,fr,gd,gl,he,hu,it,ja,ko,lt,lv,pl,pt,ru,sk,sl,sv,uk,zh_CN,zh_TW

Expand All @@ -54,9 +54,9 @@ DIST_SHARE = \
BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
$(top_srcdir)/contrib/devtools/security-check.py

WINDOWS_PACKAGING = src/qt/res/rendered_icons/bitcoin.ico \
WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
$(top_srcdir)/share/pixmaps/nsis-header.bmp \
src/qt/res/rendered_icons/nsis-wizard.bmp \
$(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
$(top_srcdir)/doc/README_windows.txt

OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
Expand Down Expand Up @@ -96,9 +96,6 @@ $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
$(MKDIR_P) $(@D)
$(INSTALL_DATA) $< $@

src/qt/res/rendered_icons/%: FORCE
$(MAKE) -C src $(patsubst src/%,%,$@)

$(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
$(MKDIR_P) $(@D)
$(INSTALL_DATA) $< $@
Expand Down
19 changes: 2 additions & 17 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -598,17 +598,6 @@ AC_ARG_WITH([daemon],
[build_bitcoind=$withval],
[build_bitcoind=yes])

can_render_icons=yes
AC_PATH_PROGS([RSVG_CONVERT],[rsvg-convert rsvg],no)
AC_PATH_PROGS([IMAGEMAGICK_CONVERT],[convert],no)
AC_PATH_PROGS([PNG2ICNS],[png2icns],no)

if test x$RSVG_CONVERT = xno; then
can_render_icons='rsvg-convert'
elif test x$IMAGEMAGICK_CONVERT = xno; then
can_render_icons='(ImageMagick) convert'
fi

case $host in
*mingw*)
TARGET_OS=windows
Expand Down Expand Up @@ -655,10 +644,6 @@ case $host in
AX_CHECK_LINK_FLAG([[-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1]],[LDFLAGS="$LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"],,[[$LDFLAG_WERROR]])
;;
*darwin*)
if test x$PNG2ICNS = xno; then
can_render_icons='png2icns'
fi

TARGET_OS=darwin
if test x$cross_compiling != xyes; then
BUILD_OS=darwin
Expand Down Expand Up @@ -693,6 +678,8 @@ case $host in
AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool)
AC_PATH_TOOL([OTOOL], [otool], otool)
AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage)
AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)
AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert)
AC_PATH_PROGS([TIFFCP], [tiffcp],tiffcp)

dnl libtool will try to strip the static lib, which is a problem for
Expand All @@ -717,8 +704,6 @@ case $host in
;;
esac

AM_CONDITIONAL([CAN_RENDER_ICONS], [test x$can_render_icons = xyes])

if test x$use_extended_functional_tests != xno; then
AC_SUBST(EXTENDED_FUNCTIONAL_TESTS, --extended)
fi
Expand Down
Binary file modified share/pixmaps/nsis-wizard.bmp
Binary file not shown.
28 changes: 28 additions & 0 deletions share/pixmaps/nsis-wizard.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions share/setup.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ SetDateSave off
!define URL @PACKAGE_URL@

# MUI Symbol Definitions
!define MUI_ICON "@abs_top_srcdir@/src/qt/res/rendered_icons/bitcoin.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "@abs_top_builddir@/src/qt/res/rendered_icons/nsis-wizard.bmp"
!define MUI_ICON "@abs_top_srcdir@/src/qt/res/icons/bitcoin.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "@abs_top_builddir@/share/pixmaps/nsis-wizard.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_RIGHT
!define MUI_HEADERIMAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-header.bmp"
Expand All @@ -27,7 +27,7 @@ SetDateSave off
!define MUI_FINISHPAGE_RUN "$WINDIR\explorer.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "@abs_top_builddir@/src/qt/res/rendered_icons/nsis-wizard.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "@abs_top_builddir@/share/pixmaps/nsis-wizard.bmp"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE

# Included files
Expand Down
54 changes: 0 additions & 54 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -798,60 +798,6 @@ include Makefile.crc32c.include
include Makefile.leveldb.include
endif

# Rendered icons must be here, not in Makefile.qt.include, since they are distributed with the source tarball

RES_RENDERED_ICON_SRC = qt/res/src/bitcoin.svg

RES_RENDERED_ICONS = \
qt/res/rendered_icons/about.png \
qt/res/rendered_icons/bitcoin.ico \
qt/res/rendered_icons/bitcoin_testnet.ico \
qt/res/rendered_icons/bitcoin1024.png

RES_ALL_RENDERED_ICONS = $(RES_RENDERED_ICONS) \
qt/res/rendered_icons/about.svg \
$(patsubst %,qt/res/rendered_icons/bitcoin%.png,16 32 48 256 512 1024) \
qt/res/rendered_icons/bitcoin.icns \
qt/res/rendered_icons/nsis-wizard.svg \
qt/res/rendered_icons/nsis-wizard.bmp

EXTRA_DIST += $(RES_RENDERED_ICON_SRC) $(RES_ALL_RENDERED_ICONS)

if CAN_RENDER_ICONS

qt/res/rendered_icons/about.png: qt/res/rendered_icons/about.svg
$(RSVG_CONVERT) -f png -d 142 -p 142 < $< | $(IMAGEMAGICK_CONVERT) - -bordercolor transparent -colorspace Gray -strip $@

qt/res/rendered_icons/about.svg: qt/res/src/bitcoin.svg
@$(MKDIR_P) $(@D)
sed '/fill="#000"/d;s/fill="[^"]*"//g' < $< > $@

qt/res/rendered_icons/bitcoin%.png: qt/res/src/bitcoin.svg
@$(MKDIR_P) $(@D)
$(RSVG_CONVERT) -f png -d $* -p $* < $< > $@

# NOTE: ImageMagick will never convert transparent PNGs to 8-bit ICOs, but GIF is fine
qt/res/rendered_icons/bitcoin%d8.gif: qt/res/rendered_icons/bitcoin%.png
$(IMAGEMAGICK_CONVERT) $^ -colors 256 -channel A -threshold '50%' $@

qt/res/rendered_icons/bitcoin.icns: $(patsubst %,qt/res/rendered_icons/bitcoin%.png,256 512 1024 32 16)
$(PNG2ICNS) $@ $^

qt/res/rendered_icons/bitcoin.ico: qt/res/rendered_icons/bitcoin32d8.gif $(patsubst %,qt/res/rendered_icons/bitcoin%.png,256 64 48 32 20 16)
$(IMAGEMAGICK_CONVERT) $^ $@

qt/res/rendered_icons/bitcoin_testnet.ico: qt/res/rendered_icons/bitcoin.ico
$(IMAGEMAGICK_CONVERT) $^ $@

qt/res/rendered_icons/nsis-wizard.svg: qt/res/src/bitcoin.svg
@$(MKDIR_P) $(@D)
sed '/fill="#000"/d' < $< > $@

qt/res/rendered_icons/nsis-wizard.bmp: qt/res/rendered_icons/nsis-wizard.svg
$(RSVG_CONVERT) -f png -d 360 -p 360 < $< | $(IMAGEMAGICK_CONVERT) - -strip BMP3:$@

endif

include Makefile.test_util.include
include Makefile.test_fuzz.include

Expand Down
5 changes: 4 additions & 1 deletion src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,12 @@ BITCOIN_QT_H = \
qt/walletview.h \
qt/winshutdownmonitor.h

RES_ICONS = $(RES_RENDERED_ICONS) \
RES_ICONS = \
qt/res/icons/add.png \
qt/res/icons/address-book.png \
qt/res/icons/bitcoin.ico \
qt/res/icons/bitcoin_testnet.ico \
qt/res/icons/bitcoin.png \
qt/res/icons/chevron.png \
qt/res/icons/clock1.png \
qt/res/icons/clock2.png \
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoin.qrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/icons">
<file alias="bitcoin">res/rendered_icons/bitcoin1024.png</file>
<file alias="bitcoin">res/icons/bitcoin.png</file>
<file alias="address-book">res/icons/address-book.png</file>
<file alias="send">res/icons/send.png</file>
<file alias="connect_0">res/icons/connect0.png</file>
Expand Down
4 changes: 2 additions & 2 deletions src/qt/res/bitcoin-qt-res.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
IDI_ICON1 ICON DISCARDABLE "rendered_icons/bitcoin.ico"
IDI_ICON2 ICON DISCARDABLE "rendered_icons/bitcoin_testnet.ico"
IDI_ICON1 ICON DISCARDABLE "icons/bitcoin.ico"
IDI_ICON2 ICON DISCARDABLE "icons/bitcoin_testnet.ico"

#include <windows.h> // needed for VERSIONINFO
#include "../../clientversion.h" // holds the needed client version information
Expand Down
Binary file modified src/qt/res/icons/bitcoin.icns
Binary file not shown.
Binary file modified src/qt/res/icons/bitcoin.ico
Binary file not shown.
Binary file modified src/qt/res/icons/bitcoin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/qt/res/icons/bitcoin_testnet.ico
Binary file not shown.

0 comments on commit a1bac6d

Please sign in to comment.