mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-20 12:40:21 +02:00
build(mac): use LÖVE 12 Metal runtime
This commit is contained in:
@@ -61,7 +61,7 @@ function love.conf(t)
|
|||||||
t.window.minwidth = 480
|
t.window.minwidth = 480
|
||||||
t.window.minheight = 360
|
t.window.minheight = 360
|
||||||
end
|
end
|
||||||
t.version = love._os == "iOS" and "12.0" or "11.5"
|
t.version = (love._os == "iOS" or love._os == "OS X") and "12.0" or "11.5"
|
||||||
t.window.vsync = 1
|
t.window.vsync = 1
|
||||||
t.modules.audio = not companion
|
t.modules.audio = not companion
|
||||||
t.modules.joystick = not companion
|
t.modules.joystick = not companion
|
||||||
|
|||||||
+19
-7
@@ -28,6 +28,7 @@ ENTITLEMENTS="$ROOT/scripts/macos-entitlements.plist"
|
|||||||
APP_NAME="gen1recomp"
|
APP_NAME="gen1recomp"
|
||||||
BUNDLE_ID="com.theboisclub.pokemonred"
|
BUNDLE_ID="com.theboisclub.pokemonred"
|
||||||
LOVE_VERSION="11.5"
|
LOVE_VERSION="11.5"
|
||||||
|
LOVE_MAC_VERSION="12.0"
|
||||||
VERSION="$(git -C "$ROOT" rev-parse --short HEAD 2>/dev/null || echo dev)"
|
VERSION="$(git -C "$ROOT" rev-parse --short HEAD 2>/dev/null || echo dev)"
|
||||||
VERSION_EXPLICIT=false
|
VERSION_EXPLICIT=false
|
||||||
IDENTITY=""
|
IDENTITY=""
|
||||||
@@ -150,12 +151,22 @@ make_ico() { # $1 = output .ico path
|
|||||||
# --------------------------------------------------------------- macOS
|
# --------------------------------------------------------------- macOS
|
||||||
build_mac() {
|
build_mac() {
|
||||||
say "building macOS app"
|
say "building macOS app"
|
||||||
local love_app="${LOVE_APP:-/Applications/love.app}"
|
local love_app="${LOVE_APP:-/Applications/love12.app}"
|
||||||
[ -d "$love_app" ] || fail "LÖVE.app not found at $love_app (install it or set LOVE_APP=/path/to/love.app)"
|
[ -d "$love_app" ] || fail "LÖVE.app not found at $love_app (install it or set LOVE_APP=/path/to/love.app)"
|
||||||
|
local love_version
|
||||||
|
love_version=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$love_app/Contents/Info.plist" 2>/dev/null || true)
|
||||||
|
printf '%s' "$love_version" | grep -Eq '^12(\.|$)' \
|
||||||
|
|| fail "macOS build requires LÖVE $LOVE_MAC_VERSION at $love_app (set LOVE_APP to a LÖVE 12 app)"
|
||||||
|
[ -f "$love_app/Contents/Frameworks/love.framework/love" ] \
|
||||||
|
|| fail "macOS build requires love.framework at $love_app"
|
||||||
|
otool -L "$love_app/Contents/Frameworks/love.framework/love" \
|
||||||
|
| grep -q '/Metal.framework/' \
|
||||||
|
|| fail "macOS build requires a LÖVE runtime linked to Metal at $love_app"
|
||||||
|
|
||||||
local out_app="$WORK/$APP_NAME.app"
|
local stage_dir
|
||||||
rm -rf "$out_app"
|
stage_dir="$(mktemp -d /tmp/gen1recomp-mac.XXXXXX)"
|
||||||
cp -R "$love_app" "$out_app"
|
local out_app="$stage_dir/$APP_NAME.app"
|
||||||
|
ditto --norsrc "$love_app" "$out_app"
|
||||||
|
|
||||||
# drop any bundled placeholder .love and fuse ours in
|
# drop any bundled placeholder .love and fuse ours in
|
||||||
find "$out_app/Contents/Resources" -maxdepth 1 -name '*.love' -delete
|
find "$out_app/Contents/Resources" -maxdepth 1 -name '*.love' -delete
|
||||||
@@ -212,9 +223,9 @@ build_mac() {
|
|||||||
warn "keychain profile '$NOTARY_PROFILE' not found/working, skipping notarization."
|
warn "keychain profile '$NOTARY_PROFILE' not found/working, skipping notarization."
|
||||||
warn "set it up with: xcrun notarytool store-credentials \"$NOTARY_PROFILE\" --apple-id ... --team-id ... --password ..."
|
warn "set it up with: xcrun notarytool store-credentials \"$NOTARY_PROFILE\" --apple-id ... --team-id ... --password ..."
|
||||||
else
|
else
|
||||||
local notarize_zip="$WORK/$APP_NAME-notarize.zip"
|
local notarize_zip="$stage_dir/$APP_NAME-notarize.zip"
|
||||||
rm -f "$notarize_zip"
|
rm -f "$notarize_zip"
|
||||||
(cd "$WORK" && ditto -c -k --keepParent "$APP_NAME.app" "$notarize_zip")
|
(cd "$stage_dir" && ditto -c -k --keepParent "$APP_NAME.app" "$notarize_zip")
|
||||||
say "submitting to Apple notary service (this can take a few minutes)"
|
say "submitting to Apple notary service (this can take a few minutes)"
|
||||||
xcrun notarytool submit "$notarize_zip" --keychain-profile "$NOTARY_PROFILE" --wait
|
xcrun notarytool submit "$notarize_zip" --keychain-profile "$NOTARY_PROFILE" --wait
|
||||||
say "stapling notarization ticket"
|
say "stapling notarization ticket"
|
||||||
@@ -227,7 +238,8 @@ build_mac() {
|
|||||||
|
|
||||||
local zip_out="$DIST/mac/$APP_NAME-macos.zip"
|
local zip_out="$DIST/mac/$APP_NAME-macos.zip"
|
||||||
rm -f "$zip_out"
|
rm -f "$zip_out"
|
||||||
(cd "$WORK" && ditto -c -k --norsrc --keepParent "$APP_NAME.app" "$zip_out")
|
(cd "$stage_dir" && ditto -c -k --norsrc --keepParent "$APP_NAME.app" "$zip_out")
|
||||||
|
rm -rf "$stage_dir"
|
||||||
say "macOS build: $zip_out"
|
say "macOS build: $zip_out"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user