From f59bc1d76ae094c1462e95ea9b8bc7bc944cff25 Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Thu, 30 Mar 2017 17:05:02 -0700 Subject: [PATCH] Add automated macOS compile script and remove unneeded CMakeLists --- .gitignore | 3 +++ CMakeLists.txt | 2 +- make-oneshot-mac.sh | 35 ++++++++++++++++++++++++ patches/mac/Info.plist.in | 36 +++++++++++++++++++++++++ patches/mac/JournalInfo.plist.in | 36 +++++++++++++++++++++++++ patches/mac/readme-bad_patch_method.txt | 1 + rpgscript.sh | 1 - 7 files changed, 112 insertions(+), 2 deletions(-) create mode 100755 make-oneshot-mac.sh create mode 100755 patches/mac/Info.plist.in create mode 100644 patches/mac/JournalInfo.plist.in create mode 100644 patches/mac/readme-bad_patch_method.txt delete mode 100755 rpgscript.sh diff --git a/.gitignore b/.gitignore index ccc5801..eb6d624 100644 --- a/.gitignore +++ b/.gitignore @@ -13,12 +13,15 @@ Makefile* /oneshot /steamshim_parent/steamshim +__pycache__ /build* +/dist /debug /release object_script.* rpgscript.bat +xScripts.rxdata .qmake.stash CMakeCache.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b68497..9f4ccfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/make-oneshot-mac.sh b/make-oneshot-mac.sh new file mode 100755 index 0000000..2bd9ef2 --- /dev/null +++ b/make-oneshot-mac.sh @@ -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 \ No newline at end of file diff --git a/patches/mac/Info.plist.in b/patches/mac/Info.plist.in new file mode 100755 index 0000000..4fe71cd --- /dev/null +++ b/patches/mac/Info.plist.in @@ -0,0 +1,36 @@ + + + + + CFBundleName + OneShot + CFBundleDisplayName + OneShot + CFBundleGetInfoString + You only have one shot. + CFBundleIdentifier + queengooborg.oneshot-game.osx + CFBundleExecutable + oneshot.sh + CFBundleIconFile + icon.icns + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleVersion + macOS Port v.ONESHOTMACVERSION (OneShot Solstice Update) + CFBundleShortVersionString + ONESHOTMACVERSION + LSApplicationCategoryType + public.app-category.games + LSMinimumSystemVersion + 10.7 + LSBackgroundOnly + 0 + NSHumanReadableCopyright + Copyright © 2017, OneShot team, all rights reserved. View CREDITS.txt for more. Ported for macOS by Vinyl Darkscratch. + NSHighResolutionCapable + False + + diff --git a/patches/mac/JournalInfo.plist.in b/patches/mac/JournalInfo.plist.in new file mode 100644 index 0000000..17f2622 --- /dev/null +++ b/patches/mac/JournalInfo.plist.in @@ -0,0 +1,36 @@ + + + + + CFBundleDisplayName + _______ + CFBundleName + _______ + CFBundleIdentifier + queengooborg.oneshot-game.osx-journal + CFBundleExecutable + MacOS/_______ + CFBundleIconFile + icon_journal.icns + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + APPL + CFBundleShortVersionString + ONESHOTMACVERSION + LSBackgroundOnly + 0 + CFBundleGetInfoString + You only have one shot. + CFBundleVersion + ONESHOTMACVERSION + LSApplicationCategoryType + public.app-category.games + LSMinimumSystemVersion + 10.7 + NSHumanReadableCopyright + 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 + NSHighResolutionCapable + True + + \ No newline at end of file diff --git a/patches/mac/readme-bad_patch_method.txt b/patches/mac/readme-bad_patch_method.txt new file mode 100644 index 0000000..804d492 --- /dev/null +++ b/patches/mac/readme-bad_patch_method.txt @@ -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! \ No newline at end of file diff --git a/rpgscript.sh b/rpgscript.sh deleted file mode 100755 index 08773fc..0000000 --- a/rpgscript.sh +++ /dev/null @@ -1 +0,0 @@ -ruby rpgscript.rb ./scripts ~/Library/Application\ Support/Steam/SteamApps/common/OneShot/