Add automated macOS compile script and remove unneeded CMakeLists

This commit is contained in:
Vinyl Darkscratch 2017-03-30 17:05:02 -07:00
parent cb77de041b
commit f59bc1d76a
7 changed files with 112 additions and 2 deletions

3
.gitignore vendored
View file

@ -13,12 +13,15 @@ Makefile*
/oneshot
/steamshim_parent/steamshim
__pycache__
/build*
/dist
/debug
/release
object_script.*
rpgscript.bat
xScripts.rxdata
.qmake.stash
CMakeCache.txt

View file

@ -287,7 +287,7 @@ source_group("Embedded Source" FILES ${EMBEDDED_INPUT} ${EMBEDDED_SOURCE})
## Setup binding source ##
if (BINDING STREQUAL "MRI")
set(MRIVERSION "2.1" CACHE STRING "Version of MRI to link with")
set(MRIVERSION "2.3" CACHE STRING "Version of MRI to link with")
pkg_check_modules(MRI REQUIRED ruby-${MRIVERSION})
list(APPEND DEFINES
BINDING_MRI

35
make-oneshot-mac.sh Executable file
View file

@ -0,0 +1,35 @@
#!/bin/sh
mac_version="0.3.1"
# Generate makefile and build main + journal
qmake MRIVERSION=2.3
make -j4
pyinstaller journal/mac/journal.spec --onefile --windowed
# Create app bundles
mv OneShot.app OneShot_new.app
cp -r patches/mac/OneShot_template.app ./OneShot.app
cp OneShot_new.app/Contents/MacOS/OneShot OneShot.app/Contents/Resources/OneShot
cp -r dist/_______.app _______.app
# Set version number
rm OneShot.app/Contents/Info.plist
rm _______.app/Contents/Info.plist
m4 patches/mac/Info.plist.in -DONESHOTMACVERSION=$mac_version > OneShot.app/Contents/Info.plist
m4 patches/mac/JournalInfo.plist.in -DONESHOTMACVERSION=$mac_version > _______.app/Contents/Info.plist
# Compile scripts and install to Steam directory
ruby rpgscript.rb ./scripts ~/Library/Application\ Support/Steam/SteamApps/common/OneShot/
cp ~/Library/Application\ Support/Steam/SteamApps/common/OneShot/Data/xScripts.rxdata .
rm -r ~/Library/Application\ Support/Steam/SteamApps/common/OneShot/OneShot.app
rm -r ~/Library/Application\ Support/Steam/SteamApps/common/OneShot/_______.app
cp -r OneShot.app ~/Library/Application\ Support/Steam/SteamApps/common/OneShot/OneShot.app
cp -r _______.app ~/Library/Application\ Support/Steam/SteamApps/common/OneShot/_______.app
# Cleanup
make clean
rm -r OneShot_new.app
rm -r journal/mac/__pycache__
rm -r build
rm -r dist

36
patches/mac/Info.plist.in Executable file
View file

@ -0,0 +1,36 @@
<?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>CFBundleName</key>
<string>OneShot</string>
<key>CFBundleDisplayName</key>
<string>OneShot</string>
<key>CFBundleGetInfoString</key>
<string>You only have one shot.</string>
<key>CFBundleIdentifier</key>
<string>queengooborg.oneshot-game.osx</string>
<key>CFBundleExecutable</key>
<string>oneshot.sh</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleVersion</key>
<string>macOS Port v.ONESHOTMACVERSION (OneShot Solstice Update)</string>
<key>CFBundleShortVersionString</key>
<string>ONESHOTMACVERSION</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<key>LSBackgroundOnly</key>
<string>0</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017, OneShot team, all rights reserved. View CREDITS.txt for more. Ported for macOS by Vinyl Darkscratch.</string>
<key>NSHighResolutionCapable</key>
<string>False</string>
</dict>
</plist>

View file

@ -0,0 +1,36 @@
<?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>CFBundleDisplayName</key>
<string>_______</string>
<key>CFBundleName</key>
<string>_______</string>
<key>CFBundleIdentifier</key>
<string>queengooborg.oneshot-game.osx-journal</string>
<key>CFBundleExecutable</key>
<string>MacOS/_______</string>
<key>CFBundleIconFile</key>
<string>icon_journal.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>ONESHOTMACVERSION</string>
<key>LSBackgroundOnly</key>
<string>0</string>
<key>CFBundleGetInfoString</key>
<string>You only have one shot.</string>
<key>CFBundleVersion</key>
<string>ONESHOTMACVERSION</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSMinimumSystemVersion</key>
<string>10.7</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2017, OneShot team, all rights reserved. View CREDITS.txt for more. Port for macOS copyright © 2017, hunternet93 and Vinyl Darkscratch, MIT License. https://github.com/hunternet93/OneShot-Journal</string>
<key>NSHighResolutionCapable</key>
<string>True</string>
</dict>
</plist>

View file

@ -0,0 +1 @@
This isn't the best way to make the OneShot.app as the OneShot_template.app is a copy of the .app provided by Steam, with some modifications to Info.plist and the icon. I (Vinyl Darkscratch) am not too familiar with QMake, sadly, and as such I'm not quite sure how to copy all the essential frameworks through the QMake file. If anyone can suggest a better way, please let me know by emailing me at vinyldarkscratch at the Gmail!

View file

@ -1 +0,0 @@
ruby rpgscript.rb ./scripts ~/Library/Application\ Support/Steam/SteamApps/common/OneShot/