Rebuild local Blender WASM environment and recovery evidence
This commit is contained in:
45
tools/web/native-build-env.sh
Executable file
45
tools/web/native-build-env.sh
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Shared environment for native Blender builds and desktop fixture checkers.
|
||||
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
|
||||
export BLENDER_SOURCE_DIR="${BLENDER_SOURCE_DIR:-${repo_root}/blender-5.2.0}"
|
||||
export BLENDER_BUILD_DIR="${BLENDER_BUILD_DIR:-${repo_root}/build_blender_native}"
|
||||
export BLENDER_DEPS_ROOT="${BLENDER_DEPS_ROOT:-${repo_root}/.deps/native}"
|
||||
export BLENDER_PYTHON_ROOT="${BLENDER_PYTHON_ROOT:-${BLENDER_DEPS_ROOT}/python}"
|
||||
export BLENDER_CMAKE_HELPERS="${repo_root}/tools/web/cmake"
|
||||
|
||||
native_lib_dirs=()
|
||||
if [[ -d "${BLENDER_DEPS_ROOT}" ]]; then
|
||||
while IFS= read -r directory; do
|
||||
native_lib_dirs+=("${directory}")
|
||||
done < <(find "${BLENDER_DEPS_ROOT}" -type d \( -name lib -o -name lib64 \) -print | sort)
|
||||
fi
|
||||
if [[ -d "${BLENDER_PYTHON_ROOT}/lib" ]]; then
|
||||
native_lib_dirs+=("${BLENDER_PYTHON_ROOT}/lib")
|
||||
fi
|
||||
for site_packages in \
|
||||
"${BLENDER_PYTHON_ROOT}/lib/python3.13/site-packages" \
|
||||
"${BLENDER_BUILD_DIR}/bin/5.2/python/lib/python3.13/site-packages"; do
|
||||
for private_lib_dir in "${site_packages}"/*.libs; do
|
||||
if [[ -d "${private_lib_dir}" ]]; then
|
||||
native_lib_dirs+=("${private_lib_dir}")
|
||||
fi
|
||||
done
|
||||
done
|
||||
if [[ -n "${LD_LIBRARY_PATH:-}" ]]; then
|
||||
native_lib_dirs+=("${LD_LIBRARY_PATH}")
|
||||
fi
|
||||
if ((${#native_lib_dirs[@]})); then
|
||||
IFS=:; export LD_LIBRARY_PATH="${native_lib_dirs[*]}"
|
||||
fi
|
||||
|
||||
export PATH="${BLENDER_PYTHON_ROOT}/bin:${PATH}"
|
||||
|
||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||
printf 'native-build-env-ok source=%s build=%s deps=%s\n' \
|
||||
"${BLENDER_SOURCE_DIR}" "${BLENDER_BUILD_DIR}" "${BLENDER_DEPS_ROOT}"
|
||||
printf 'compiler=%s\n' "$(command -v "${CC:-gcc-14}" || command -v gcc || printf 'missing')"
|
||||
printf 'cmake=%s ninja=%s\n' "$(command -v cmake || printf 'missing')" "$(command -v ninja || printf 'missing')"
|
||||
fi
|
||||
Reference in New Issue
Block a user