Files
UltraGrid/.github/scripts/macOS/prepare.sh
Martin Pulec 960a36288d CI: compute checksums
compute SHA256 checksums for builds

this is useful at least for 2 reasons:
1. user can ensure that the build comes really from the CI (isn't
tampered)
2. can identify or match version with appropriate action run (the $VERSION
is usually always "continuous", except for releases)

The sha256 sum is currently only show in the protocol, not uploaded
to GH releases - this doesn't seem to be needed because GH currently
already prints the checksum by itself on the download (releases) page.

Skip computing checksum in Win when uplad-artifact is used - the zip
is actually created by the Action so we cannot compute the checksum
on it.

/sbin/sha256sum is not present in CI mac workers for some reason
2025-10-31 16:18:57 +01:00

85 lines
2.0 KiB
Bash
Executable File

#!/bin/bash -eux
srcroot=$(cd "$(dirname "$0")/../../.."; pwd)
readonly srcroot
# shellcheck source=/dev/null
. "$srcroot/.github/scripts/json-common.sh"
TEMP_INST=/tmp/install
if [ -z "${GITHUB_ENV-}" ]; then
GITHUB_ENV=/dev/null
GITHUB_PATH=/dev/null
fi
export CPATH=/usr/local/include
export DYLIBBUNDLER_FLAGS="${DYLIBBUNDLER_FLAGS:+$DYLIBBUNDLER_FLAGS }\
-s /usr/local/lib -s /Library/Frameworks"
export LDFLAGS="-Wl,-rpath,/usr/local/lib -Wl,-rpath,/Library/Frameworks"
export LIBRARY_PATH=/usr/local/lib
if [ "$(uname -m)" = arm64 ]; then
CPATH=/usr/local/include:/opt/homebrew/include
DYLIBBUNDLER_FLAGS="$DYLIBBUNDLER_FLAGS -s /opt/homebrew/lib"
LIBRARY_PATH="$LIBRARY_PATH:/opt/homebrew/lib"
fi
printf "%b" "\
CPATH=$CPATH\n\
LDFLAGS=$LDFLAGS\n\
LIBRARY_PATH=$LIBRARY_PATH\n" >> "$GITHUB_ENV"
echo "PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" >> "$GITHUB_ENV"
echo "/usr/local/opt/qt/bin" >> "$GITHUB_PATH"
echo "DYLIBBUNDLER_FLAGS=$DYLIBBUNDLER_FLAGS" >> "$GITHUB_ENV"
set -- \
asciidoctor \
autoconf \
automake \
ffmpeg \
fluidsynth \
glm \
imagemagick \
jack \
libcaca \
libnatpmp \
libsoxr \
libtool \
molten-vk \
opencv \
ossp-uuid `#for cineform` \
pkg-config \
portaudio \
qt \
sdl3 \
sdl3_ttf \
sha2 `#for cksum in CI YAML` \
speexdsp \
vulkan-headers \
wolfssl \
# shellcheck disable=SC2034
for n in $(seq $#); do
# if not installed, add on the back of positional parameters
if ! brew list "$1" >/dev/null 2>&1; then
set -- "$@" "$1"
fi
shift # remove from the front
done
brew install "$@"
mkdir $TEMP_INST
cd $TEMP_INST
"$srcroot/.github/scripts/macOS/install_dylibbundler_v2.sh"
# Install cross-platform deps
"$srcroot/.github/scripts/install-common-deps.sh"
"$srcroot/.github/scripts/macOS/install_others.sh"
# Remove installation files
cd
rm -rf $TEMP_INST