Skip to content

Commit 3e5dd94

Browse files
committed
Merge bitcoin/bitcoin#23909: build: use a static .tiff for macOS .dmg rather than generating
e09773d build: use a static .tiff for macOS .dmg over generating (fanquake) Pull request description: For demonstration, after [discussion in #23778](bitcoin/bitcoin#23778 (comment)), and the question as to why we can't just have a `background.tiff` that we copy into the macOS DMG, and do away with the somewhat convoluted image generation steps. From my understanding, the only reason we have this image generation as part of our build system is so that forks of Core can adapt the imagery for their own branding via `PACKAGE_NAME`. It don't think it provides much value to us, and could just have a static .tiff that we copy into the dmg (replacing the .svg that currently lives in macdeploy/). Doing this would eliminate the following build dependencies: For native macOS: * `sed` (usage in Makefile.am) * `librsvg` (rsvg-convert) * `tiffutil` Linux macOS cross-compile: * `sed` (usage in Makefille.am) * `librsvg` * `tiffcp` * `convert` (imagemagick) * `font-tuffy` Guix Build: ```bash bash-5.1# find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum c98d67796863f4b1bab0ad600d46bd74e744d94072cbd4bc856a6aeaba3bb329 guix-build-e09773d20a92/output/dist-archive/bitcoin-e09773d20a92.tar.gz 3336f90bab312798cb7665e2b4ae24d1a270fb240647d5fed8dbfcd83e3ed37e guix-build-e09773d20a92/output/x86_64-apple-darwin/SHA256SUMS.part 8fd680c7ee158c64bad212385df7b0b302c6c2143d4e672b4b0eb5da41f9256d guix-build-e09773d20a92/output/x86_64-apple-darwin/bitcoin-e09773d20a92-osx-unsigned.dmg 34f54177c2f0700e8cfaf5d85d91e404807cd9d411e22006cdff82653e5f4af2 guix-build-e09773d20a92/output/x86_64-apple-darwin/bitcoin-e09773d20a92-osx-unsigned.tar.gz da6b8f54ef755d40330c8eac4f5bd0329637e827be9ee61318600d5d0bdcc3dc guix-build-e09773d20a92/output/x86_64-apple-darwin/bitcoin-e09773d20a92-osx64.tar.gz ``` ![dmg](https://user-images.githubusercontent.com/863730/147847717-8121c2d2-cdd4-4781-8397-3bf2893d52cc.png) ACKs for top commit: hebasto: ACK e09773d jarolrod: ACK e09773d Zero-1729: ACK e09773d Tree-SHA512: 0ad06699a5451daa8cfaaa46759eb7bd85254a72e23f857f70d433a2ffb1a4bf6dd464d9c4ac9f8c20aab045f4e2b61c6dcdcbcceef96ce515b1a0c501665b1f
2 parents 1aabbf3 + e09773d commit 3e5dd94

File tree

11 files changed

+11
-90
lines changed

11 files changed

+11
-90
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ Makefile
9696
!depends/Makefile
9797
src/qt/bitcoin-qt
9898
Bitcoin-Qt.app
99-
background.tiff*
10099

101100
# Qt Creator
102101
Makefile.am.user
@@ -149,6 +148,5 @@ db4/
149148

150149
osx_volname
151150
dist/
152-
*.background.tiff
153151

154152
/guix-build-*

Makefile.am

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ OSX_APP=Bitcoin-Qt.app
3838
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
3939
OSX_DMG = $(OSX_VOLNAME).dmg
4040
OSX_TEMP_ISO = $(OSX_DMG:.dmg=).temp.iso
41-
OSX_BACKGROUND_SVG=background.svg
42-
OSX_BACKGROUND_IMAGE=background.tiff
43-
OSX_BACKGROUND_IMAGE_DPIS=36 72
41+
OSX_BACKGROUND_IMAGE=$(top_srcdir)/contrib/macdeploy/background.tiff
4442
OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
4543
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
4644
OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
@@ -66,7 +64,6 @@ WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
6664
$(top_srcdir)/doc/README_windows.txt
6765

6866
OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \
69-
$(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \
7067
$(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
7168
$(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
7269

@@ -127,20 +124,13 @@ osx_volname:
127124
echo $(OSX_VOLNAME) >$@
128125

129126
if BUILD_DARWIN
130-
$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE)
127+
$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
131128
$(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) -dmg
132129

133-
$(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
134-
sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@
135-
$(OSX_BACKGROUND_IMAGE)@2x.png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
136-
sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 72 -p 72 -o $@
137-
$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE).png $(OSX_BACKGROUND_IMAGE)@2x.png
138-
tiffutil -cathidpicheck $^ -out $@
139-
140130
deploydir: $(OSX_DMG)
141131
else !BUILD_DARWIN
142132
APP_DIST_DIR=$(top_builddir)/dist
143-
APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
133+
APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/background.tiff $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
144134

145135
$(APP_DIST_DIR)/Applications:
146136
@rm -f $@
@@ -154,12 +144,9 @@ $(OSX_TEMP_ISO): $(APP_DIST_EXTRAS)
154144
$(OSX_DMG): $(OSX_TEMP_ISO)
155145
$(DMG) dmg "$<" "$@"
156146

157-
dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
158-
sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
159-
OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
160-
$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
147+
$(APP_DIST_DIR)/.background/background.tiff:
161148
$(MKDIR_P) $(@D)
162-
$(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@
149+
cp $(OSX_BACKGROUND_IMAGE) $@
163150

164151
$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
165152
INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR)
@@ -363,7 +350,7 @@ clean-docs:
363350
clean-local: clean-docs
364351
rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ fuzz.coverage/ test/tmp/ cache/ $(OSX_APP)
365352
rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache share/rpcauth/__pycache__
366-
rm -rf osx_volname dist/ dpi36.background.tiff dpi72.background.tiff
353+
rm -rf osx_volname dist/
367354

368355
test-security-check:
369356
if TARGET_DARWIN

ci/test/00_setup_env_mac.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 CONTAINER_NAME=ci_macos_cross
1010
export DOCKER_NAME_TAG=ubuntu:20.04 # Check that Focal can cross-compile to macos
1111
export HOST=x86_64-apple-darwin
12-
export PACKAGES="cmake imagemagick librsvg2-bin libz-dev libtiff-tools libtinfo5 python3-setuptools xorriso"
12+
export PACKAGES="cmake libz-dev libtinfo5 python3-setuptools xorriso"
1313
export XCODE_VERSION=12.1
1414
export XCODE_BUILD_ID=12A7403
1515
export RUN_UNIT_TESTS=false

configure.ac

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,6 @@ case $host in
684684
TARGET_OS=darwin
685685
if test $cross_compiling != "yes"; then
686686
BUILD_OS=darwin
687-
AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg], [rsvg-convert])
688687
AC_CHECK_PROG([BREW], [brew], [brew])
689688
if test "$BREW" = "brew"; then
690689
dnl These Homebrew packages may be keg-only, meaning that they won't be found
@@ -746,9 +745,6 @@ case $host in
746745
AC_PATH_TOOL([OTOOL], [otool], [otool])
747746
AC_PATH_PROGS([XORRISOFS], [xorrisofs], [xorrisofs])
748747
AC_PATH_PROGS([DMG], [dmg], [dmg])
749-
AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg], [rsvg-convert])
750-
AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert], [convert])
751-
AC_PATH_PROGS([TIFFCP], [tiffcp], [tiffcp])
752748

753749
dnl libtool will try to strip the static lib, which is a problem for
754750
dnl cross-builds because strip attempts to call a hard-coded ld,
@@ -1865,6 +1861,7 @@ AC_CONFIG_LINKS([contrib/devtools/symbol-check.py:contrib/devtools/symbol-check.
18651861
AC_CONFIG_LINKS([contrib/devtools/test-security-check.py:contrib/devtools/test-security-check.py])
18661862
AC_CONFIG_LINKS([contrib/devtools/test-symbol-check.py:contrib/devtools/test-symbol-check.py])
18671863
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
1864+
AC_CONFIG_LINKS([contrib/macdeploy/background.tiff:contrib/macdeploy/background.tiff])
18681865
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
18691866
AC_CONFIG_LINKS([test/fuzz/test_runner.py:test/fuzz/test_runner.py])
18701867
AC_CONFIG_LINKS([test/util/test_runner.py:test/util/test_runner.py])

contrib/guix/manifest.scm

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
(gnu packages gcc)
1818
(gnu packages gnome)
1919
(gnu packages image)
20-
(gnu packages imagemagick)
2120
(gnu packages installers)
2221
(gnu packages linux)
2322
(gnu packages llvm)
@@ -202,25 +201,6 @@ chain for " target " development."))
202201
(package-with-extra-patches base-nsis
203202
(search-our-patches "nsis-SConstruct-sde-support.patch")))
204203

205-
(define-public font-tuffy
206-
(package
207-
(name "font-tuffy")
208-
(version "20120614")
209-
(source
210-
(origin
211-
(method url-fetch)
212-
(uri (string-append "http://tulrich.com/fonts/tuffy-" version ".tar.gz"))
213-
(file-name (string-append name "-" version ".tar.gz"))
214-
(sha256
215-
(base32
216-
"02vf72bgrp30vrbfhxjw82s115z27dwfgnmmzfb0n9wfhxxfpyf6"))))
217-
(build-system font-build-system)
218-
(home-page "http://tulrich.com/fonts/")
219-
(synopsis "The Tuffy Truetype Font Family")
220-
(description
221-
"Thatcher Ulrich's first outline font design. He started with the goal of producing a neutral, readable sans-serif text font. There are lots of \"expressive\" fonts out there, but he wanted to start with something very plain and clean, something he might want to actually use. ")
222-
(license license:public-domain)))
223-
224204
(define-public lief
225205
(package
226206
(name "python-lief")
@@ -653,5 +633,5 @@ inspecting signatures in Mach-O binaries.")
653633
(else
654634
(make-bitcoin-cross-toolchain target)))))
655635
((string-contains target "darwin")
656-
(list clang-toolchain-10 binutils imagemagick libtiff librsvg font-tuffy cmake xorriso python-signapple))
636+
(list clang-toolchain-10 binutils cmake xorriso python-signapple))
657637
(else '())))))

contrib/macdeploy/background.svg

Lines changed: 0 additions & 34 deletions
This file was deleted.

contrib/macdeploy/background.tiff

18 KB
Binary file not shown.

contrib/macdeploy/macdeployqtplus

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ if config.dmg is not None:
575575
os.mkdir(os.path.dirname(bg_path))
576576
if verbose:
577577
print('background.tiff', "->", bg_path)
578-
shutil.copy2('background.tiff', bg_path)
578+
shutil.copy2('contrib/macdeploy/background.tiff', bg_path)
579579

580580
os.symlink("/Applications", os.path.join(disk_root, "Applications"))
581581

depends/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The paths are automatically configured and no other options are needed unless ta
4646

4747
#### For macOS cross compilation
4848

49-
sudo apt-get install curl librsvg2-bin libtiff-tools bsdmainutils cmake imagemagick libz-dev python3-setuptools libtinfo5 xorriso
49+
sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools libtinfo5 xorriso
5050

5151
Note: You must obtain the macOS SDK before proceeding with a cross-compile.
5252
Under the depends directory, create a subdirectory named `SDKs`.

doc/build-osx.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ The following dependencies are **optional** packages required for deploying:
3535

3636
Library | Purpose | Description
3737
----------------------------------------------------|------------------|----------------------
38-
[librsvg](https://formulae.brew.sh/formula/librsvg) | Deploy Dependency| Library to render SVG files
3938
[ds_store](https://pypi.org/project/ds-store/) | Deploy Dependency| Examine and modify .DS_Store files
4039
[mac_alias](https://pypi.org/project/mac-alias/) | Deploy Dependency| Generate/Read binary alias and bookmark records
4140

@@ -218,10 +217,6 @@ This command depends on a couple of python packages, so it is required that you
218217

219218
Ensuring that `python` is installed, you can install the deploy dependencies by running the following commands in your terminal:
220219

221-
``` bash
222-
brew install librsvg
223-
```
224-
225220
``` bash
226221
pip3 install ds_store mac_alias
227222
```

0 commit comments

Comments
 (0)