Skip to content

Commit 122a61f

Browse files
committed
merge bitcoin#28432: Produce a .zip for macOS distribution
1 parent 407deab commit 122a61f

File tree

18 files changed

+42
-173
lines changed

18 files changed

+42
-173
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ libconftest.dylib*
7575

7676
*.log
7777
*.trs
78-
*.dmg
78+
*.zip
7979

8080
*.json.h
8181
*.raw.h

Makefile.am

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ space := $(empty) $(empty)
3636

3737
OSX_APP=Dash-Qt.app
3838
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
39-
OSX_DMG = $(OSX_VOLNAME).dmg
39+
OSX_ZIP = $(OSX_VOLNAME).zip
4040
OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
4141
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/dash.icns
4242
OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
@@ -119,23 +119,24 @@ OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lp
119119
$(OSX_APP)/Contents/MacOS/Dash-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
120120

121121
if BUILD_DARWIN
122-
$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
123-
$(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) -dmg
122+
$(OSX_ZIP): $(OSX_APP_BUILT) $(OSX_PACKAGING)
123+
$(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) -zip
124124

125-
deploydir: $(OSX_DMG)
125+
deploydir: $(OSX_ZIP)
126126
else !BUILD_DARWIN
127127
APP_DIST_DIR=$(top_builddir)/dist
128128

129-
$(OSX_DMG): deploydir
130-
$(XORRISOFS) -D -l -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -o $@ $(APP_DIST_DIR) -- $(if $(SOURCE_DATE_EPOCH),-volume_date all_file_dates =$(SOURCE_DATE_EPOCH))
129+
$(OSX_ZIP): deploydir
130+
if [ -n "$(SOURCE_DATE_EPOCH)" ]; then find $(APP_DIST_DIR) -exec touch -d @$(SOURCE_DATE_EPOCH) {} +; fi
131+
cd $(APP_DIST_DIR) && find . | sort | $(ZIP) -X@ $@
131132

132133
$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Dash-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
133134
OBJDUMP=$(OBJDUMP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR)
134135

135136
deploydir: $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Dash-Qt
136137
endif !BUILD_DARWIN
137138

138-
deploy: $(OSX_DMG)
139+
deploy: $(OSX_ZIP)
139140
endif
140141

141142
$(BITCOIN_QT_BIN): FORCE
@@ -294,7 +295,7 @@ EXTRA_DIST += \
294295
test/util/data/txcreatesignv2.hex \
295296
test/util/rpcauth-test.py
296297

297-
CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
298+
CLEANFILES = $(OSX_ZIP) $(BITCOIN_WIN_INSTALLER)
298299

299300
DISTCHECK_CONFIGURE_FLAGS = --enable-man
300301

ci/test/00_setup_env_mac.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_macos_cross
1010
export HOST=x86_64-apple-darwin
11-
export PACKAGES="cmake libz-dev python3-setuptools xorriso"
11+
export PACKAGES="cmake libz-dev python3-setuptools zip"
1212
export XCODE_VERSION=15.0
1313
export XCODE_BUILD_ID=15A240d
1414
export RUN_UNIT_TESTS=false

configure.ac

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,7 +843,7 @@ case $host in
843843
;;
844844
*)
845845
AC_PATH_TOOL([DSYMUTIL], [dsymutil], dsymutil)
846-
AC_PATH_PROGS([XORRISOFS], [xorrisofs], xorrisofs)
846+
AC_PATH_PROG([ZIP], [zip], [zip])
847847

848848
dnl libtool will try to strip the static lib, which is a problem for
849849
dnl cross-builds because strip attempts to call a hard-coded ld,
@@ -1934,7 +1934,6 @@ AC_CONFIG_LINKS([contrib/devtools/test-security-check.py:contrib/devtools/test-s
19341934
AC_CONFIG_LINKS([contrib/devtools/symbol-check.py:contrib/devtools/symbol-check.py])
19351935
AC_CONFIG_LINKS([contrib/devtools/test-symbol-check.py:contrib/devtools/test-symbol-check.py])
19361936
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
1937-
AC_CONFIG_LINKS([contrib/macdeploy/background.tiff:contrib/macdeploy/background.tiff])
19381937
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
19391938
AC_CONFIG_LINKS([test/fuzz/test_runner.py:test/fuzz/test_runner.py])
19401939
AC_CONFIG_LINKS([test/util/test_runner.py:test/util/test_runner.py])

contrib/containers/ci/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ RUN apt-get update && apt-get install $APT_ARGS \
159159
valgrind \
160160
wine-stable \
161161
wine64 \
162-
xorriso \
162+
zip \
163163
&& rm -rf /var/lib/apt/lists/*
164164

165165
# This is a hack. It is needed because gcc-multilib and g++-multilib are conflicting with g++-arm-linux-gnueabihf. This is

contrib/guix/libexec/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ mkdir -p "$DISTSRC"
326326
| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" \
327327
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" && exit 1 )
328328
)
329-
make deploy ${V:+V=1} OSX_DMG="${OUTDIR}/${DISTNAME}-${HOST}-unsigned.dmg"
329+
make deploy ${V:+V=1} OSX_ZIP="${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip"
330330
;;
331331
esac
332332
(

contrib/guix/libexec/codesign.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,8 @@ mkdir -p "$DISTSRC"
7878
# Apply detached codesignatures to dist/ (in-place)
7979
signapple apply dist/Dash-Qt.app codesignatures/osx/dist
8080

81-
# Make a DMG from dist/
82-
xorrisofs -D -l -V "$(< osx_volname)" -no-pad -r -dir-mode 0755 \
83-
-o "${OUTDIR}/${DISTNAME}-${HOST}.dmg" \
84-
dist \
85-
-- -volume_date all_file_dates ="$SOURCE_DATE_EPOCH"
81+
# Make a .zip from dist/
82+
zip "${OUTDIR}/${DISTNAME}-${HOST}.zip" dist/*
8683
;;
8784
*)
8885
exit 1

contrib/guix/manifest.scm

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
((gnu packages bash) #:select (bash-minimal))
44
(gnu packages bison)
55
((gnu packages certs) #:select (nss-certs))
6-
((gnu packages cdrom) #:select (xorriso))
76
((gnu packages cmake) #:select (cmake-minimal))
87
(gnu packages commencement)
98
(gnu packages compression)
@@ -611,5 +610,5 @@ inspecting signatures in Mach-O binaries.")
611610
binutils
612611
clang-toolchain-17
613612
python-signapple
614-
xorriso))
613+
zip))
615614
(else '())))))

contrib/macdeploy/README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The `macdeployqtplus` script should not be run manually. Instead, after building
66
make deploy
77
```
88

9-
When complete, it will have produced `Dash-Qt.dmg`.
9+
When complete, it will have produced `Dash-Core.zip`.
1010

1111
## SDK Extraction
1212

@@ -54,10 +54,10 @@ path to `Xcode.app` (extracted in the previous stage) as the first argument.
5454
The generated archive should be: `Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz`.
5555
The `sha256sum` should be `c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d`.
5656

57-
## Deterministic macOS DMG Notes
57+
## Deterministic macOS App Notes
5858

59-
Working macOS DMGs are created in Linux by combining a recent `clang`, the Apple
60-
`binutils` (`ld`, `ar`, etc) and DMG authoring tools.
59+
macOS Applications are created in Linux by combining a recent `clang` and the Apple
60+
`binutils` (`ld`, `ar`, etc).
6161

6262
Apple uses `clang` extensively for development and has upstreamed the necessary
6363
functionality so that a vanilla clang can take advantage. It supports the use of `-F`,
@@ -86,21 +86,16 @@ created using these tools. The build process has been designed to avoid includin
8686
SDK's files in Guix's outputs. All interim tarballs are fully deterministic and may be freely
8787
redistributed.
8888

89-
[`xorrisofs`](https://www.gnu.org/software/xorriso/) is used to create the DMG.
90-
91-
A background image is added to DMG files by inserting a `.DS_Store` during creation.
92-
9389
As of OS X 10.9 Mavericks, using an Apple-blessed key to sign binaries is a requirement in
9490
order to satisfy the new Gatekeeper requirements. Because this private key cannot be
9591
shared, we'll have to be a bit creative in order for the build process to remain somewhat
9692
deterministic. Here's how it works:
9793

98-
- Builders use Guix to create an unsigned release. This outputs an unsigned DMG which
94+
- Builders use Guix to create an unsigned release. This outputs an unsigned ZIP which
9995
users may choose to bless and run. It also outputs an unsigned app structure in the form
100-
of a tarball, which also contains all of the tools that have been previously (deterministically)
101-
built in order to create a final DMG.
96+
of a tarball.
10297
- The Apple keyholder uses this unsigned app to create a detached signature, using the
10398
script that is also included there. Detached signatures are available from this [repository](https://github.com/dashpay/dash-detached-sigs).
10499

105100
- Builders feed the unsigned app + detached signature back into Guix. It uses the
106-
pre-built tools to recombine the pieces into a deterministic DMG.
101+
pre-built tools to recombine the pieces into a deterministic ZIP.

contrib/macdeploy/background.tiff

-18 KB
Binary file not shown.

0 commit comments

Comments
 (0)