52 lines
2.2 KiB
Bash
Executable File
52 lines
2.2 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
root="$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)"
|
|
configuration="${CONFIGURATION:-Debug}"
|
|
output="$root/dist/ios-managed-device"
|
|
dotnet_host="${VOICECAT_DOTNET:-/usr/local/share/dotnet/dotnet}"
|
|
|
|
while [ "$#" -gt 0 ]; do
|
|
case "$1" in
|
|
--configuration) configuration="$2"; shift 2 ;;
|
|
--output) output="$2"; shift 2 ;;
|
|
-h|--help)
|
|
echo "usage: $0 [--configuration Debug|Release] [--output DIR]"
|
|
echo "optional env: VOICECAT_DOTNET, VOICECAT_CODESIGN_KEY, VOICECAT_CODESIGN_PROVISION"
|
|
exit 0 ;;
|
|
*) echo "unknown argument: $1" >&2; exit 2 ;;
|
|
esac
|
|
done
|
|
|
|
project="$root/clients/apple/VoiceCat.iOS/VoiceCat.iOS.csproj"
|
|
"$root/scripts/build-native-ios.sh"
|
|
"$dotnet_host" restore "$project" --locked-mode -p:VoiceCatIosStatic=true
|
|
device_lock="obj/packages.device.lock.json"
|
|
"$dotnet_host" restore "$project" -r ios-arm64 --no-dependencies \
|
|
-p:RestorePackagesWithLockFile=true -p:RestoreLockedMode=false -p:NuGetLockFilePath="$device_lock"
|
|
|
|
set -- build "$project" -c "$configuration" -r ios-arm64 --no-restore -m:1 \
|
|
-p:NuGetLockFilePath="$device_lock"
|
|
if [ -n "${VOICECAT_CODESIGN_KEY:-}" ]; then set -- "$@" -p:CodesignKey="$VOICECAT_CODESIGN_KEY"; fi
|
|
if [ -n "${VOICECAT_CODESIGN_PROVISION:-}" ]; then set -- "$@" -p:CodesignProvision="$VOICECAT_CODESIGN_PROVISION"; fi
|
|
"$dotnet_host" "$@"
|
|
|
|
app="$root/clients/apple/VoiceCat.iOS/bin/$configuration/net10.0-ios27.0/ios-arm64/VoiceCat.iOS.app"
|
|
[ -d "$app" ] || { echo "device app was not produced at $app" >&2; exit 1; }
|
|
/usr/bin/strings "$app/VoiceCat.Codec.dll" | /usr/bin/grep -q GetMainProgramHandle || {
|
|
echo "device codec does not contain the iOS static-library resolver" >&2
|
|
exit 1
|
|
}
|
|
/usr/bin/nm -gU "$app/VoiceCat.iOS" | /usr/bin/grep -q _vcm_decoder_create || {
|
|
echo "device executable does not export the statically linked media codec" >&2
|
|
exit 1
|
|
}
|
|
/usr/bin/nm -gU "$app/VoiceCat.iOS" | /usr/bin/grep -q _vcm_rnnoise_create || {
|
|
echo "device executable does not export the statically linked RNNoise processor" >&2
|
|
exit 1
|
|
}
|
|
mkdir -p "$output"
|
|
/usr/bin/ditto "$app" "$output/VoiceCat.iOS.app"
|
|
/usr/bin/codesign --verify --deep --strict "$output/VoiceCat.iOS.app"
|
|
echo "$output/VoiceCat.iOS.app"
|