Update macOS instructions for installing python, and fix how DMG gets created

This commit is contained in:
Micah Lee 2020-10-29 15:54:12 -07:00
parent 0067f37494
commit ee215a4870
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
4 changed files with 32 additions and 16 deletions

View file

@ -46,7 +46,13 @@ Create a .rpm:
## macOS ## macOS
Download and install Python 3.9.0 from https://www.python.org/downloads/release/python-390/. I downloaded `python-3.9.0-macosx10.9.pkg`. Install python@3.7 (PyInstaller doesn't support newer versions yet) and other dependencies from Homebrew:
```
brew install python@3.7 create-dmg graphicsmagick imagemagick
```
Download and install Python 3.9.0 from https://www.python.org/downloads/release/python-379/. I downloaded `python-3.7.9-macosx10.9.pkg`. (PyInstaller does not support the latest version of Python yet.)
If you don't have it already, install poetry (`pip3 install --user poetry`). Then install dependencies: If you don't have it already, install poetry (`pip3 install --user poetry`). Then install dependencies:
@ -60,19 +66,13 @@ Run from source tree:
poetry run dangerzone poetry run dangerzone
``` ```
To create an app bundle and DMG for distribution, use the `build_app.py` script To create an app bundle, use the `build_app.py` script:
```sh ```sh
poetry run ./install/macos/build_app.py 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: If you want to build for distribution, you'll need a codesigning certificate, and then run:
```sh
brew install create-dmg graphicsmagick imagemagick
```
And then run `build_app.py --with-codesign`:
```sh ```sh
poetry run ./install/macos/build_app.py --with-codesign poetry run ./install/macos/build_app.py --with-codesign

View file

@ -36,17 +36,19 @@ To make a macOS release, go to macOS build machine:
- Verify and checkout the git tag for this release - Verify and checkout the git tag for this release
- Run `poetry install` - Run `poetry install`
- Run `poetry run ./install/macos/build_app.py --with-codesign`; this will make `dist/Dangerzone.dmg` - Run `poetry run ./install/macos/build_app.py --with-codesign`; this will make `dist/Dangerzone.dmg`
- Notarize it: `xcrun altool --notarize-app --primary-bundle-id "media.firstlook.dangerzone" -u "micah@firstlook.org" -p "@keychain:dangerzone-notarize" --file dist/Dangerzone $VERSION.dmg` - Notarize it: `xcrun altool --notarize-app --primary-bundle-id "media.firstlook.dangerzone" -u "micah@firstlook.org" -p "@keychain:dangerzone-notarize" --file dist/Dangerzone.dmg`
- Wait for it to get approved, check status with: `xcrun altool --notarization-history 0 -u "micah@firstlook.org" -p "@keychain:dangerzone-notarize"` - Wait for it to get approved, check status with: `xcrun altool --notarization-history 0 -u "micah@firstlook.org" -p "@keychain:dangerzone-notarize"`
- (If it gets rejected, you can see why with: `xcrun altool --notarization-info [RequestUUID] -u "micah@firstlook.org" -p "@keychain:dangerzone-notarize"`) - (If it gets rejected, you can see why with: `xcrun altool --notarization-info [RequestUUID] -u "micah@firstlook.org" -p "@keychain:dangerzone-notarize"`)
- After it's approved, staple the ticket: `xcrun stapler staple dist/Dangerzone $VERSION.dmg` - After it's approved, staple the ticket: `xcrun stapler staple dist/Dangerzone.dmg`
This process ends up with the final file: This process ends up with the final file:
``` ```
dist/Dangerzone $VERSION.dmg dist/Dangerzone.dmg
``` ```
Rename `Dangerzone.dmg` to `Dangerzone $VERSION.dmg`.
## Windows release ## Windows release
To make a Windows release, go to the Windows build machine: To make a Windows release, go to the Windows build machine:

View file

@ -33,6 +33,7 @@ def main():
dist_path = os.path.join(root, "dist") dist_path = os.path.join(root, "dist")
app_path = os.path.join(dist_path, "Dangerzone.app") app_path = os.path.join(dist_path, "Dangerzone.app")
dmg_path = os.path.join(dist_path, "Dangerzone.dmg") dmg_path = os.path.join(dist_path, "Dangerzone.dmg")
icon_path = os.path.join(root, "install", "macos", "dangerzone.icns")
print("○ Deleting old build and dist") print("○ Deleting old build and dist")
if os.path.exists(build_path): if os.path.exists(build_path):
@ -77,7 +78,20 @@ def main():
return return
print("○ Creating DMG") print("○ Creating DMG")
run(["create-dmg", dmg_path, app_path, "--identity", identity_name_application]) run([
"create-dmg",
"--volname", "Dangerzone",
"--volicon", icon_path,
"--window-size", "400", "200",
"--icon-size", "100",
"--icon", "Dangerzone.app", "100", "70",
"--hide-extension", "Dangerzone.app",
"--app-drop-link", "300", "70",
dmg_path,
app_path,
"--identity",
identity_name_application
])
print(f"○ Finished building DMG: {dmg_path}") print(f"○ Finished building DMG: {dmg_path}")

6
poetry.lock generated
View file

@ -76,7 +76,7 @@ hook_testing = ["pytest (>=2.7.3)", "execnet (>=1.5.0)", "psutil"]
[[package]] [[package]]
name = "pyinstaller-hooks-contrib" name = "pyinstaller-hooks-contrib"
version = "2020.9" version = "2020.10"
description = "Community maintained hooks for PyInstaller" description = "Community maintained hooks for PyInstaller"
category = "dev" category = "dev"
optional = false optional = false
@ -267,8 +267,8 @@ pyinstaller = [
{file = "pyinstaller-4.0.tar.gz", hash = "sha256:970beb07115761d5e4ec317c1351b712fd90ae7f23994db914c633281f99bab0"}, {file = "pyinstaller-4.0.tar.gz", hash = "sha256:970beb07115761d5e4ec317c1351b712fd90ae7f23994db914c633281f99bab0"},
] ]
pyinstaller-hooks-contrib = [ pyinstaller-hooks-contrib = [
{file = "pyinstaller-hooks-contrib-2020.9.tar.gz", hash = "sha256:a5fd45a920012802e3f2089e1d3501ef2f49265dfea8fc46c3310f18e3326c91"}, {file = "pyinstaller-hooks-contrib-2020.10.tar.gz", hash = "sha256:bf4543a16c9c6e9dd2d70ea3fee78b81d3357a68f706df471d990213892259d9"},
{file = "pyinstaller_hooks_contrib-2020.9-py2.py3-none-any.whl", hash = "sha256:c382f3ac1a42b45cfecd581475c36db77da90e479b2f5bcb6d840d21fa545114"}, {file = "pyinstaller_hooks_contrib-2020.10-py2.py3-none-any.whl", hash = "sha256:dd752c88c1c7bb6920f7de248c12d4411c0463877e5e64afdc4f7e93dff9fc94"},
] ]
pyobjc-core = [ pyobjc-core = [
{file = "pyobjc-core-6.2.2.tar.gz", hash = "sha256:38e7b15a042439dadd18b28b78229e52fb882460fc16ddbae342b9972d5a827c"}, {file = "pyobjc-core-6.2.2.tar.gz", hash = "sha256:38e7b15a042439dadd18b28b78229e52fb882460fc16ddbae342b9972d5a827c"},