Files
strawberry/build_tools/macos/install_brew_deps.sh
David Helkowski 32eee8f868
Some checks failed
Build / Build openSUSE (leap:15.6) (push) Has been cancelled
Build / Build openSUSE (leap:16.0) (push) Has been cancelled
Build / Build openSUSE (tumbleweed) (push) Has been cancelled
Build / Build Fedora (42) (push) Has been cancelled
Build / Build Fedora (43) (push) Has been cancelled
Build / Build Fedora (44) (push) Has been cancelled
Build / Build OpenMandriva (cooker) (push) Has been cancelled
Build / Build Mageia (9) (push) Has been cancelled
Build / Build Debian (bookworm) (push) Has been cancelled
Build / Build Debian (forky) (push) Has been cancelled
Build / Build Debian (trixie) (push) Has been cancelled
Build / Build Ubuntu (noble) (push) Has been cancelled
Build / Build Ubuntu (questing) (push) Has been cancelled
Build / Build Ubuntu (resolute) (push) Has been cancelled
Build / Upload Ubuntu PPA (noble) (push) Has been cancelled
Build / Upload Ubuntu PPA (questing) (push) Has been cancelled
Build / Upload Ubuntu PPA (resolute) (push) Has been cancelled
Build / Build FreeBSD (push) Has been cancelled
Build / Build OpenBSD (push) Has been cancelled
Build / Build macOS Public (release, macos-15) (push) Has been cancelled
Build / Build macOS Public (release, macos-15-intel) (push) Has been cancelled
Build / Build macOS Private (release, macos-arm64) (push) Has been cancelled
Build / Build Windows MinGW (i686, debug) (push) Has been cancelled
Build / Build Windows MinGW (i686, release) (push) Has been cancelled
Build / Build Windows MinGW (x86_64, debug) (push) Has been cancelled
Build / Build Windows MinGW (x86_64, release) (push) Has been cancelled
Build / Build Windows MSVC (arm64, debug, arm64 debug, windows-11-arm) (push) Has been cancelled
Build / Build Windows MSVC (arm64, release, arm64 release, windows-11-arm) (push) Has been cancelled
Build / Build Windows MSVC (x86, debug, x86 debug, windows-2022) (push) Has been cancelled
Build / Build Windows MSVC (x86, release, x86 release, windows-2022) (push) Has been cancelled
Build / Build Windows MSVC (x86_64, debug, x86_64 debug, windows-2022) (push) Has been cancelled
Build / Build Windows MSVC (x86_64, release, x86_64 release, windows-2022) (push) Has been cancelled
Build / Upload (push) Has been cancelled
Build / Attach to release (push) Has been cancelled
Enhance macOS deployment with Sparkle integration and update build scripts
This commit refines the CMake configuration for macOS by finding the Sparkle framework early in the build process, allowing it to be bundled with the application. The Dmg.cmake script is updated to handle Sparkle's framework paths and ensure proper deployment. Additionally, the build_sign_notarize.sh script is improved to sign Sparkle's helper executables correctly and includes enhanced notarization feedback. The Brewfile and install_brew_deps.sh are also updated to include the new macdeploycheck dependency for better deployment checks.
2026-01-22 17:04:57 +09:00

120 lines
3.7 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
repo_root="$(cd -- "${script_dir}/../.." && pwd)"
ts() { date +"%H:%M:%S"; }
run_with_heartbeat() {
local desc="$1"
shift
local start now elapsed hb_pid
start="$(date +%s)"
echo "==> [$(ts)] ${desc}"
# Heartbeat: print elapsed time periodically in case the underlying command is quiet
(
while true; do
sleep 20
now="$(date +%s)"
elapsed="$((now - start))"
echo " [$(ts)] ... still working (${elapsed}s elapsed) ..."
done
) &
hb_pid="$!"
set +e
"$@"
local rc=$?
set -e
kill "$hb_pid" >/dev/null 2>&1 || true
wait "$hb_pid" >/dev/null 2>&1 || true
now="$(date +%s)"
elapsed="$((now - start))"
if [[ $rc -ne 0 ]]; then
echo "Error: '${desc}' failed after ${elapsed}s (exit $rc)." >&2
return "$rc"
fi
echo "==> [$(ts)] Done: ${desc} (${elapsed}s)"
}
if [[ "$(uname -s)" != "Darwin" ]]; then
echo "Error: This script is for macOS only." >&2
exit 1
fi
if ! command -v brew >/dev/null 2>&1; then
echo "Error: Homebrew ('brew') not found in PATH." >&2
echo "Install Homebrew first: https://brew.sh/" >&2
exit 1
fi
# Homebrew taps are git clones; local formula changes must be committed to be visible.
if command -v git >/dev/null 2>&1 && git -C "$repo_root" rev-parse --is-inside-work-tree >/dev/null 2>&1; then
if git -C "$repo_root" status --porcelain Formula/ | grep -q .; then
echo "Error: You have uncommitted changes under Formula/." >&2
echo "Homebrew taps are git clones, so uncommitted formulae won't be visible to 'brew tap'." >&2
echo "Commit your changes, then re-run this script." >&2
exit 1
fi
fi
# Optional: disable auto-update for faster, more predictable runs.
export HOMEBREW_NO_AUTO_UPDATE="${HOMEBREW_NO_AUTO_UPDATE:-1}"
cd "$repo_root"
echo "==> [$(ts)] Using repo: $repo_root"
# Strawberry includes local Homebrew formulae under Formula/.
# Homebrew requires formulae to be in a tap; we tap this repo via file:// and then
# update the tap clone to the latest commit (without untapping, since Homebrew may
# refuse to untap when formulae from this tap are installed).
run_with_heartbeat "Ensuring local tap exists: strawberry/local" bash -lc \
"brew tap | grep -q '^strawberry/local$' || brew tap strawberry/local 'file://$repo_root' >/dev/null"
run_with_heartbeat "Refreshing strawberry/local tap clone" bash -lc '
tap_repo="$(brew --repo strawberry/local)"
cd "$tap_repo"
# Make sure the remote points at the current local repo path.
git remote set-url origin "file://'"$repo_root"'"
git fetch -q origin
default_ref="$(git symbolic-ref -q --short refs/remotes/origin/HEAD || true)"
if [ -z "$default_ref" ]; then
default_ref="origin/master"
fi
git reset --hard -q "$default_ref"
'
for f in kdsingleapplication-qt6 qtsparkle-qt6 sparkle-framework libgpod macdeploycheck; do
if ! brew info "strawberry/local/${f}" >/dev/null 2>&1; then
echo "Error: Missing formula strawberry/local/${f} in the tapped repo." >&2
echo "If you recently added/changed formulae, ensure they are committed, then refresh the tap:" >&2
echo " git -C \"$(brew --repo strawberry/local)\" pull --ff-only" >&2
exit 1
fi
done
run_with_heartbeat "Installing dependencies from Brewfile" \
brew bundle install --file "$repo_root/Brewfile" --verbose
cat <<EOF
Done.
Notes for packaging (optional):
- The CMake target 'deploy' expects these env vars for bundling GIO + GStreamer bits:
export GIO_EXTRA_MODULES="\$(brew --prefix)/lib/gio/modules"
export GST_PLUGIN_SCANNER="\$(brew --prefix gstreamer)/libexec/gstreamer-1.0/gst-plugin-scanner"
export GST_PLUGIN_PATH="\$(brew --prefix)/lib/gstreamer-1.0"
EOF