mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-19 09:08:52 +00:00
generate the run-time dependency according to the build system, not hard-coded The advantage for CI is that it does no longer need to be upgraded every time the GH runner was updated. This also generalizes for non-CI builds, when the build macOS version can obviously differ from the CI macos runner. Do not use both Darwin and macOS version, use just macOS ver.
35 lines
784 B
Bash
Executable File
35 lines
784 B
Bash
Executable File
#!/bin/sh -eu
|
|
|
|
cat << 'EOF'
|
|
#!/bin/sh -eu
|
|
|
|
EOF
|
|
|
|
# req_macos is evaluated during the build (EOF not in '')
|
|
cat << EOF
|
|
req_macos=$(sw_vers -productVersion | cut -d. -f1)
|
|
|
|
EOF
|
|
|
|
# following macos var will be evaluated on run-time
|
|
cat << 'EOF'
|
|
macos=$(sw_vers -productVersion | cut -d. -f1)
|
|
|
|
MSG="Please use an alternative build for macOS older than ${req_macos:?}, available at:
|
|
https://github.com/CESNET/UltraGrid/releases/download/continuous/UltraGrid-nightly-alt.dmg"
|
|
|
|
if [ "${macos:?}" -lt "${req_macos:?}" ]; then
|
|
BASENAME=$(basename "$0")
|
|
if [ "$BASENAME" = uv-qt ]; then
|
|
osascript -e "tell application \"SystemUIServer\"
|
|
display dialog \"$MSG\"
|
|
end"
|
|
else
|
|
echo "$MSG" >&2
|
|
fi
|
|
exit 1
|
|
fi
|
|
|
|
exec "$0-real" "$@"
|
|
EOF
|