summaryrefslogtreecommitdiff
path: root/build-macos.sh
diff options
context:
space:
mode:
authorYehor Melnykov <y.melnykov@p1k.org>2024-03-24 17:08:26 +0100
committerYehor Melnykov <y.melnykov@p1k.org>2024-03-24 17:08:26 +0100
commit5fdeb1a73cafcf8ead8e91830d171724291f1d9f (patch)
tree4848a3447f74c5e1d2541428680106767a7f819c /build-macos.sh
parent3bf2feb0b55230c676362c0a303873f66669529b (diff)
Add macos (unified) build script
Diffstat (limited to 'build-macos.sh')
-rwxr-xr-xbuild-macos.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/build-macos.sh b/build-macos.sh
new file mode 100755
index 0000000..7b9ff34
--- /dev/null
+++ b/build-macos.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -xe
+
+gnatmake -f -O3 -Wall -Wextra -gnat2022 eepers.adb -bargs -static -largs -framework CoreVideo -framework IOKit -framework Cocoa -framework GLUT -framework OpenGL ./raylib/raylib-5.0_macos/lib/libraylib.a
+
+# Bundle executable in an Application
+rm -rf ./eepers.app
+mkdir -p ./eepers.app/Contents
+mkdir ./eepers.app/Contents/MacOS
+mkdir ./eepers.app/Contents/Resources
+touch ./eepers.app/Contents/Info.plist
+
+# copy binary
+cp ./eepers ./eepers.app/Contents/MacOS/
+
+#copy assets
+cp -r ./assets ./eepers.app/Contents/MacOS/
+
+# copy app icon
+cp assets/icon.ico ./eepers.app/Contents/Resources/
+
+# fill required plist file
+echo '<?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>CFBundleExecutable</key>
+ <string>eepers</string>
+ <key>CFBundleIconFile</key>
+ <string>icon.ico</string>
+</dict>
+</plist>' > eepers.app/Contents/Info.plist \ No newline at end of file