Fix macOS build script, and install create-dmg from homebrew instead of npm

This commit is contained in:
Micah Lee 2020-10-29 14:16:04 -07:00
parent 26ea568080
commit 0067f37494
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
2 changed files with 4 additions and 7 deletions

View file

@ -69,8 +69,7 @@ poetry run ./install/macos/build_app.py
If you want to build for distribution, you'll need a codesigning certificate, and you'll also need to have [create-dmg](https://github.com/sindresorhus/create-dmg) installed:
```sh
npm install --global create-dmg
brew install graphicsmagick imagemagick
brew install create-dmg graphicsmagick imagemagick
```
And then run `build_app.py --with-codesign`:

8
install/macos/build_app.py Executable file → Normal file
View file

@ -32,6 +32,7 @@ def main():
build_path = os.path.join(root, "build")
dist_path = os.path.join(root, "dist")
app_path = os.path.join(dist_path, "Dangerzone.app")
dmg_path = os.path.join(dist_path, "Dangerzone.dmg")
print("○ Deleting old build and dist")
if os.path.exists(build_path):
@ -76,12 +77,9 @@ def main():
return
print("○ Creating DMG")
run(["create-dmg", app_path, "--identity", identity_name_application])
dmg_filename = glob.glob(f"{root}/*.dmg")[0]
shutil.move(dmg_filename, dist_path)
dmg_filename = glob.glob(f"{dist_path}/*.dmg")[0]
run(["create-dmg", dmg_path, app_path, "--identity", identity_name_application])
print(f"○ Finished building DMG: {dmg_filename}")
print(f"○ Finished building DMG: {dmg_path}")
else:
print("○ Skipping code signing")