-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_mac.sh
More file actions
executable file
·64 lines (54 loc) · 1.63 KB
/
build_mac.sh
File metadata and controls
executable file
·64 lines (54 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
rm -rf GSInstaller.app
rm -rf dist
mkdir dist
mkdir dist/Contents
mkdir dist/Contents/Resources
mkdir dist/Contents/MacOS
mkdir dist/Contents/src
mkdir dist/Contents/frontend
mkdir dist/Contents/runtime
cp -r src/* dist/Contents/src
cp -r assets/* dist/Contents/Resources
cp -r frontend/* dist/Contents/frontend
cp -r runtimes/py313-mac/* dist/Contents/runtime
IDENTIFIER="dev.graphscript.installer"
NAME="GraphScript Installer"
VERSION="1.0.0"
ICON_NAME="GraphScript.icns"
cat > "dist/Contents/Info.plist" <<EOF
<?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>launcher</string>
<key>CFBundleIdentifier</key>
<string>${IDENTIFIER}</string>
<key>CFBundleName</key>
<string>${NAME}</string>
<key>CFBundleVersion</key>
<string>${VERSION}</string>
<key>CFBundleShortVersionString</key>
<string>${VERSION}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleIconFile</key>
<string>${ICON_NAME}</string>
</dict>
</plist>
EOF
touch dist/Contents/MacOS/launcher
chmod 755 dist/Contents/MacOS/*
chmod 755 dist/Contents/runtime/bin/*
cat > "dist/Contents/MacOS/launcher" <<EOF
#!/bin/bash
DIR="\$(cd "\$(dirname "\$0")" && pwd)"
RUNTIME_DIR="\$DIR/../runtime"
SOURCE_DIR="\$DIR/../src"
export PYTHONPATH="\$RUNTIME_DIR/packages"
\$RUNTIME_DIR/bin/python3 "\$SOURCE_DIR/main.py" "\$@"
EOF
mv dist GSInstaller.app
codesign --deep --force --sign - "GSInstaller.app"
ditto -c -k --keepParent "GSInstaller.app" GSInstallerMac.zip