Skip to content

Commit

Permalink
trying to debug macos installer creation #3
Browse files Browse the repository at this point in the history
  • Loading branch information
behrisch committed Oct 14, 2024
1 parent 64c0dea commit 38b0af8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
run: |
cd sumo
python3 -m pip install dmgbuild
python3 tools/build_config/buildMacOSInstaller.py ./cmake-build
python3 tools/build_config/buildMacOSInstaller.py ./cmake-build --verbose
- name: Uploading macOS installer dmg
uses: actions/upload-artifact@v4
Expand Down
9 changes: 6 additions & 3 deletions tools/build_config/buildMacOSInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def parse_args(def_dmg_name, def_pkg_name):
op.add_argument("build_dir", help="Build dir of sumo")
op.add_argument("--output-pkg", dest="output_pkg", help="Output path for pkg", default=def_output_pkg_path)
op.add_argument("--output-dmg", dest="output_dmg", help="Output path for dmg", default=def_output_dmg_path)
op.add_option("-v", "--verbose", action="store_true", default=False, help="tell me more")

return op.parse_args()

Expand Down Expand Up @@ -306,7 +307,7 @@ def create_app(app_name, exec_call, framework_name, pkg_id, version, icns_path):
return app_name, pkg_name, pkg_id, pkg_path, pkg_size


def create_installer(frmwk_pkg, app_pkgs, id, version, output_path):
def create_installer(frmwk_pkg, app_pkgs, id, version, output_path, verbose):
cwd = os.path.dirname(os.path.abspath(__file__))
print(" - Creating temporary directory")
temp_dir = tempfile.mkdtemp()
Expand Down Expand Up @@ -380,7 +381,8 @@ def create_installer(frmwk_pkg, app_pkgs, id, version, output_path):
resources_dir,
output_path,
]
subprocess.run(productbuild_command, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
out = None if verbose else subprocess.DEVNULL
subprocess.run(productbuild_command, check=True, stdout=out, stderr=out)
pkg_size = os.path.getsize(output_path)

print(" - Cleaning up")
Expand Down Expand Up @@ -490,7 +492,8 @@ def main():

# Building the installer package
print("Building installer")
installer_pkg = create_installer(framework_pkg, app_pkgs, f"{base_id}.installer", version, opts.output_pkg)
installer_pkg = create_installer(framework_pkg, app_pkgs, f"{base_id}.installer", version,
opts.output_pkg, opts.verbose)
print("Successfully built installer\n")

# Putting the installer package into a dmg file - ready for signing
Expand Down

0 comments on commit 38b0af8

Please sign in to comment.