Skip to content

Commit 696d394

Browse files
committed
Merge bitcoin/bitcoin#24669: build: further consolidate macOS deployment
3d41521 build: perform /Applications symlink generation in macdeployqtplus (fanquake) dac6936 build: perform all .tiff copying in macdeployqtplus (fanquake) Pull request description: Rather than maintaining 2 different versions of the same code (`.tiff` copying and symlink generation), consolidate to just the Python code, and use it on macOS and Linux. Previously Linux would perform the 2 actions in the makefile, and then would still be running the `macdeployqtplus` script, so it makes sense to further consolidate deployment operations into the script. Guix Build (on x86_64): ```bash 23343f04c426c7ff078afae4e600a7028970d4d86eed8b7834696d9e4d684151 guix-build-3d415215699e/output/arm64-apple-darwin/SHA256SUMS.part c28b2a2e4888bf84369aa25804e2576347d5ab09416354ec8b95c76a9d38ff96 guix-build-3d415215699e/output/arm64-apple-darwin/bitcoin-3d415215699e-arm64-apple-darwin-unsigned.dmg 9a57077b2bd722a7d85d26b66cbce5abdb791985fe9d9d37e884c79ba8751e24 guix-build-3d415215699e/output/arm64-apple-darwin/bitcoin-3d415215699e-arm64-apple-darwin-unsigned.tar.gz d2b06dc5b86541798ace41dab569849f7403e7ff9ec329bda671ec84e6fad549 guix-build-3d415215699e/output/arm64-apple-darwin/bitcoin-3d415215699e-arm64-apple-darwin.tar.gz 608e7d51a44ab9c5b28eb3703a0f4fe98b4adff22c77a5502786b84bd96cc188 guix-build-3d415215699e/output/dist-archive/bitcoin-3d415215699e.tar.gz 3e483705b1f9f1fb8f6afedc8ad0214a6cb00e77f766c0b03c42d56f410d4362 guix-build-3d415215699e/output/x86_64-apple-darwin/SHA256SUMS.part 9370e3e3b7d47b5a44e64554cf3b6d7e0671b072c08cd251eacc7ec72ce2b53f guix-build-3d415215699e/output/x86_64-apple-darwin/bitcoin-3d415215699e-x86_64-apple-darwin-unsigned.dmg ad0f68682d78c311497669fc3d627138be37510215d259b5f0b686d93e7d83b7 guix-build-3d415215699e/output/x86_64-apple-darwin/bitcoin-3d415215699e-x86_64-apple-darwin-unsigned.tar.gz e09dce4ff692ef66d1f4818083c1880bcf3a79c53112561d9e929bb6e5ffc011 guix-build-3d415215699e/output/x86_64-apple-darwin/bitcoin-3d415215699e-x86_64-apple-darwin.tar.gz ``` ACKs for top commit: laanwj: Re-ACK 3d41521 Tree-SHA512: 80dd66a6e94c5b3e8823ccb57dcb08a8851a1e70a154b62385443f8d2d5ed5af900a0ac5003143959863586f1c7b90002fe6bff3ca5e37697253e051f69d7629
2 parents c5c4fb3 + 3d41521 commit 696d394

File tree

2 files changed

+18
-27
lines changed

2 files changed

+18
-27
lines changed

Makefile.am

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ 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_IMAGE=$(top_srcdir)/contrib/macdeploy/background.tiff
4241
OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
4342
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
4443
OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
@@ -129,28 +128,17 @@ $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
129128
deploydir: $(OSX_DMG)
130129
else !BUILD_DARWIN
131130
APP_DIST_DIR=$(top_builddir)/dist
132-
APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/background.tiff $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
133131

134-
$(APP_DIST_DIR)/Applications:
135-
@rm -f $@
136-
@cd $(@D); $(LN_S) /Applications $(@F)
137-
138-
$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
139-
140-
$(OSX_TEMP_ISO): $(APP_DIST_EXTRAS)
132+
$(OSX_TEMP_ISO): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
141133
$(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))
142134

143135
$(OSX_DMG): $(OSX_TEMP_ISO)
144136
$(DMG) dmg "$<" "$@"
145137

146-
$(APP_DIST_DIR)/.background/background.tiff:
147-
$(MKDIR_P) $(@D)
148-
cp $(OSX_BACKGROUND_IMAGE) $@
149-
150138
$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
151139
INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR)
152140

153-
deploydir: $(APP_DIST_EXTRAS)
141+
deploydir: $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
154142
endif !BUILD_DARWIN
155143

156144
appbundle: $(OSX_APP_BUILT)

contrib/macdeploy/macdeployqtplus

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,22 @@ ds.close()
544544
if platform.system() == "Darwin":
545545
subprocess.check_call(f"codesign --deep --force --sign - {target}", shell=True)
546546

547+
print("+ Installing background.tiff +")
548+
549+
bg_path = os.path.join('dist', '.background', 'background.tiff')
550+
os.mkdir(os.path.dirname(bg_path))
551+
552+
tiff_path = os.path.join('contrib', 'macdeploy', 'background.tiff')
553+
shutil.copy2(tiff_path, bg_path)
554+
555+
# ------------------------------------------------
556+
557+
print("+ Generating symlink for /Applications +")
558+
559+
os.symlink("/Applications", os.path.join('dist', "Applications"))
560+
561+
# ------------------------------------------------
562+
547563
if config.dmg is not None:
548564

549565
print("+ Preparing .dmg disk image +")
@@ -567,19 +583,6 @@ if config.dmg is not None:
567583
print("Attaching temp image...")
568584
output = run(["hdiutil", "attach", tempname, "-readwrite"], check=True, universal_newlines=True, stdout=PIPE).stdout
569585

570-
m = re.search(r"/Volumes/(.+$)", output)
571-
disk_root = m.group(0)
572-
573-
print("+ Applying fancy settings +")
574-
575-
bg_path = os.path.join(disk_root, ".background", os.path.basename('background.tiff'))
576-
os.mkdir(os.path.dirname(bg_path))
577-
if verbose:
578-
print('background.tiff', "->", bg_path)
579-
shutil.copy2('contrib/macdeploy/background.tiff', bg_path)
580-
581-
os.symlink("/Applications", os.path.join(disk_root, "Applications"))
582-
583586
print("+ Finalizing .dmg disk image +")
584587

585588
run(["hdiutil", "detach", f"/Volumes/{appname}"], universal_newlines=True)

0 commit comments

Comments
 (0)