Skip to content

Commit

Permalink
build, qt: Re-sign package with frameworks on M1-base macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed Jul 29, 2021
1 parent bb40b30 commit bbdd588
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions contrib/macdeploy/macdeployqtplus
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

import sys, re, os, shutil, stat, os.path
import sys, re, os, platform, shutil, stat, subprocess, os.path
from argparse import ArgumentParser
from ds_store import DSStore
from mac_alias import Alias
Expand Down Expand Up @@ -288,6 +288,8 @@ def copyFramework(framework: FrameworkInfo, path: str, verbose: int) -> Optional
return toPath

def deployFrameworks(frameworks: List[FrameworkInfo], bundlePath: str, binaryPath: str, strip: bool, verbose: int, deploymentInfo: Optional[DeploymentInfo] = None) -> DeploymentInfo:
global need_to_sign_target

if deploymentInfo is None:
deploymentInfo = DeploymentInfo()

Expand All @@ -304,7 +306,9 @@ def deployFrameworks(frameworks: List[FrameworkInfo], bundlePath: str, binaryPat
if framework.installName.startswith("@executable_path") or framework.installName.startswith(bundlePath):
print(framework.frameworkName, "already deployed, skipping.")
continue


need_to_sign_target = True

# install_name_tool the new id into the binary
changeInstallName(framework.installName, framework.deployedInstallName, binaryPath, verbose)

Expand Down Expand Up @@ -427,6 +431,7 @@ if os.path.exists(appname + ".temp.dmg"):
# ------------------------------------------------

target = os.path.join("dist", "Bitcoin-Qt.app")
need_to_sign_target = False

print("+ Copying source bundle +")
if verbose:
Expand Down Expand Up @@ -541,6 +546,9 @@ ds.close()

# ------------------------------------------------

if need_to_sign_target and platform.system() == "Darwin" and platform.machine() == "arm64":
subprocess.check_call(f"codesign --deep --force --sign - {target}", shell=True)

if config.dmg is not None:

print("+ Preparing .dmg disk image +")
Expand Down

0 comments on commit bbdd588

Please sign in to comment.