Add native macOS simulator app packaging
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Usage: release-simulator-macos-app.sh [builddir] [Tactility.app]
|
||||
# Example: release-simulator-macos-app.sh buildsim release/Tactility.app
|
||||
|
||||
set -eu
|
||||
|
||||
build_path=$1
|
||||
bundle_path=$2
|
||||
|
||||
if [ -e "$bundle_path" ]; then
|
||||
echo "Refusing to overwrite existing bundle: $bundle_path" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
contents_path="$bundle_path/Contents"
|
||||
resources_path="$contents_path/Resources"
|
||||
macos_path="$contents_path/MacOS"
|
||||
|
||||
mkdir -p "$resources_path" "$macos_path"
|
||||
|
||||
cp "$build_path/Tactility/Tactility" "$resources_path/Tactility-bin"
|
||||
cp version.txt "$resources_path/"
|
||||
cp -R Data/data "$resources_path/"
|
||||
cp -R Data/system "$resources_path/"
|
||||
|
||||
cat > "$contents_path/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>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>Tactility</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.tactilityproject.simulator</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>Tactility</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.8.0-dev</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
EOF
|
||||
|
||||
cat > "$macos_path/Tactility" <<'EOF'
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
resources_path="$(CDPATH= cd -- "$(dirname -- "$0")/../Resources" && pwd)"
|
||||
cd "$resources_path"
|
||||
exec "$resources_path/Tactility-bin" "$@"
|
||||
EOF
|
||||
|
||||
chmod +x "$macos_path/Tactility" "$resources_path/Tactility-bin"
|
||||
Reference in New Issue
Block a user