From 44fb3ceb9bb4bce286d65704f25fe1bd8095209f Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 13 Sep 2023 14:36:37 +0200 Subject: [PATCH] gh/scripts/macOS/prepare.sh: standalone install allow standalone installation of deps (outside GitHub CI) for debugging --- .github/scripts/aja-common.sh | 4 ++-- .github/scripts/macOS/prepare.sh | 24 ++++++++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/scripts/aja-common.sh b/.github/scripts/aja-common.sh index fd4ccf8de..91f9e3a41 100644 --- a/.github/scripts/aja-common.sh +++ b/.github/scripts/aja-common.sh @@ -2,10 +2,10 @@ download_aja_release_asset() { pattern=${1?pattern must be given!} file=${2?output filename must be given!} - aja_release_json=$(fetch_json https://api.github.com/repos/aja-video/ntv2/releases "$GITHUB_TOKEN" array) + aja_release_json=$(fetch_json https://api.github.com/repos/aja-video/ntv2/releases "${GITHUB_TOKEN-}" array) aja_gh_release=$(jq -r '.[0].assets_url' "$aja_release_json") rm -- "$aja_release_json" - aja_gh_path_json=$(fetch_json "$aja_gh_release" "$GITHUB_TOKEN" array) + aja_gh_path_json=$(fetch_json "$aja_gh_release" "${GITHUB_TOKEN-}" array) aja_gh_path=$(jq -r '[.[] | select(.name | test(".*'"$pattern"'.*"))] | .[0].browser_download_url' "$aja_gh_path_json") rm -- "$aja_gh_path_json" curl -sSL "$aja_gh_path" -o "$file" diff --git a/.github/scripts/macOS/prepare.sh b/.github/scripts/macOS/prepare.sh index 35d9f385c..263505d3f 100755 --- a/.github/scripts/macOS/prepare.sh +++ b/.github/scripts/macOS/prepare.sh @@ -1,10 +1,17 @@ #!/bin/bash -eux +srcroot=$(cd "$(dirname "$0")/../../.."; pwd) +readonly srcroot + # shellcheck source=/dev/null -. .github/scripts/json-common.sh +. "$srcroot/.github/scripts/json-common.sh" TEMP_INST=/tmp/install +if [ -z "${GITHUB_ENV-}" ]; then + GITHUB_ENV=/dev/null +fi + CPATH=/usr/local/include:/usr/local/opt/qt/include DYLIBBUNDLER_FLAGS="${DYLIBBUNDLER_FLAGS:+$DYLIBBUNDLER_FLAGS }-s /usr/local/lib" LIBRARY_PATH=/usr/local/lib:/usr/local/opt/qt/lib @@ -24,7 +31,8 @@ brew install imagemagick libcaca libnatpmp jack opencv wolfssl brew install ossp-uuid # for cineform brew install qt@5 brew install glm -curl -L https://raw.githubusercontent.com/miniupnp/libnatpmp/master/natpmp_declspec.h -o /usr/local/include/natpmp_declspec.h +sudo curl -L https://raw.githubusercontent.com/miniupnp/libnatpmp/master/\ +natpmp_declspec.h -o /usr/local/include/natpmp_declspec.h rm -f /usr/local/opt/qt cp -af /usr/local/opt/qt@5 /usr/local/opt/qt @@ -44,7 +52,7 @@ install_ximea() { install_aja() { # shellcheck source=/dev/null - . "$GITHUB_WORKSPACE/.github/scripts/aja-common.sh" + . "$srcroot/.github/scripts/aja-common.sh" AJA_DIRECTORY=/private/var/tmp/ntv2sdk git clone --depth 1 https://github.com/aja-video/ntv2 $AJA_DIRECTORY cd $AJA_DIRECTORY @@ -56,7 +64,7 @@ install_aja() { } install_deltacast() { - DELTA_CACHE_INST=$SDK_NONFREE_PATH/VideoMasterHD_inst + DELTA_CACHE_INST=${SDK_NONFREE_PATH-nonexistent}/VideoMasterHD_inst if [ ! -d "$DELTA_CACHE_INST" ]; then return 0 fi @@ -105,20 +113,20 @@ install_live555() { } install_soundfont() { - . "$GITHUB_WORKSPACE/.github/scripts/defs.sh" - sf_dir="$GITHUB_WORKSPACE/data/MacOS-bundle-template/Contents/share/soundfonts" + . "$srcroot/.github/scripts/defs.sh" + sf_dir="$srcroot/data/MacOS-bundle-template/Contents/share/soundfonts" mkdir -p "$sf_dir" curl -L "$DEFAULT_SF_URL" -o "$sf_dir/default.${DEFAULT_SF_URL##*.}" } install_syphon() { - wget --no-verbose https://github.com/Syphon/Syphon-Framework/releases/download/5/Syphon.SDK.5.zip + curl -LO https://github.com/Syphon/Syphon-Framework/releases/download/5/Syphon.SDK.5.zip unzip Syphon.SDK.5.zip sudo cp -R 'Syphon SDK 5/Syphon.framework' /Library/Frameworks } # Install cross-platform deps -"$GITHUB_WORKSPACE/.github/scripts/install-common-deps.sh" +"$srcroot/.github/scripts/install-common-deps.sh" install_aja install_deltacast