Skip to content

Commit 33ae0bd

Browse files
fanquakehebasto
authored andcommitted
macdeploy: remove DMG generation from deploy script
1 parent a128111 commit 33ae0bd

File tree

3 files changed

+4
-102
lines changed

3 files changed

+4
-102
lines changed

configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,6 @@ AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/spl
19371937
AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])])
19381938
AC_CONFIG_LINKS([contrib/devtools/iwyu/bitcoin.core.imp:contrib/devtools/iwyu/bitcoin.core.imp])
19391939
AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
1940-
AC_CONFIG_LINKS([contrib/macdeploy/background.tiff:contrib/macdeploy/background.tiff])
19411940
AC_CONFIG_LINKS([src/.bear-tidy-config:src/.bear-tidy-config])
19421941
AC_CONFIG_LINKS([src/.clang-tidy:src/.clang-tidy])
19431942
AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])

contrib/macdeploy/background.tiff

-18 KB
Binary file not shown.

contrib/macdeploy/macdeployqtplus

Lines changed: 4 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
import sys, re, os, platform, shutil, stat, subprocess, os.path
2020
from argparse import ArgumentParser
21-
from ds_store import DSStore
22-
from mac_alias import Alias
2321
from pathlib import Path
2422
from subprocess import PIPE, run
2523
from typing import List, Optional
@@ -385,7 +383,7 @@ def deployPlugins(appBundleInfo: ApplicationBundleInfo, deploymentInfo: Deployme
385383

386384
ap = ArgumentParser(description="""Improved version of macdeployqt.
387385
388-
Outputs a ready-to-deploy app in a folder "dist" and optionally wraps it in a .dmg file.
386+
Outputs a ready-to-deploy app in a folder "dist" and optionally wraps it in a .zip file.
389387
Note, that the "dist" folder will be deleted before deploying on each run.
390388
391389
Optionally, Qt translation files (.qm) can be added to the bundle.""")
@@ -395,7 +393,6 @@ ap.add_argument("appname", nargs=1, metavar="appname", help="name of the app bei
395393
ap.add_argument("-verbose", nargs="?", const=True, help="Output additional debugging information")
396394
ap.add_argument("-no-plugins", dest="plugins", action="store_false", default=True, help="skip plugin deployment")
397395
ap.add_argument("-no-strip", dest="strip", action="store_false", default=True, help="don't run 'strip' on the binaries")
398-
ap.add_argument("-dmg", nargs="?", const="", metavar="basename", help="create a .dmg disk image")
399396
ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translations. Base translations will automatically be added to the bundle's resources.")
400397
ap.add_argument("-zip", nargs="?", const="", metavar="zip", help="create a .zip containing the app bundle")
401398

@@ -418,12 +415,9 @@ if os.path.exists("dist"):
418415
print("+ Removing existing dist folder +")
419416
shutil.rmtree("dist")
420417

421-
if os.path.exists(appname + ".dmg"):
422-
print("+ Removing existing DMG +")
423-
os.unlink(appname + ".dmg")
424-
425-
if os.path.exists(appname + ".temp.dmg"):
426-
os.unlink(appname + ".temp.dmg")
418+
if os.path.exists(appname + ".zip"):
419+
print("+ Removing existing .zip +")
420+
os.unlink(appname + ".zip")
427421

428422
# ------------------------------------------------
429423

@@ -498,100 +492,9 @@ with open(os.path.join(applicationBundle.resourcesPath, "qt.conf"), "wb") as f:
498492

499493
# ------------------------------------------------
500494

501-
print("+ Generating .DS_Store +")
502-
503-
output_file = os.path.join("dist", ".DS_Store")
504-
505-
ds = DSStore.open(output_file, 'w+')
506-
507-
ds['.']['bwsp'] = {
508-
'WindowBounds': '{{300, 280}, {500, 343}}',
509-
'PreviewPaneVisibility': False,
510-
}
511-
512-
icvp = {
513-
'gridOffsetX': 0.0,
514-
'textSize': 12.0,
515-
'viewOptionsVersion': 1,
516-
'backgroundImageAlias': b'\x00\x00\x00\x00\x02\x1e\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x94\\\xb0H+\x00\x05\x00\x00\x00\x98\x0fbackground.tiff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x99\xd19\xb0\xf8\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\r\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b.background\x00\x00\x10\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x11\x00\x08\x00\x00\xd19\xb0\xf8\x00\x00\x00\x01\x00\x04\x00\x00\x00\x98\x00\x0e\x00 \x00\x0f\x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d\x00.\x00t\x00i\x00f\x00f\x00\x0f\x00\x02\x00\x00\x00\x12\x00\x1c/.background/background.tiff\x00\x14\x01\x06\x00\x00\x00\x00\x01\x06\x00\x02\x00\x00\x0cMacintosh HD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xce\x97\xab\xc3H+\x00\x00\x01\x88[\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02u\xab\x8d\xd1\x94\\\xb0devrddsk\xff\xff\xff\xff\x00\x00\t \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07bitcoin\x00\x00\x10\x00\x08\x00\x00\xce\x97\xab\xc3\x00\x00\x00\x11\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x01\x00\x14\x01\x88[\x88\x00\x16\xa9\t\x00\x08\xfaR\x00\x08\xfaQ\x00\x02d\x8e\x00\x0e\x00\x02\x00\x00\x00\x0f\x00\x1a\x00\x0c\x00M\x00a\x00c\x00i\x00n\x00t\x00o\x00s\x00h\x00 \x00H\x00D\x00\x13\x00\x01/\x00\x00\x15\x00\x02\x00\x14\xff\xff\x00\x00\xff\xff\x00\x00',
517-
'backgroundColorBlue': 1.0,
518-
'iconSize': 96.0,
519-
'backgroundColorGreen': 1.0,
520-
'arrangeBy': 'none',
521-
'showIconPreview': True,
522-
'gridSpacing': 100.0,
523-
'gridOffsetY': 0.0,
524-
'showItemInfo': False,
525-
'labelOnBottom': True,
526-
'backgroundType': 2,
527-
'backgroundColorRed': 1.0
528-
}
529-
alias = Alias().from_bytes(icvp['backgroundImageAlias'])
530-
alias.volume.name = appname
531-
alias.volume.posix_path = '/Volumes/' + appname
532-
icvp['backgroundImageAlias'] = alias.to_bytes()
533-
ds['.']['icvp'] = icvp
534-
535-
ds['.']['vSrn'] = ('long', 1)
536-
537-
ds['Applications']['Iloc'] = (370, 156)
538-
ds['Bitcoin-Qt.app']['Iloc'] = (128, 156)
539-
540-
ds.flush()
541-
ds.close()
542-
543-
# ------------------------------------------------
544-
545495
if platform.system() == "Darwin":
546496
subprocess.check_call(f"codesign --deep --force --sign - {target}", shell=True)
547497

548-
print("+ Installing background.tiff +")
549-
550-
bg_path = os.path.join('dist', '.background', 'background.tiff')
551-
os.mkdir(os.path.dirname(bg_path))
552-
553-
tiff_path = os.path.join('contrib', 'macdeploy', 'background.tiff')
554-
shutil.copy2(tiff_path, bg_path)
555-
556-
# ------------------------------------------------
557-
558-
print("+ Generating symlink for /Applications +")
559-
560-
os.symlink("/Applications", os.path.join('dist', "Applications"))
561-
562-
# ------------------------------------------------
563-
564-
if config.dmg is not None:
565-
566-
print("+ Preparing .dmg disk image +")
567-
568-
if verbose:
569-
print("Determining size of \"dist\"...")
570-
size = 0
571-
for path, dirs, files in os.walk("dist"):
572-
for file in files:
573-
size += os.path.getsize(os.path.join(path, file))
574-
size += int(size * 0.15)
575-
576-
if verbose:
577-
print("Creating temp image for modification...")
578-
579-
tempname: str = appname + ".temp.dmg"
580-
581-
run(["hdiutil", "create", tempname, "-srcfolder", "dist", "-format", "UDRW", "-size", str(size), "-volname", appname], check=True, text=True)
582-
583-
if verbose:
584-
print("Attaching temp image...")
585-
output = run(["hdiutil", "attach", tempname, "-readwrite"], check=True, text=True, stdout=PIPE).stdout
586-
587-
print("+ Finalizing .dmg disk image +")
588-
589-
run(["hdiutil", "detach", f"/Volumes/{appname}"], text=True)
590-
591-
run(["hdiutil", "convert", tempname, "-format", "UDZO", "-o", appname, "-imagekey", "zlib-level=9"], check=True, text=True)
592-
593-
os.unlink(tempname)
594-
595498
# ------------------------------------------------
596499

597500
if config.zip is not None:

0 commit comments

Comments
 (0)