Skip to content

Commit

Permalink
Package Python for macOS (#5)
Browse files Browse the repository at this point in the history
* Package Python for macOS

* Update README.md
  • Loading branch information
smashedr authored Jun 4, 2024
1 parent 5702e4b commit 4368714
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ jobs:
- name: "Build"
run: |
python -m pip install pyinstaller
pyinstaller --noconfirm client.spec
python manifest.py
bash install-mac.sh
Expand Down
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Download and run the installer for your operating system from the latest

### Windows

Note: FFmpeg must be placed in `dist/ffmpeg.exe`

Build the App:
```shell
python -m pip install pyinstaller
Expand All @@ -50,6 +52,8 @@ iscc.exe install-win.iss

### Linux

Note: FFmpeg must be placed in `dist/ffmpeg`

```shell
python manifest.py
bash install-linux.sh
Expand All @@ -61,19 +65,27 @@ bash install-linux.sh
> The macOS installer uses [Packages](http://s.sudre.free.fr/Software/Packages/about.html)
> which must be manually installed.
Build the App:
```shell
python -m pip install pyinstaller
pyinstaller --noconfirm client.spec
python manifest.py
```

Create the Package:
```shell
bash install-mac.sh
```

## More Info

> [!NOTE]
> This information is for Linux/macOS. Windows uses a different approach with registry and packaged python.
Windows requires corresponding registry entries for the manifest files (see location links below).

Windows and macOS requires packaging the app with `pyinstaller` to bundle python.

Manifest files must be renamed to: `org.cssnr.hls.downloader.json`
Manifest files must be renamed to `org.cssnr.hls.downloader.json` on Linux and macOS.

Manifest key `path` must be set to the absolute path to the `client.py` location.
Manifest key `path` must be set to the absolute path to the `client` location.

Manifest files must be placed in specific directories:

Expand Down
18 changes: 17 additions & 1 deletion client.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,23 @@
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>src/client.py</string>
<string>dist/client/_internal</string>
<key>PATH_TYPE</key>
<integer>1</integer>
<key>PERMISSIONS</key>
<integer>493</integer>
<key>TYPE</key>
<integer>3</integer>
<key>UID</key>
<integer>0</integer>
</dict>
<dict>
<key>CHILDREN</key>
<array/>
<key>GID</key>
<integer>0</integer>
<key>PATH</key>
<string>dist/client/client</string>
<key>PATH_TYPE</key>
<integer>1</integer>
<key>PERMISSIONS</key>
Expand Down
2 changes: 1 addition & 1 deletion manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
elif system == 'Linux':
client_path = f'/opt/{data["name"]}/client.py'
elif system == 'Darwin':
client_path = f'/opt/{data["name"]}/client.py'
client_path = f'/opt/{data["name"]}/client'
else:
raise ValueError(f'Unsupported System: {system}')

Expand Down

0 comments on commit 4368714

Please sign in to comment.