#!/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' CFBundleDevelopmentRegion en CFBundleExecutable Tactility CFBundleIdentifier org.tactilityproject.simulator CFBundleInfoDictionaryVersion 6.0 CFBundleName Tactility CFBundlePackageType APPL CFBundleShortVersionString 0.8.0-dev CFBundleVersion 1 NSMicrophoneUsageDescription Tactility uses the microphone when a simulator app records audio. 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"