mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix macOS build process and make shell scripts cross-platform
- Add vulkan-loader, vulkan-headers, shaderc to macOS CI brew install - Add vulkan-loader and shaderc to macOS PKG_CONFIG_PATH - Replace Linux-only `nproc` with portable fallback in build.sh, rebuild.sh, extract_assets.sh, and tools/backup_assets.sh - Replace `ldconfig` StormLib check with portable detection (ldconfig, pkg-config, brew lib) in extract_assets.sh - Update BUILD_INSTRUCTIONS.md macOS section with vulkan/shaderc packages and MoltenVK explanation - Add macOS prerequisites to README.md
This commit is contained in:
parent
eb549a9b7a
commit
f66b9eb154
7 changed files with 42 additions and 13 deletions
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
|
|
@ -89,14 +89,14 @@ jobs:
|
|||
- name: Install dependencies
|
||||
run: |
|
||||
brew install cmake pkg-config sdl2 glew glm openssl@3 zlib ffmpeg unicorn \
|
||||
stormlib dylibbundler || true
|
||||
stormlib vulkan-loader vulkan-headers shaderc dylibbundler || true
|
||||
# dylibbundler may not be in all brew mirrors; install separately to not block others
|
||||
brew install dylibbundler 2>/dev/null || true
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
BREW=$(brew --prefix)
|
||||
export PKG_CONFIG_PATH="$BREW/lib/pkgconfig:$(brew --prefix ffmpeg)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig"
|
||||
export PKG_CONFIG_PATH="$BREW/lib/pkgconfig:$(brew --prefix ffmpeg)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix vulkan-loader)/lib/pkgconfig:$(brew --prefix shaderc)/lib/pkgconfig"
|
||||
cmake -S . -B build \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH="$BREW" \
|
||||
|
|
|
|||
|
|
@ -65,8 +65,18 @@ Supports `classic`, `tbc`, `wotlk` targets (auto-detected if omitted).
|
|||
|
||||
### Install Dependencies
|
||||
|
||||
Vulkan on macOS is provided via MoltenVK (a Vulkan-to-Metal translation layer),
|
||||
which is included in the `vulkan-loader` Homebrew package.
|
||||
|
||||
```bash
|
||||
brew install cmake pkg-config sdl2 glew glm openssl@3 zlib ffmpeg unicorn stormlib
|
||||
brew install cmake pkg-config sdl2 glew glm openssl@3 zlib ffmpeg unicorn \
|
||||
stormlib vulkan-loader vulkan-headers shaderc
|
||||
```
|
||||
|
||||
Optional (for creating redistributable `.app` bundles):
|
||||
|
||||
```bash
|
||||
brew install dylibbundler
|
||||
```
|
||||
|
||||
### Clone & Build
|
||||
|
|
@ -76,7 +86,7 @@ git clone --recurse-submodules https://github.com/Kelsidavis/WoWee.git
|
|||
cd WoWee
|
||||
|
||||
BREW=$(brew --prefix)
|
||||
export PKG_CONFIG_PATH="$BREW/lib/pkgconfig:$(brew --prefix ffmpeg)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig"
|
||||
export PKG_CONFIG_PATH="$BREW/lib/pkgconfig:$(brew --prefix ffmpeg)/lib/pkgconfig:$(brew --prefix openssl@3)/lib/pkgconfig:$(brew --prefix vulkan-loader)/lib/pkgconfig:$(brew --prefix shaderc)/lib/pkgconfig"
|
||||
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH="$BREW" \
|
||||
-DOPENSSL_ROOT_DIR="$(brew --prefix openssl@3)"
|
||||
|
|
|
|||
|
|
@ -84,6 +84,12 @@ sudo pacman -S sdl2 glm openssl \
|
|||
ffmpeg zlib cmake base-devel libx11 \
|
||||
unicorn # optional: Warden module execution
|
||||
# StormLib: install from AUR for asset_extract tool
|
||||
|
||||
# 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
|
||||
```
|
||||
|
||||
### Container build
|
||||
|
|
|
|||
5
build.sh
5
build.sh
|
|
@ -16,8 +16,9 @@ echo "Configuring with CMake..."
|
|||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
# Build with all cores
|
||||
echo "Building with $(nproc) cores..."
|
||||
cmake --build . --parallel $(nproc)
|
||||
NPROC=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 4)
|
||||
echo "Building with $NPROC cores..."
|
||||
cmake --build . --parallel "$NPROC"
|
||||
|
||||
# Ensure Data symlink exists in bin directory
|
||||
cd bin
|
||||
|
|
|
|||
|
|
@ -63,10 +63,19 @@ fi
|
|||
# --- Build asset_extract if needed ---
|
||||
if [ ! -f "$BINARY" ]; then
|
||||
# --- Check for StormLib (only required to build) ---
|
||||
if ! ldconfig -p 2>/dev/null | grep -qi stormlib; then
|
||||
STORMLIB_FOUND=false
|
||||
if ldconfig -p 2>/dev/null | grep -qi stormlib; then
|
||||
STORMLIB_FOUND=true
|
||||
elif pkg-config --exists stormlib 2>/dev/null; then
|
||||
STORMLIB_FOUND=true
|
||||
elif [ -f "$(brew --prefix 2>/dev/null)/lib/libstorm.dylib" ] 2>/dev/null; then
|
||||
STORMLIB_FOUND=true
|
||||
fi
|
||||
if [ "$STORMLIB_FOUND" = false ]; then
|
||||
echo "Error: StormLib not found."
|
||||
echo "Install it with: sudo apt install libstormlib-dev"
|
||||
echo " or build from source: https://github.com/ladislav-zezula/StormLib"
|
||||
echo " Ubuntu/Debian: sudo apt install libstormlib-dev"
|
||||
echo " macOS: brew install stormlib"
|
||||
echo " From source: https://github.com/ladislav-zezula/StormLib"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -74,7 +83,8 @@ if [ ! -f "$BINARY" ]; then
|
|||
if [ ! -d "$BUILD_DIR" ]; then
|
||||
cmake -S "$SCRIPT_DIR" -B "$BUILD_DIR" -DCMAKE_BUILD_TYPE=Release
|
||||
fi
|
||||
cmake --build "$BUILD_DIR" --target asset_extract -- -j"$(nproc)"
|
||||
NPROC=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 4)
|
||||
cmake --build "$BUILD_DIR" --target asset_extract -- -j"$NPROC"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,9 @@ echo "Configuring with CMake..."
|
|||
cmake .. -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
# Build with all cores
|
||||
echo "Building with $(nproc) cores..."
|
||||
cmake --build . --parallel $(nproc)
|
||||
NPROC=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 4)
|
||||
echo "Building with $NPROC cores..."
|
||||
cmake --build . --parallel "$NPROC"
|
||||
|
||||
# Create Data symlink in bin directory
|
||||
echo "Creating Data symlink..."
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ if command -v zstd &>/dev/null; then
|
|||
tar cf - -C "$(dirname "$DATA_DIR")" "$(basename "$DATA_DIR")" | zstd -T0 -3 -o "$ARCHIVE"
|
||||
elif command -v pigz &>/dev/null; then
|
||||
ARCHIVE="$BACKUP_DIR/wowee_assets_$TIMESTAMP.tar.gz"
|
||||
tar cf - -C "$(dirname "$DATA_DIR")" "$(basename "$DATA_DIR")" | pigz -p "$(nproc)" > "$ARCHIVE"
|
||||
NPROC=$(nproc 2>/dev/null || sysctl -n hw.logicalcpu 2>/dev/null || echo 4)
|
||||
tar cf - -C "$(dirname "$DATA_DIR")" "$(basename "$DATA_DIR")" | pigz -p "$NPROC" > "$ARCHIVE"
|
||||
else
|
||||
ARCHIVE="$BACKUP_DIR/wowee_assets_$TIMESTAMP.tar.gz"
|
||||
tar czf "$ARCHIVE" -C "$(dirname "$DATA_DIR")" "$(basename "$DATA_DIR")"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue