diff --git a/.cirrus.yml b/.cirrus.yml index f58a2ce56a..4f19bd2ca9 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -344,7 +344,7 @@ task: check_clang_script: - clang --version brew_install_script: - - brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt + - brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt imagemagick libicns librsvg << : *MAIN_TEMPLATE env: << : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV diff --git a/Makefile.am b/Makefile.am index c5ebaf0567..c0a018e1e8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,7 +40,7 @@ OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME)) OSX_DMG = $(OSX_VOLNAME).dmg MAKE_DMG_OPEN_FINDER_SCRIPT=$(top_srcdir)/contrib/macdeploy/make-dmg-open-finder OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus -OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns +OSX_INSTALLER_ICONS=src/qt/res/rendered_icons/bitcoin.icns OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed DIST_CONTRIB = \ @@ -59,9 +59,9 @@ BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \ $(top_srcdir)/contrib/devtools/security-check.py \ $(top_srcdir)/contrib/devtools/utils.py -WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \ +WINDOWS_PACKAGING = src/qt/res/rendered_icons/bitcoin.ico \ $(top_srcdir)/share/pixmaps/nsis-header.bmp \ - $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \ + src/qt/res/rendered_icons/nsis-wizard.bmp \ $(top_srcdir)/doc/README_windows.txt OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \ @@ -72,11 +72,14 @@ COVERAGE_INFO = $(COV_TOOL_WRAPPER) baseline.info \ baseline_filtered.info functional_test.info functional_test_filtered.info \ test_bitcoin_coverage.info test_bitcoin.info fuzz.info fuzz_filtered.info fuzz_coverage.info +src/qt/res/rendered_icons/%: FORCE + $(MAKE) -C src $(patsubst src/%,%,$@) + dist-hook: -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf - if TARGET_WINDOWS -$(BITCOIN_WIN_INSTALLER): all-recursive +$(BITCOIN_WIN_INSTALLER): all-recursive $(WINDOWS_PACKAGING) $(MKDIR_P) $(top_builddir)/release STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release @@ -331,6 +334,9 @@ docs: @echo "error: doxygen not found" endif +src_files: $(DISTFILES) + @true + clean-docs: rm -rf doc/doxygen diff --git a/ci/test/00_setup_env.sh b/ci/test/00_setup_env.sh index 4a54f47b03..e2359445bd 100755 --- a/ci/test/00_setup_env.sh +++ b/ci/test/00_setup_env.sh @@ -67,7 +67,7 @@ export BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build} export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/releases/$HOST} export DIR_IWYU="${BASE_SCRATCH_DIR}/iwyu" export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks} -export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3 rsync git procps bison} +export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3 rsync git procps bison icnsutils librsvg2-bin imagemagick} export GOAL=${GOAL:-install} export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets} export PATH=${BASE_ROOT_DIR}/ci/retry:$PATH diff --git a/ci/test/00_setup_env_i686_centos.sh b/ci/test/00_setup_env_i686_centos.sh index 8a931d44e5..4322c879be 100755 --- a/ci/test/00_setup_env_i686_centos.sh +++ b/ci/test/00_setup_env_i686_centos.sh @@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8 export HOST=i686-pc-linux-gnu export CONTAINER_NAME=ci_i686_centos export CI_IMAGE_NAME_TAG=quay.io/centos/centos:stream8 -export CI_BASE_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python38 python38-pip which patch lbzip2 xz procps-ng dash rsync coreutils bison" +export CI_BASE_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python38 python38-pip which patch lbzip2 xz procps-ng dash rsync coreutils bison libicns-utils librsvg2-tools ImageMagick" export PIP_PACKAGES="pyzmq" export GOAL="install" export NO_WERROR=1 # GCC 8 diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index fe42871c31..aebfe76a11 100755 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos_cross export CI_IMAGE_NAME_TAG=ubuntu:20.04 # Check that Focal can cross-compile to macos export HOST=x86_64-apple-darwin -export PACKAGES="cmake libz-dev libtinfo5 python3-setuptools xorriso" +export PACKAGES="cmake libz-dev libtinfo5 python3-setuptools xorriso icnsutils imagemagick librsvg2-bin" export XCODE_VERSION=12.2 export XCODE_BUILD_ID=12B45b export RUN_UNIT_TESTS=false diff --git a/configure.ac b/configure.ac index b763aa46e0..3a9e6c35a5 100644 --- a/configure.ac +++ b/configure.ac @@ -730,6 +730,17 @@ 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 @@ -781,6 +792,10 @@ case $host in AX_CHECK_LINK_FLAG([-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1], [CORE_LDFLAGS="$CORE_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 $cross_compiling != "yes"; then BUILD_OS=darwin @@ -885,6 +900,8 @@ case $host in ;; esac +AM_CONDITIONAL([CAN_RENDER_ICONS], [test "$can_render_icons" = "yes"]) + if test "$use_extended_functional_tests" != "no"; then AC_SUBST(EXTENDED_FUNCTIONAL_TESTS, --extended) fi diff --git a/contrib/guix/libexec/make_release_tarball.sh b/contrib/guix/libexec/make_release_tarball.sh index 0c9c6ef3c3..74b7ffa9e6 100755 --- a/contrib/guix/libexec/make_release_tarball.sh +++ b/contrib/guix/libexec/make_release_tarball.sh @@ -24,6 +24,7 @@ cd "${DISTNAME}" ./autogen.sh ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking +make src_files make distclean cd .. diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index d83ff08713..45ec0b7b9d 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -16,6 +16,8 @@ (gnu packages gawk) (gnu packages gcc) (gnu packages gnome) + (gnu packages image) + (gnu packages imagemagick) (gnu packages installers) (gnu packages linux) (gnu packages llvm) @@ -594,6 +596,9 @@ inspecting signatures in Mach-O binaries.") automake pkg-config bison + imagemagick + libicns + librsvg-2.40 ;; Native GCC 10 toolchain gcc-toolchain-10 (list gcc-toolchain-10 "static") diff --git a/share/setup.nsi.in b/share/setup.nsi.in index 2ce798bd2d..3d54d572f5 100644 --- a/share/setup.nsi.in +++ b/share/setup.nsi.in @@ -15,8 +15,8 @@ Unicode true !define URL @PACKAGE_URL@ # MUI Symbol Definitions -!define MUI_ICON "@abs_top_srcdir@/share/pixmaps/bitcoin.ico" -!define MUI_WELCOMEFINISHPAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-wizard.bmp" +!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_HEADERIMAGE !define MUI_HEADERIMAGE_RIGHT !define MUI_HEADERIMAGE_BITMAP "@abs_top_srcdir@/share/pixmaps/nsis-header.bmp" @@ -28,7 +28,7 @@ Unicode true !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_srcdir@/share/pixmaps/nsis-wizard.bmp" +!define MUI_UNWELCOMEFINISHPAGE_BITMAP "@abs_top_builddir@/src/qt/res/rendered_icons/nsis-wizard.bmp" !define MUI_UNFINISHPAGE_NOAUTOCLOSE # Included files diff --git a/src/Makefile.am b/src/Makefile.am index ab6fff3b67..01afcda660 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1129,6 +1129,47 @@ endif } > "$@.new" && mv -f "$@.new" "$@" @echo "Generated $@" +# 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/bitcoin.ico \ + qt/res/rendered_icons/bitcoin_testnet.ico \ + qt/res/rendered_icons/bitcoin1024.png + +RES_ALL_RENDERED_ICONS = $(RES_RENDERED_ICONS) \ + $(patsubst %,qt/res/rendered_icons/bitcoin%.png,16 32 48 256 290 512 1024) \ + qt/res/rendered_icons/bitcoin.icns \ + 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/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) $^ -modulate 100,87,9 $@ + +qt/res/rendered_icons/nsis-wizard.bmp: qt/res/rendered_icons/bitcoin290.png + $(IMAGEMAGICK_CONVERT) $^ -crop 164x290+62+0 -border 0x12 -strip BMP3:$@ + +endif + + if EMBEDDED_LEVELDB include Makefile.crc32c.include include Makefile.leveldb.include diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 8d5ea2dc89..77cefd120a 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -106,6 +106,7 @@ QT_MOC = \ QT_QRC_CPP = qt/qrc_bitcoin.cpp QT_QRC = qt/bitcoin.qrc +QT_QRC_BUILD = qt/qrc_bitcoin_build.qrc QT_QRC_LOCALE_CPP = qt/qrc_bitcoin_locale.cpp QT_QRC_LOCALE = qt/bitcoin_locale.qrc @@ -179,12 +180,9 @@ BITCOIN_QT_H = \ QT_RES_FONTS = \ qt/res/fonts/RobotoMono-Bold.ttf -QT_RES_ICONS = \ +QT_RES_ICONS = $(RES_RENDERED_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 \ @@ -304,6 +302,8 @@ QT_RES_ANIMATION = $(wildcard $(srcdir)/qt/res/animation/spinner-*.png) BITCOIN_QT_RC = qt/res/bitcoin-qt-res.rc +$(BITCOIN_RC): qt/res/rendered_icons/bitcoin.ico qt/res/rendered_icons/bitcoin_testnet.ico + BITCOIN_QT_INCLUDES = -DQT_NO_KEYWORDS -DQT_USE_QSTRINGBUILDER qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ @@ -388,11 +388,14 @@ $(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM) $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin_locale --format-version 1 $(@D)/temp_$( $@ @rm $(@D)/temp_$("$@" + +$(QT_QRC_CPP): $(QT_QRC_BUILD) $(QT_FORMS_H) $(QT_RES_FONTS) $(QT_RES_ICONS) $(QT_RES_ANIMATION) @test -f $(RCC) $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin --format-version 1 $< > $@ -CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno qt/temp_bitcoin_locale.qrc +CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno qt/temp_bitcoin_locale.qrc $(QT_QRC_BUILD) CLEANFILES += $(CLEAN_QT) diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index fed373e551..09ddd170e7 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -1,6 +1,6 @@ - res/icons/bitcoin.png + res/rendered_icons/bitcoin1024.png res/icons/address-book.png res/icons/send.png res/icons/connect0.png diff --git a/src/qt/res/bitcoin-qt-res.rc b/src/qt/res/bitcoin-qt-res.rc index e590b407b0..ca228ad9b6 100644 --- a/src/qt/res/bitcoin-qt-res.rc +++ b/src/qt/res/bitcoin-qt-res.rc @@ -1,5 +1,5 @@ -IDI_ICON1 ICON DISCARDABLE "icons/bitcoin.ico" -IDI_ICON2 ICON DISCARDABLE "icons/bitcoin_testnet.ico" +IDI_ICON1 ICON DISCARDABLE "rendered_icons/bitcoin.ico" +IDI_ICON2 ICON DISCARDABLE "rendered_icons/bitcoin_testnet.ico" #include // needed for VERSIONINFO #include "../../clientversion.h" // holds the needed client version information diff --git a/src/qt/res/src/bitcoin.svg b/src/qt/res/src/bitcoin.svg index 14cf0c5e11..d8da87394d 100644 --- a/src/qt/res/src/bitcoin.svg +++ b/src/qt/res/src/bitcoin.svg @@ -7,7 +7,7 @@