Skip to content

Commit 73e3a7b

Browse files
committed
rework macos-wrapper
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.
1 parent 4d6ceb2 commit 73e3a7b

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ $(GUI_BUNDLE): $(BUNDLE) $(GUI_BUNDLE_DEP)
628628
if expr $$n : '.*-real$$' >/dev/null || expr $$n : '.*\.sh$$' >/dev/null || \
629629
[ ! -f $$n ]; then continue; fi; \
630630
mv -f $$n $$n-real; dsymutil $$n-real; \
631-
$(CP) -f $(srcdir)/data/scripts/macos-wrapper $$n; \
631+
$(srcdir)/data/scripts/gen-macos-wrapper.sh > $$n; chmod 755 $$n; \
632632
done; \
633633
fi
634634

Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
#!/bin/sh -eu
22

3-
MACOS_VER_MAJOR=$(uname -r | cut -f 1 -d .)
3+
cat << 'EOF'
4+
#!/bin/sh -eu
45
5-
req_macos_arm64=14
6-
req_darwin_arm64=23
6+
EOF
77

8-
req_macos_x86_64=13
9-
req_darwin_x86_64=22
8+
# req_macos is evaluated during the build (EOF not in '')
9+
cat << EOF
10+
req_macos=$(sw_vers -productVersion | cut -d. -f1)
1011
11-
if [ "$(uname -m)" = arm64 ]; then
12-
req_macos=$req_macos_arm64
13-
req_darwin=$req_darwin_arm64
14-
else
15-
req_macos=$req_macos_x86_64
16-
req_darwin=$req_darwin_x86_64
17-
fi
12+
EOF
13+
14+
# following macos var will be evaluated on run-time
15+
cat << 'EOF'
16+
macos=$(sw_vers -productVersion | cut -d. -f1)
1817
1918
MSG="Please use an alternative build for macOS older than ${req_macos:?}, available at:
2019
https://github.com/CESNET/UltraGrid/releases/download/continuous/UltraGrid-nightly-alt.dmg"
2120
22-
if [ "$MACOS_VER_MAJOR" -lt "${req_darwin:?}" ]; then
21+
if [ "${macos:?}" -lt "${req_macos:?}" ]; then
2322
BASENAME=$(basename "$0")
2423
if [ "$BASENAME" = uv-qt ]; then
2524
osascript -e "tell application \"SystemUIServer\"
@@ -32,3 +31,4 @@ end"
3231
fi
3332
3433
exec "$0-real" "$@"
34+
EOF

0 commit comments

Comments
 (0)