Skip to content

Commit

Permalink
Bug Fix (Mac): Homebrew installation
Browse files Browse the repository at this point in the history
- Homebrew is utilized for dependencies on MacOS. Update the Path
  and build variables to point at/include the Homebrew environments
- Note which versions of MacOS that are no longer supported and
  terminate the script early so the build pipeline will fail too

NOTE: The previous method used some symlinks to update the OpenGL
  install; however, it's installed under Homebrew now so including
  Homebrew should fix things better and more reliably.
  • Loading branch information
BenjamenMeyer committed Dec 15, 2024
1 parent 40dbdea commit e707379
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
14 changes: 12 additions & 2 deletions script/bootstrap-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,28 @@ MAC_OS_NAME="UNKOWN"
case "${DETECT_MAC_OS_VERSION}" in
"10.13")
MAC_OS_NAME="High_Sierra"
echo "Unsupported Mac Version"
exit 2
;;
"10.14")
MAC_OS_NAME="Mojave"
echo "Unsupported Mac Version"
exit 2
;;
"10.15")
MAC_OS_NAME="Catalina"
echo "Unsupported Mac Version"
exit 2
;;
"11.*")
MAC_OS_NAME="Big_Sur"
echo "Unsupported Mac Version"
exit 2
;;
"12.*")
MAC_OS_NAME="Monterey"
echo "Unsupported Mac Version"
exit 2
;;
"13.0"|"13.1"|"13.2"|"13.3"|"13.4"|"13.5"|"13.6"|"13.7")
MAC_OS_NAME="Ventura"
Expand Down Expand Up @@ -57,8 +67,8 @@ brew install \
# * OpenGL as of macOS 10.14
# * GLUT as of macOS 10.9
brew install mesa mesa-glu freeglut
ln -s /usr/local/include/GL /usr/local/include/OpenGL
ln -s /usr/local/include/GL /usr/local/include/GLUT
#ln -s /usr/local/include/GL /usr/local/include/OpenGL
#ln -s /usr/local/include/GL /usr/local/include/GLUT
# ln -s /usr/local/lib/libGL.dylib /usr/local/lib/libOpenGL.dylib
# find /usr/local/lib/ -iname '*gl*.dylib'

Expand Down
12 changes: 12 additions & 0 deletions script/cibuild
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ then
docker rm $DOCKER_CONTAINER_NAME
elif [ "$MY_OS_NAME" == "macos" ]
then
# setup the environment for Homebrew
HOMEBREW_PREFIX="$(brew --prefix)"
HOMEBREW_BIN="${HOMEBREW_PREFIX}/bin"
HOMEBREW_PYTHON_VERSION="$(brew --prefix python)/libexec/bin"

# Homebrew tooling needs to come first in the path search
export PATH=${HOMEBREW_BIN}:${HOMEBREW_PYTHON_VERSION}:${PATH}

# Homebrew needs certain flags set so its installation parts are found
export CFLAGS="-I${HOMEBREW_PREFIX}/include ${CFLAGS}"
export LDFLAGS="-L${HOMEBREW_PREFIX}/lib ${LDFLAGS}"

script/build -DCMAKE_BUILD_TYPE=RelWithDebInfo $@
# On macOS, the following is done by the calling CI workflow
# ctest -V
Expand Down

0 comments on commit e707379

Please sign in to comment.