diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 03f0c74e58875f1f6fa58b9c78b1b0e153751644..72342c1380d48539333240b6c8084670077b0895 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,13 +6,15 @@ mac_x64:
   - mac_x64_cloud
   stage: build
   before_script:
-  - PATH="/opt/homebrew-x86/opt/flex/bin:/opt/homebrew-x86/opt/bison/bin:$PATH"
+  # Homebrew packages are installed in a non-standard path
+  - BREWDIR="/opt/homebrew-x86/"
+  - PATH="$BREWDIR:$BREWDIR/opt/flex/bin:$BREWDIR/opt/bison/bin:$PATH"
   - PYPLAT="/Users/qtisas/.pyenv/versions/3.11.6/"
   script:
   - OPTDIR=/Users/Shared/Software/scg
   - mkdir pub/build
   - cd pub/build
-  - cmake -DCMAKE_PREFIX_PATH="$OPTDIR;$PYPLAT" -DCMAKE_BUILD_TYPE=Release -S ..
+  - cmake -DCMAKE_PREFIX_PATH="$BREWDIR;$OPTDIR;$PYPLAT" -DCMAKE_BUILD_TYPE=Release -S ..
   - make -j4
   - ctest --output-on-failure --timeout 120
   artifacts: