From 685736fa16a69c341cdd3dc8ca79356cf873fee9 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 23 Feb 2026 18:40:26 -0800 Subject: [PATCH] Fix macOS asset extraction auto-build and docs - extract_assets.sh: detect Homebrew and pass CMAKE_PREFIX_PATH, OPENSSL_ROOT_DIR, and PKG_CONFIG_PATH when auto-building on macOS (bare cmake couldn't find Homebrew deps) - README.md: fix macOS brew command that had comments after line continuations (breaks shell execution) - BUILD_INSTRUCTIONS.md: expand macOS asset extraction section with auto-build note and expansion targets --- BUILD_INSTRUCTIONS.md | 5 +++++ README.md | 6 ++++-- extract_assets.sh | 13 ++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/BUILD_INSTRUCTIONS.md b/BUILD_INSTRUCTIONS.md index 47c23356..14627e5e 100644 --- a/BUILD_INSTRUCTIONS.md +++ b/BUILD_INSTRUCTIONS.md @@ -95,10 +95,15 @@ cmake --build build -j"$(sysctl -n hw.logicalcpu)" ### Asset Extraction (macOS) +The script will auto-build `asset_extract` if needed (requires `stormlib`). +It automatically detects Homebrew and passes the correct paths to CMake. + ```bash ./extract_assets.sh /path/to/WoW/Data wotlk ``` +Supports `classic`, `tbc`, `wotlk` targets (auto-detected if omitted). + --- ## 🪟 Windows (MSYS2 — Recommended) diff --git a/README.md b/README.md index 6a12e4a5..8a21add7 100644 --- a/README.md +++ b/README.md @@ -88,8 +88,10 @@ sudo pacman -S sdl2 glm openssl \ # macOS (Homebrew) brew install cmake pkg-config sdl2 glew glm openssl@3 zlib ffmpeg \ vulkan-loader vulkan-headers shaderc \ - unicorn \ # optional: Warden module execution - stormlib # optional: asset_extract tool + unicorn \ + stormlib +# unicorn is optional (Warden module execution) +# stormlib is optional (asset_extract tool) ``` ### Container build diff --git a/extract_assets.sh b/extract_assets.sh index 26bc9f05..532ee696 100755 --- a/extract_assets.sh +++ b/extract_assets.sh @@ -81,7 +81,18 @@ if [ ! -f "$BINARY" ]; then echo "Building asset_extract..." if [ ! -d "$BUILD_DIR" ]; then - cmake -S "$SCRIPT_DIR" -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE=Release + CMAKE_EXTRA_ARGS=() + # On macOS, Homebrew installs to a non-default prefix that CMake + # can't find automatically — pass it explicitly. + if command -v brew &>/dev/null; then + BREW="$(brew --prefix)" + CMAKE_EXTRA_ARGS+=( + "-DCMAKE_PREFIX_PATH=$BREW" + "-DOPENSSL_ROOT_DIR=$(brew --prefix openssl@3)" + ) + export PKG_CONFIG_PATH="$BREW/lib/pkgconfig:$(brew --prefix ffmpeg)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix vulkan-loader 2>/dev/null)/lib/pkgconfig:$(brew --prefix shaderc 2>/dev/null)/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" + fi + cmake -S "$SCRIPT_DIR" -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE=Release "${CMAKE_EXTRA_ARGS[@]}" fi NPROC=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 4) cmake --build "$BUILD_DIR" --target asset_extract -- -j"$NPROC"