mirror of
https://github.com/TangentFoxy/love-release.git
synced 2025-07-28 02:52:20 +00:00
Add Mac OS X module
This commit is contained in:
@@ -66,17 +66,18 @@ the script will use it to set the game icon on Windows.
|
||||
|
||||
`-r` Set the release directory. By default, a subdirectory called releases is created.
|
||||
|
||||
`-u` Set the company name. Provide it for MacOS CFBundleIdentifier.
|
||||
|
||||
`-v` Love version. Default is 0.9.1.
|
||||
Starting with Love 0.8.0, a release is specially available for Windows x64.
|
||||
Starting with Love 0.9.0, Love no longer supports old x86 Macintosh.
|
||||
|
||||
#### MAC OS X
|
||||
`--maintainer-name` Set the maintainer’s name. Provide it for OS X CFBundleIdentifier.
|
||||
|
||||
#### DEBIAN
|
||||
`--description` Set the description of your project.
|
||||
`--homepage` Set the homepage of your project.
|
||||
`--maintainer-email` Set the maintainer’s email.
|
||||
`--maintainer-name` Set the maintainer’s name. The company name is used by default.
|
||||
`--maintainer-name` Set the maintainer’s name.
|
||||
`--package-name` Set the name of the package and the command that will be used to launch your game.
|
||||
By default, it is the name of your project converted to lowercase,
|
||||
with eventual spaces replaced by dashes.
|
||||
@@ -88,7 +89,7 @@ with eventual underscores (i.e. [a-zA-Z0-9\_]), otherwise you'll get errors.
|
||||
`--activity` The name of the class that extends GameActivity.
|
||||
By default it is the name of the project with ‘Activity’ appended,
|
||||
eventual spaces and dashes replaced by underscores.
|
||||
`--maintainer-name` Set the maintainer’s name. The company name is used by default.
|
||||
`--maintainer-name` Set the maintainer’s name.
|
||||
It must be only alphanumerical characters, with eventual underscores.
|
||||
`--package-name` Set the name of the package.
|
||||
By default, it is the name of your project, with eventual spaces replaced by underscores.
|
||||
|
@@ -76,13 +76,14 @@ Set the projects name. By default, the name of the current directory is used.
|
||||
.B \-r \fIrelease-dir\fR
|
||||
Set the release directory. By default, a subdirectory called releases is created.
|
||||
.TP
|
||||
.B \-u \fIcompany\fR
|
||||
Set the company name. Provide it for MacOS CFBundleIdentifier.
|
||||
.TP
|
||||
.B \-v \fIversion\fR
|
||||
Love version. Default is 0.9.1.
|
||||
Starting with Love 0.8.0, a release is specially available for Windows x64.
|
||||
Starting with Love 0.9.0, Love no longer supports old x86 Macintosh.
|
||||
.SH MAC OS X
|
||||
.TP
|
||||
.B \-\-maintainer\-name \fIname\fR
|
||||
Set the maintainer's name. Provide it for OS X CFBundleIdentifier.
|
||||
.SH DEBIAN
|
||||
.TP
|
||||
.B \-\-description \fIdescription\fR
|
||||
@@ -95,7 +96,7 @@ Set the homepage of your project.
|
||||
Set the maintainer's email.
|
||||
.TP
|
||||
.B \-\-maintainer\-name \fIname\fR
|
||||
Set the maintainer's name. The company name is used by default.
|
||||
Set the maintainer's name.
|
||||
.TP
|
||||
.B \-\-package-name \fIname\fR
|
||||
Set the name of the package and the command that will be use to launch your game.
|
||||
@@ -114,7 +115,7 @@ By default it is the name of the project with 'Activity' appended,
|
||||
eventual spaces and dashes replaced by underscores.
|
||||
.TP
|
||||
.B \-\-maintainer\-name \fIname\fR
|
||||
Set the maintainer’s name. The company name is used by default.
|
||||
Set the maintainer’s name.
|
||||
It must be only alphanumerical characters, with eventual underscores.
|
||||
.TP
|
||||
.B \-\-package\-name \fIname\fR
|
||||
|
@@ -14,7 +14,7 @@ LOVE_VERSION=0.9.1
|
||||
## - a colon ":" if it requires an argument
|
||||
|
||||
## SCRIPT_ARGS="a; osname:"
|
||||
SCRIPT_ARGS="l; d; g; w."
|
||||
SCRIPT_ARGS="l; d; g; m; w."
|
||||
|
||||
## Windows
|
||||
SCRIPT_ARGS="icon: $SCRIPT_ARGS"
|
||||
@@ -22,6 +22,8 @@ SCRIPT_ARGS="icon: $SCRIPT_ARGS"
|
||||
SCRIPT_ARGS="package-version: maintainer-name: maintainer-email: homepage: description: package-name: $SCRIPT_ARGS"
|
||||
## Android
|
||||
SCRIPT_ARGS="activity: package-version: maintainer-name: package-name: update-android; $SCRIPT_ARGS"
|
||||
## Mac OS X
|
||||
SCRIPT_ARGS="icon: maintainer-name: $SCRIPT_ARGS"
|
||||
|
||||
|
||||
## Add a short summary of your platform script here
|
||||
@@ -30,6 +32,7 @@ SCRIPT_ARGS="activity: package-version: maintainer-name: package-name: update-an
|
||||
SHORT_HELP=" -l Create a plain Love file
|
||||
-d Create a Debian package
|
||||
-g Create an Android package
|
||||
-m Create a Mac OS X application
|
||||
-w, Create a Windows application
|
||||
-w32 Create a Windows x86 application
|
||||
-w64 Create a Windows x64 application"
|
||||
@@ -196,6 +199,8 @@ do
|
||||
source "$PLATFORMS_DIR"/debian.sh
|
||||
elif [ "$OPTOPT" = "g" ]; then
|
||||
source "$PLATFORMS_DIR"/android.sh
|
||||
elif [ "$OPTOPT" = "m" ]; then
|
||||
source "$PLATFORMS_DIR"/macosx.sh
|
||||
elif [ "$OPTOPT" = "w" ]; then
|
||||
if [ "$OPTARG" = "32" ]; then
|
||||
RELEASE_WIN_32=true
|
||||
|
141
scripts/macosx.sh
Normal file
141
scripts/macosx.sh
Normal file
@@ -0,0 +1,141 @@
|
||||
# Mac OS X
|
||||
init_module "Mac OS X"
|
||||
|
||||
|
||||
# Options
|
||||
while getoptex "$SCRIPT_ARGS" "$@"
|
||||
do
|
||||
if [ "$OPTOPT" = "icon" ]; then
|
||||
PROJECT_ICNS=$OPTARG
|
||||
elif [ "$OPTOPT" = "maintainer-name" ]; then
|
||||
MAINTAINER_NAME=$OPTARG
|
||||
fi
|
||||
done
|
||||
EXCLUDE_FILES="$EXCLUDE_FILES $PROJECT_ICNS"
|
||||
PACKAGE_NAME=$(echo $PROJECT_NAME | sed -e 's/[^-a-zA-Z0-9_]/-/g')
|
||||
|
||||
|
||||
create_love_file
|
||||
|
||||
|
||||
# Info.plist
|
||||
## TODO: Remove this and replace it by parsing the file instead of overwriting
|
||||
INFO_PLIST="<?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>BuildMachineOSBuild</key>
|
||||
<string>13D65</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>LoveDocument.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>LÖVE Project</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Owner</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>org.love2d.love-game</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>Folder</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>fold</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>None</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>love</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>${PROJECT_ICNS##/*/}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.$MAINTAINER_NAME.$PACKAGE_NAME</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$PROJECT_NAME</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$LOVE_VERSION</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>LoVe</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>5B1008</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>GM</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>13C64</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx10.9</string>
|
||||
<key>DTXcode</key>
|
||||
<string>0511</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>5B1008</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.games</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>© 2006-2014 LÖVE Development Team</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>"
|
||||
|
||||
|
||||
## MacOS 64-bits ##
|
||||
if [ "$LOVE_GT_090" = true ]; then
|
||||
if [ -f "$CACHE_DIR/love-$LOVE_VERSION-macosx-x64.zip" ]; then
|
||||
cp $CACHE_DIR/love-$LOVE_VERSION-macosx-x64.zip ./
|
||||
else
|
||||
curl -L -C - -o $CACHE_DIR/love-$LOVE_VERSION-macosx-x64.zip https://bitbucket.org/rude/love/downloads/love-$LOVE_VERSION-macosx-x64.zip
|
||||
cp $CACHE_DIR/love-$LOVE_VERSION-macosx-x64.zip ./
|
||||
fi
|
||||
unzip -qq love-$LOVE_VERSION-macosx-x64.zip
|
||||
rm -rf "$PROJECT_NAME"-macosx-x64.zip 2> /dev/null
|
||||
mv love.app "$PROJECT_NAME".app
|
||||
cp "$PROJECT_NAME".love "$PROJECT_NAME".app/Contents/Resources
|
||||
cp "$PROJECT_ICNS" "$PROJECT_NAME".app/Contents/Resources 2> /dev/null
|
||||
|
||||
echo "$INFO_PLIST" > "$PROJECT_NAME".app/Contents/Info.plist
|
||||
|
||||
zip -9 -qr "$PROJECT_NAME"-macosx-x64.zip "$PROJECT_NAME".app
|
||||
rm -rf love-$LOVE_VERSION-macosx-x64.zip "$PROJECT_NAME".app __MACOSX
|
||||
|
||||
## MacOS 32-bits ##
|
||||
else
|
||||
if [ -f "$CACHE_DIR/love-$LOVE_VERSION-macosx-ub.zip" ]; then
|
||||
cp $CACHE_DIR/love-$LOVE_VERSION-macosx-ub.zip ./
|
||||
else
|
||||
curl -L -C - -o $CACHE_DIR/love-$LOVE_VERSION-macosx-ub.zip https://bitbucket.org/rude/love/downloads/love-$LOVE_VERSION-macosx-ub.zip
|
||||
cp $CACHE_DIR/love-$LOVE_VERSION-macosx-ub.zip ./
|
||||
fi
|
||||
unzip -qq love-$LOVE_VERSION-macosx-ub.zip
|
||||
rm -rf "$PROJECT_NAME"-macosx-ub.zip 2> /dev/null
|
||||
mv love.app "$PROJECT_NAME".app
|
||||
cp "$PROJECT_NAME".love "$PROJECT_NAME".app/Contents/Resources
|
||||
cp "$PROJECT_ICNS" "$PROJECT_NAME".app/Contents/Resources 2> /dev/null
|
||||
|
||||
echo "$INFO_PLIST" > "$PROJECT_NAME".app/Contents/Info.plist
|
||||
|
||||
zip -9 -qr "$PROJECT_NAME"-macosx-ub.zip "$PROJECT_NAME".app
|
||||
rm -rf love-$LOVE_VERSION-macosx-ub.zip "$PROJECT_NAME".app __MACOSX
|
||||
fi
|
||||
|
||||
remove_love_file
|
||||
exit_module
|
||||
|
Reference in New Issue
Block a user