@@ -253,8 +253,64 @@ __docker_build()
253253__local_build ()
254254{
255255 if [[ " $OSTYPE " == " darwin" * ]]; then
256- export PATH=" $( brew --prefix bison) /bin:$( brew --prefix flex) /bin:$( brew --prefix tcl-tk) /bin:$PATH "
257- export CMAKE_PREFIX_PATH=$( brew --prefix or-tools)
256+
257+ _bison=$( brew --prefix bison 2> /dev/null || true)
258+ _flex=$( brew --prefix flex 2> /dev/null || true)
259+ _ortools=$( brew --prefix or-tools 2> /dev/null || true)
260+
261+ if [[ -z " $_bison " || ! -d " $_bison /bin" ]]; then
262+ echo " [ERROR] bison not found or broken. Run: brew install bison" >&2
263+ exit 1
264+ fi
265+ if [[ -z " $_flex " || ! -d " $_flex /bin" ]]; then
266+ echo " [ERROR] flex not found or broken. Run: brew install flex" >&2
267+ exit 1
268+ fi
269+ if [[ -z " $_ortools " || ! -d " $_ortools /lib" || ! -d " $_ortools /include" ]]; then
270+ echo " [ERROR] or-tools not found or broken. Run: brew install or-tools" >&2
271+ exit 1
272+ fi
273+
274+ export PATH=" $_bison /bin:$_flex /bin:$PATH "
275+ export CMAKE_PREFIX_PATH=" ${_ortools} "
276+
277+ _qt5=$( brew --prefix qt@5 2> /dev/null || true)
278+ if [[ -z " $_qt5 " || ! -d " $_qt5 /lib" ]]; then
279+ echo " [ERROR] qt@5 not found or broken. Run: brew install qt@5" >&2
280+ exit 1
281+ fi
282+
283+ cmakeOptions+=" -DQt5_DIR=$_qt5 /lib/cmake/Qt5"
284+
285+ _tcl8=$( brew --prefix tcl-tk@8 2> /dev/null || true)
286+ if [[ -z " $_tcl8 " || ! -d " $_tcl8 /lib" || ! -d " $_tcl8 /include" ]]; then
287+ echo " [ERROR] tcl-tk@8 not found or broken. Run: brew install tcl-tk@8" >&2
288+ exit 1
289+ fi
290+
291+ cmakeOptions+=" -DTCL_LIBRARY=$_tcl8 /lib/libtcl8.6.dylib"
292+
293+ cmakeOptions+=" -DTCL_INCLUDE_PATH=$_tcl8 /include"
294+ cmakeOptions+=" -DFLEX_INCLUDE_DIR=$_flex /include"
295+
296+ cmakeOptions+=" -DCMAKE_CXX_FLAGS=-DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED"
297+
298+ _icu=" $( brew --prefix icu4c 2> /dev/null || true) "
299+ if [[ -z " $_icu " || ! -d " $_icu /lib" ]]; then
300+ echo " [ERROR] icu4c not found or broken. Run: brew install icu4c" >&2
301+ exit 1
302+ fi
303+
304+ export LDFLAGS=" -L$_icu /lib"
305+ export CPPFLAGS=" -I$_icu /include"
306+ export PKG_CONFIG_PATH=" $_icu /lib/pkgconfig"
307+
308+ _extra_lib_paths=(" /opt/homebrew/lib" )
309+
310+ _joined_paths=" $( IFS=:; echo " ${_extra_lib_paths[*]} " ) "
311+
312+ export LIBRARY_PATH=" ${_joined_paths}${LIBRARY_PATH: +: $LIBRARY_PATH } "
313+ echo " [INFO] General LIBRARY_PATH=$LIBRARY_PATH "
258314 fi
259315 if [[ -f " /opt/rh/rh-python38/enable" ]]; then
260316 set +u
0 commit comments