-
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding #587 Distribute a mac app bundle (thanks to Ivan Novokhatski)
- Loading branch information
1 parent
9ac8f7c
commit 910d5f8
Showing
12 changed files
with
104 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleExecutable</key> | ||
<string>FastFlix</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleIconFile</key> | ||
<string>icon.icns</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.github.cdgriffith.FastFlix</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleSignature</key> | ||
<string>PURE</string> | ||
<key>CFBundleVersion</key> | ||
<string>{version}</string> | ||
<key>CFBundleName</key> | ||
<string>FastFlix</string> | ||
<key>CSResourcesFileMapped</key> | ||
<true/> | ||
<key>NSHighResolutionCapable</key> | ||
<true/> | ||
<key>NSDisablePersistence</key> | ||
<true/> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>{mac_version}</string> | ||
</dict> | ||
</plist> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# -*- coding: utf-8 -*- | ||
from pathlib import Path | ||
import sys | ||
import shutil | ||
from subprocess import check_output | ||
|
||
from fastflix.version import __version__ | ||
|
||
here = Path(__file__).parent | ||
plist_template = here.parent / "fastflix" / "data" / "Info.plist.template" | ||
|
||
build_folder = Path(here.parent / "FastFlix.app") | ||
build_folder.mkdir(exist_ok=True) | ||
|
||
content_folder = build_folder / "Contents" | ||
content_folder.mkdir(exist_ok=True) | ||
|
||
macos_folder = content_folder / "MacOS" | ||
macos_folder.mkdir(exist_ok=True) | ||
|
||
resources_folder = content_folder / "Resources" | ||
resources_folder.mkdir(exist_ok=True) | ||
|
||
mac_version = f"{sys.argv[1].split(" - ")[1]}.0" | ||
assert mac_version in ("12.0", "13.0", "14.0", "15.0") | ||
|
||
with open(plist_template) as in_file, open(content_folder / "Info.plist", "w") as out_file: | ||
template = in_file.read().format(version=__version__, mac_version=mac_version) | ||
out_file.write(template) | ||
|
||
shutil.copy(here.parent / "fastflix" / "data" / "icon.icns", resources_folder / "icon.icns") | ||
|
||
shutil.copy(here.parent / "dist" / "FastFlix", macos_folder / "FastFlix") | ||
shutil.copy(here.parent / "LICENSE", macos_folder / "LICENSE") | ||
|
||
check_output(["chmod", "+x", macos_folder / "FastFlix"]) |