From 139bde6420c1833893925976aa0425cd168f9c24 Mon Sep 17 00:00:00 2001 From: Sarah Sunday <1644563-ssunday@users.noreply.gitlab.com> Date: Sat, 21 Jun 2025 13:53:40 -0500 Subject: [PATCH] [CI] Fork before install mac arm/intel steps, prefix with arch command --- CI/before_install.osx.sh | 23 ++++---------- CI/before_script.osx.sh | 50 +++++++++++++++++++++---------- CI/macos/before_install.arm.sh | 20 +++++++++++++ CI/macos/before_install.x86_64.sh | 8 +++++ 4 files changed, 67 insertions(+), 34 deletions(-) create mode 100755 CI/macos/before_install.arm.sh create mode 100755 CI/macos/before_install.x86_64.sh diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index e5f63a89a6..2e333261ab 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -4,21 +4,8 @@ export HOMEBREW_NO_EMOJI=1 export HOMEBREW_NO_INSTALL_CLEANUP=1 export HOMEBREW_AUTOREMOVE=1 -brew tap --repair -brew update --quiet - -brew install curl xquartz gd fontconfig freetype harfbuzz brotli s3cmd - -command -v ccache >/dev/null 2>&1 || brew install ccache -command -v cmake >/dev/null 2>&1 || brew install cmake -command -v qmake >/dev/null 2>&1 || brew install qt@6 - -# Install deps -brew install openal-soft icu4c yaml-cpp sqlite - -ccache --version -cmake --version -qmake --version - -curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240818-arm64.tar.xz -o ~/openmw-deps.tar.xz -tar xf ~/openmw-deps.tar.xz -C /tmp > /dev/null +if [[ "${MACOS_X86_64}" ]]; then + ./CI/macos/before_install.x86_64.sh +else + ./CI/macos/before_install.arm.sh +fi diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index 7957514e88..ceabaef280 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -9,10 +9,17 @@ cd build DEPENDENCIES_ROOT="/tmp/openmw-deps" -QT_PATH=$(brew --prefix qt@6) -ICU_PATH=$(brew --prefix icu4c) -OPENAL_PATH=$(brew --prefix openal-soft) -CCACHE_EXECUTABLE=$(brew --prefix ccache)/bin/ccache +if [[ "${MACOS_X86_64}" ]]; then + QT_PATH=$(arch -x86_64 brew --prefix qt@6) + ICU_PATH=$(arch -x86_64 brew --prefix icu4c) + OPENAL_PATH=$(arch -x86_64 brew --prefix openal-soft) + CCACHE_EXECUTABLE=$(arch -x86_64 brew --prefix ccache)/bin/ccache +else + QT_PATH=$(brew --prefix qt@6) + ICU_PATH=$(brew --prefix icu4c) + OPENAL_PATH=$(brew --prefix openal-soft) + CCACHE_EXECUTABLE=$(brew --prefix ccache)/bin/ccache +fi declare -a CMAKE_CONF_OPTS=( -D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH;$OPENAL_PATH" @@ -29,6 +36,18 @@ declare -a CMAKE_CONF_OPTS=( -D OPENMW_OSX_DEPLOYMENT=TRUE ) +declare -a BUILD_OPTS=( +-D BUILD_OPENMW=TRUE +-D BUILD_OPENCS=TRUE +-D BUILD_ESMTOOL=TRUE +-D BUILD_BSATOOL=TRUE +-D BUILD_ESSIMPORTER=TRU +-D BUILD_NIFTEST=TRUE +-D BUILD_NAVMESHTOOL=TRUE +-D BUILD_BULLETOBJECTTOOL=TRUE +-G"Unix Makefiles" +) + if [[ "${MACOS_X86_64}" ]]; then CMAKE_CONF_OPTS+=( -D CMAKE_OSX_ARCHITECTURES="x86_64" @@ -45,15 +64,14 @@ else ) fi -cmake \ -"${CMAKE_CONF_OPTS[@]}" \ --D BUILD_OPENMW=TRUE \ --D BUILD_OPENCS=TRUE \ --D BUILD_ESMTOOL=TRUE \ --D BUILD_BSATOOL=TRUE \ --D BUILD_ESSIMPORTER=TRUE \ --D BUILD_NIFTEST=TRUE \ --D BUILD_NAVMESHTOOL=TRUE \ --D BUILD_BULLETOBJECTTOOL=TRUE \ --G"Unix Makefiles" \ -.. +if [[ "${MACOS_X86_64}" ]]; then + arch -x86_64 cmake \ + "${CMAKE_CONF_OPTS[@]}" \ + "${BUILD_OPTS[@]}" \ + .. +else + cmake \ + "${CMAKE_CONF_OPTS[@]}" \ + "${BUILD_OPTS[@]}" \ + .. +fi diff --git a/CI/macos/before_install.arm.sh b/CI/macos/before_install.arm.sh new file mode 100755 index 0000000000..1be5f7b740 --- /dev/null +++ b/CI/macos/before_install.arm.sh @@ -0,0 +1,20 @@ +#!/bin/sh -ex + +brew tap --repair +brew update --quiet + +brew install curl xquartz gd fontconfig freetype harfbuzz brotli s3cmd + +command -v ccache >/dev/null 2>&1 || brew install ccache +command -v cmake >/dev/null 2>&1 || brew install cmake +command -v qmake >/dev/null 2>&1 || brew install qt@6 + +# Install deps +brew install openal-soft icu4c yaml-cpp sqlite + +ccache --version +cmake --version +qmake --version + +curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240818-arm64.tar.xz -o ~/openmw-deps.tar.xz +tar xf ~/openmw-deps.tar.xz -C /tmp > /dev/null diff --git a/CI/macos/before_install.x86_64.sh b/CI/macos/before_install.x86_64.sh new file mode 100755 index 0000000000..6e5664c3b0 --- /dev/null +++ b/CI/macos/before_install.x86_64.sh @@ -0,0 +1,8 @@ +#!/bin/sh -ex + +arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + +arch -x86_64 brew install curl xquartz gd fontconfig freetype harfbuzz brotli s3cmd ccache cmake qt@6 openal-soft icu4c yaml-cpp sqlite + +curl -fSL -R -J https://gitlab.com/OpenMW/openmw-deps/-/raw/main/macos/openmw-deps-20240802.zip -o ~/openmw-deps.zip +unzip -o ~/openmw-deps.zip -d /tmp > /dev/null