Skip to content

Commit 2a66110

Browse files
committed
Merge branch 'svg_icon-28+knots' into tbc_font-28+knots
2 parents 1248d0d + 09bbed8 commit 2a66110

25 files changed

+377
-43
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
run: |
106106
# A workaround for "The `brew link` step did not complete successfully" error.
107107
brew install --quiet python@3 || brew link --overwrite python@3
108-
brew install --quiet automake libtool pkg-config gnu-getopt ccache boost libevent miniupnpc libnatpmp zeromq qt@5 qrencode
108+
brew install --quiet automake libtool pkg-config gnu-getopt ccache boost libevent miniupnpc libnatpmp zeromq qt@5 qrencode imagemagick libicns librsvg
109109
110110
- name: Set Ccache directory
111111
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"

Makefile.am

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ OSX_APP=Bitcoin-Qt.app
3232
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
3333
OSX_ZIP = $(OSX_VOLNAME).zip
3434
OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
35-
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
35+
OSX_INSTALLER_ICONS=src/qt/res/rendered_icons/bitcoin.icns
3636
OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
3737

3838
DIST_CONTRIB = \
@@ -51,9 +51,9 @@ BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
5151
$(top_srcdir)/contrib/devtools/security-check.py \
5252
$(top_srcdir)/contrib/devtools/utils.py
5353

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

5959
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \
@@ -64,11 +64,14 @@ COVERAGE_INFO = $(COV_TOOL_WRAPPER) baseline.info \
6464
baseline_filtered.info functional_test.info functional_test_filtered.info \
6565
test_bitcoin_coverage.info test_bitcoin.info fuzz.info fuzz_filtered.info fuzz_coverage.info
6666

67+
src/qt/res/rendered_icons/%: FORCE
68+
$(MAKE) -C src $(patsubst src/%,%,$@)
69+
6770
dist-hook:
6871
-$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
6972

7073
if TARGET_WINDOWS
71-
$(BITCOIN_WIN_INSTALLER): all-recursive
74+
$(BITCOIN_WIN_INSTALLER): all-recursive $(WINDOWS_PACKAGING)
7275
$(MKDIR_P) $(top_builddir)/release
7376
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
7477
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
@@ -324,6 +327,9 @@ docs:
324327
@echo "error: doxygen not found"
325328
endif
326329

330+
src_files: $(DISTFILES)
331+
@true
332+
327333
clean-docs:
328334
rm -rf doc/doxygen
329335

build-aux/m4/bitcoin_subdir_to_include.m4

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,48 @@ dnl file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
dnl BITCOIN_SUBDIR_TO_INCLUDE([CPPFLAGS-VARIABLE-NAME],[SUBDIRECTORY-NAME],[HEADER-FILE])
66
dnl SUBDIRECTORY-NAME must end with a path separator
77
AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[
8-
if test "$2" = ""; then
8+
m4_pushdef([_result_var],[$1])
9+
m4_pushdef([_rel_path],[$2])
10+
m4_pushdef([_header_file],[$3.h])
11+
if test "[]_rel_path" = ""; then
912
AC_MSG_RESULT([default])
1013
else
11-
echo "#include <$2$3.h>" >conftest.cpp
12-
newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`]
14+
echo '[#]include <'"_rel_path"'/_header_file>' >conftest.cpp
15+
newinclpath=$(
16+
${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null |
17+
${SED} -E m4_bpatsubsts([[
18+
:build_line
19+
# If the line doesn't end with a backslash, it is complete; go on to process it
20+
/\\$/!b have_complete_line
21+
# Otherwise, read the next line, and concatenate it to the current one with a space
22+
N
23+
s/\\\n/ /
24+
# Then go back and check for a trailing backslash again.
25+
t build_line
26+
27+
# When we get here, we have the completed line, with all continuations collapsed.
28+
:have_complete_line
29+
s/^[^:]*:[[:space:]]*(([^[:space:]\]|\\.)*[[:space:]])*(([^[:space:]\]|\\.)*)(\\|\\\\|\/)?]]patsubst(]_header_file[,[\.],[\\.])[[([[:space:]].*)?$/\3/
30+
# ^^^^^^^ The Make line begins with a target (which we don't care about)
31+
# ^^^^^^^^^^^^ Ignore any spaces following it
32+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Match any number of other dependencies
33+
# ^^^^^^^^^^^^^^^^^^^^^^ Match any path components for our dependency; note this is reference 3, which we are replacing with
34+
# ^^^^^^^^^^^^^ Accept the path ending in a backslash, a double-backslash (ie escaped), or a forward slash
35+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The filename must match exactly (periods are escaped, since a normal period matches any character in regex)
36+
# ^^^^^^^^^^^^^^^^^ Filename must be followed by a space, but after that we don't care; we still need to match it all so it gets replaced, however
37+
# Delete the line, but only if we failed to find the directory (t jumps past the d if we matched)
38+
t
39+
d
40+
]],[
41+
\s*\(#.*\)?$],[],[
42+
\(.*\)],[ -e '\1'])
43+
dnl ^^^^^^^^^^^^^^^^^^^^^^^ Deletes comments and processes sed expressions into -e arguments
44+
)
45+
1346
AC_MSG_RESULT([${newinclpath}])
1447
if test "${newinclpath}" != ""; then
15-
eval "$1=\"\$$1\"' -I${newinclpath}'"
48+
eval "_result_var=\"\$_result_var\"' -I${newinclpath}'"
1649
fi
1750
fi
51+
m4_popdef([_result_var],[_rel_path],[_header_file])
1852
])

ci/test/00_setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build}
6666
# The folder for previous release binaries.
6767
# This folder exists only on the ci guest, and on the ci host as a volume.
6868
export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/prev_releases}
69-
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 e2fsprogs cmake}
69+
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 e2fsprogs cmake icnsutils librsvg2-bin imagemagick}
7070
export GOAL=${GOAL:-install}
7171
export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets}
7272
export CI_RETRY_EXE=${CI_RETRY_EXE:-"retry --"}

ci/test/00_setup_env_i686_centos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8
99
export HOST=i686-pc-linux-gnu
1010
export CONTAINER_NAME=ci_i686_centos
1111
export CI_IMAGE_NAME_TAG="quay.io/centos/amd64:stream9"
12-
export CI_BASE_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python3 python3-pip which patch lbzip2 xz procps-ng dash rsync coreutils bison util-linux e2fsprogs cmake"
12+
export CI_BASE_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python3 python3-pip which patch lbzip2 xz procps-ng dash rsync coreutils bison util-linux e2fsprogs cmake libicns-utils librsvg2-tools ImageMagick"
1313
export PIP_PACKAGES="pyzmq"
1414
export GOAL="install"
1515
export NO_WERROR=1 # Suppress error: #warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform [-Werror=cpp]

ci/test/00_setup_env_mac_cross.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
1111
export CONTAINER_NAME=ci_macos_cross
1212
export CI_IMAGE_NAME_TAG="docker.io/ubuntu:24.04"
1313
export HOST=x86_64-apple-darwin
14-
export PACKAGES="clang lld llvm zip"
14+
export PACKAGES="clang lld llvm zip icnsutils imagemagick librsvg2-bin"
1515
export XCODE_VERSION=15.0
1616
export XCODE_BUILD_ID=15A240d
1717
export RUN_UNIT_TESTS=false

ci/test/03_test_script.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ du -sh "${PREVIOUS_RELEASES_DIR}"
143143
if [[ $HOST = *-mingw32 ]]; then
144144
# Generate all binaries, so that they can be wrapped
145145
make "$MAKEJOBS" -C src/secp256k1 VERBOSE=1
146-
make "$MAKEJOBS" -C src minisketch/test.exe VERBOSE=1
147146
"${BASE_ROOT_DIR}/ci/test/wrap-wine.sh"
148147
fi
149148

configure.ac

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,17 @@ AC_ARG_WITH([daemon],
617617
[build_bitcoind=$withval],
618618
[build_bitcoind=yes])
619619

620+
can_render_icons=yes
621+
AC_PATH_PROGS([RSVG_CONVERT],[rsvg-convert rsvg],no)
622+
AC_PATH_PROGS([IMAGEMAGICK_CONVERT],[magick convert],no)
623+
AC_PATH_PROGS([PNG2ICNS],[png2icns],no)
624+
625+
if test x$RSVG_CONVERT = xno; then
626+
can_render_icons='rsvg-convert'
627+
elif test x$IMAGEMAGICK_CONVERT = xno; then
628+
can_render_icons='ImageMagick'
629+
fi
630+
620631
case $host in
621632
*mingw*)
622633
TARGET_OS=windows
@@ -670,8 +681,15 @@ case $host in
670681
dnl Avoid the use of aligned vector instructions when building for Windows.
671682
dnl See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412.
672683
AX_CHECK_COMPILE_FLAG([-Wa,-muse-unaligned-vector-move], [CORE_CXXFLAGS="$CORE_CXXFLAGS -Wa,-muse-unaligned-vector-move"], [], [$CXXFLAG_WERROR])
684+
685+
AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)
686+
AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [magick convert],convert)
673687
;;
674688
*darwin*)
689+
if test x$PNG2ICNS = xno; then
690+
can_render_icons='png2icns'
691+
fi
692+
675693
TARGET_OS=darwin
676694
if test $cross_compiling != "yes"; then
677695
BUILD_OS=darwin
@@ -1075,6 +1093,68 @@ if test "$have_any_system" != "no"; then
10751093
AC_DEFINE([HAVE_SYSTEM], [1], [Define to 1 if std::system or ::wsystem is available.])
10761094
fi
10771095

1096+
dnl Check for leveldb, only if explicitly requested
1097+
LEVELDB_CPPFLAGS=
1098+
LIBLEVELDB=
1099+
LIBMEMENV=
1100+
AC_ARG_WITH([system-leveldb],
1101+
[AS_HELP_STRING([--with-system-leveldb],
1102+
[Build with system LevelDB (default is no; DANGEROUS; NOT SUPPORTED)])],
1103+
[system_leveldb=$withval],
1104+
[system_leveldb=no]
1105+
)
1106+
if test x$system_leveldb != xno; then
1107+
LEVELDB_CPPFLAGS=
1108+
AC_CHECK_LIB([leveldb],[main],[
1109+
LIBLEVELDB=-lleveldb
1110+
],[
1111+
AC_MSG_ERROR([leveldb library not found; using --with-system-leveldb is not supported anyway])
1112+
])
1113+
AC_CHECK_HEADER([leveldb/filter_policy.h],[],[
1114+
AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway])
1115+
])
1116+
AC_CHECK_HEADER([leveldb/helpers/memenv.h],[
1117+
AC_MSG_CHECKING([for memenv.h path])
1118+
BITCOIN_SUBDIR_TO_INCLUDE([LEVELDB_CPPFLAGS],[leveldb/helpers/],[memenv])
1119+
],[
1120+
AC_CHECK_HEADER([memenv.h],[],[
1121+
AC_MSG_ERROR([LevelDB headers not found; using --with-system-leveldb is not supported anyway])
1122+
])
1123+
])
1124+
1125+
AC_MSG_CHECKING([library containing leveldb::NewMemEnv])
1126+
TEMP_LIBS="$LIBS"
1127+
TEMP_CPPFLAGS="$CPPFLAGS"
1128+
CPPFLAGS="$CPPFLAGS $LEVELDB_CPPFLAGS"
1129+
for searchlib in "" "-lmemenv" ERR; do
1130+
if test "x$searchlib" = "xERR"; then
1131+
AC_MSG_RESULT([no])
1132+
AC_MSG_ERROR([LevelDB's memenv helper not found; using --with-system-leveldb is not supported anyway])
1133+
fi
1134+
searchlib="$searchlib $LIBLEVELDB"
1135+
LIBS="$searchlib $TEMP_LIBS"
1136+
AC_LINK_IFELSE([AC_LANG_SOURCE([
1137+
#include <leveldb/env.h>
1138+
#include <memenv.h>
1139+
1140+
int main() {
1141+
leveldb::Env *myenv = leveldb::NewMemEnv(leveldb::Env::Default());
1142+
delete myenv;
1143+
}
1144+
])],[
1145+
AC_MSG_RESULT([$searchlib])
1146+
LIBMEMENV="$searchlib"
1147+
break
1148+
])
1149+
done
1150+
LIBS="$TEMP_LIBS"
1151+
CPPFLAGS="$TEMP_CPPFLAGS"
1152+
fi
1153+
AM_CONDITIONAL([EMBEDDED_LEVELDB],[test x$system_leveldb = xno])
1154+
AC_SUBST(LEVELDB_CPPFLAGS)
1155+
AC_SUBST(LIBLEVELDB)
1156+
AC_SUBST(LIBMEMENV)
1157+
10781158
dnl SUPPRESSED_CPPFLAGS=SUPPRESS_WARNINGS([$SOME_CPPFLAGS])
10791159
dnl Replace -I with -isystem in $SOME_CPPFLAGS to suppress warnings from
10801160
dnl headers from its include directories and return the result.
@@ -1124,6 +1204,13 @@ else
11241204
fi
11251205
fi
11261206

1207+
AM_CONDITIONAL([CAN_RENDER_ICONS], [test "$can_render_icons" = "yes"])
1208+
if test "$can_render_icons" != "yes"; then
1209+
if test "$bitcoin_enable_qt" != "no" && test ! -f "${srcdir}/src/qt/res/rendered_icons/bitcoin.ico"; then
1210+
AC_MSG_ERROR([Couldn't find ${can_render_icons} (required to build GUI from git)])
1211+
fi
1212+
fi
1213+
11271214
if test "$enable_fuzz_binary" = "yes"; then
11281215
AC_MSG_CHECKING([whether main function is needed for fuzz binary])
11291216
AX_CHECK_LINK_FLAG(

contrib/guix/libexec/build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,9 @@ GIT_ARCHIVE="${DIST_ARCHIVE_BASE}/${DISTNAME}.tar.gz"
196196
# Create the source tarball if not already there
197197
if [ ! -e "$GIT_ARCHIVE" ]; then
198198
mkdir -p "$(dirname "$GIT_ARCHIVE")"
199-
git archive --prefix="${DISTNAME}/" --output="$GIT_ARCHIVE" HEAD
199+
CONFIG_SITE="${BASEPREFIX}/${HOST}/share/config.site" \
200+
REFERENCE_DATETIME="@${SOURCE_DATE_EPOCH}" \
201+
contrib/guix/libexec/make_release_tarball.sh "${GIT_ARCHIVE}" "${DISTNAME}"
200202
fi
201203

202204
mkdir -p "$OUTDIR"
@@ -239,8 +241,6 @@ mkdir -p "$DISTSRC"
239241
# Extract the source tarball
240242
tar --strip-components=1 -xf "${GIT_ARCHIVE}"
241243

242-
./autogen.sh
243-
244244
# Configure this DISTSRC for $HOST
245245
# shellcheck disable=SC2086
246246
env CONFIG_SITE="${BASEPREFIX}/${HOST}/share/config.site" \
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
# Copyright (c) 2020 The Bitcoin Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+
#
6+
# A helper script to generate source release tarball
7+
8+
export LC_ALL=C
9+
set -ex
10+
11+
[ "$#" -ge 2 ]
12+
[ -n "${REFERENCE_DATETIME}" ]
13+
14+
GIT_ARCHIVE="$1"
15+
DISTNAME="$2"
16+
17+
git archive --prefix="${DISTNAME}/" HEAD | tar -xp --exclude '*minisketch*'
18+
19+
# Generate correct build info file from git, before we lose git
20+
GIT_BUILD_INFO="$(share/genbuild.sh /dev/stdout)"
21+
sed 's/\/\/ No build information available/'"${GIT_BUILD_INFO}"'/' -i "${DISTNAME}/share/genbuild.sh"
22+
23+
cd "${DISTNAME}"
24+
25+
./autogen.sh
26+
./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking
27+
make src_files
28+
make distclean
29+
30+
cd ..
31+
tar \
32+
--format=ustar \
33+
--exclude autom4te.cache \
34+
--exclude .deps \
35+
--exclude .git \
36+
--sort=name \
37+
--mode='u+rw,go+r-w,a+X' --owner=0 --group=0 \
38+
--mtime="${REFERENCE_DATETIME}" \
39+
-c "${DISTNAME}" | \
40+
gzip -9n \
41+
>"${GIT_ARCHIVE}"
42+
43+
rm -rf "${DISTNAME}"

0 commit comments

Comments
 (0)