Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer, web workflow engine and protocol, tooling, docs and task records. Large generated evidence, user-testing archives, build snapshots and imported test assets remain untracked. Co-Authored-By: Claude Code <noreply@anthropic.com>
76 lines
3.6 KiB
Python
76 lines
3.6 KiB
Python
#!/usr/bin/env python3
|
|
"""Build OpenColorIO and its dependencies from the supplied local Blender sources."""
|
|
|
|
import argparse
|
|
from pathlib import Path
|
|
import subprocess
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument("--sources", type=Path,
|
|
default=Path.home() / "working/build_oiio_deps/build")
|
|
parser.add_argument("--jobs", type=int, default=4)
|
|
parser.add_argument("--package", action="append",
|
|
choices=("zlib", "expat", "yamlcpp", "pystring", "imath",
|
|
"minizipng", "opencolorio"))
|
|
args = parser.parse_args()
|
|
base = ROOT / "build_web_ocio"
|
|
prefix = base / "install"
|
|
packages = [
|
|
("zlib", "", ["ZLIB_BUILD_EXAMPLES=OFF"]),
|
|
("expat", "expat", ["EXPAT_BUILD_TOOLS=OFF", "EXPAT_BUILD_EXAMPLES=OFF",
|
|
"EXPAT_BUILD_TESTS=OFF", "EXPAT_SHARED_LIBS=OFF",
|
|
"EXPAT_BUILD_DOCS=OFF",
|
|
# CPython namespaces its Expat API but not these internals.
|
|
"CMAKE_C_FLAGS="
|
|
"-Dg_reparseDeferralEnabledDefault=WebOCIO_reparseDeferralEnabledDefault "
|
|
"-D_INTERNAL_trim_to_complete_utf8_characters="
|
|
"WebOCIO_trim_to_complete_utf8_characters"]),
|
|
("yamlcpp", "", ["YAML_CPP_BUILD_TESTS=OFF", "YAML_CPP_BUILD_TOOLS=OFF",
|
|
"YAML_CPP_FORMAT_SOURCE=OFF", "YAML_CPP_INSTALL=ON"]),
|
|
("pystring", "", []),
|
|
("imath", "", ["IMATH_BUILD_TESTS=OFF", "IMATH_BUILD_PYTHON=OFF",
|
|
"IMATH_INSTALL_PKG_CONFIG=ON"]),
|
|
("minizipng", "", ["MZ_COMPAT=OFF", "MZ_BZIP2=OFF", "MZ_LZMA=OFF",
|
|
"MZ_ZSTD=OFF", "MZ_OPENSSL=OFF", "MZ_LIBBSD=OFF",
|
|
"MZ_PKCRYPT=OFF", "MZ_WZAES=OFF", "MZ_ICONV=OFF",
|
|
"MZ_FETCH_LIBS=OFF", "MZ_BUILD_TESTS=OFF",
|
|
"MZ_BUILD_UNIT_TESTS=OFF"]),
|
|
("opencolorio", "", ["OCIO_BUILD_APPS=OFF", "OCIO_BUILD_TESTS=OFF",
|
|
"OCIO_BUILD_GPU_TESTS=OFF", "OCIO_BUILD_PYTHON=OFF",
|
|
"OCIO_BUILD_DOCS=OFF", "OCIO_USE_SIMD=OFF",
|
|
"OCIO_INSTALL_EXT_PACKAGES=NONE",
|
|
"OCIO_INSTALL_EXT_LIBS=OFF"]),
|
|
]
|
|
for name, subdir, options in packages:
|
|
if args.package and name not in args.package:
|
|
continue
|
|
source = args.sources / name / "src" / ("external_" + name) / subdir
|
|
build = base / name
|
|
if name == "zlib":
|
|
# This pinned copy already has distinct Emscripten archive names.
|
|
source = ROOT / "blender-5.2.0/extern/zlib"
|
|
build = base / "zlib-web"
|
|
configure = [
|
|
"emcmake", "cmake", "-S", str(source), "-B", str(build), "-G", "Ninja",
|
|
"-DCMAKE_BUILD_TYPE=Release", "-DCMAKE_INSTALL_LIBDIR=lib",
|
|
"-DCMAKE_INSTALL_PREFIX=" + str(prefix),
|
|
"-DCMAKE_PREFIX_PATH=" + str(prefix),
|
|
"-DCMAKE_FIND_ROOT_PATH=" + str(prefix),
|
|
"-DCMAKE_CXX_FLAGS=-fexceptions", "-DBUILD_SHARED_LIBS=OFF",
|
|
"-DBUILD_TESTING=OFF",
|
|
*["-D" + option for option in options],
|
|
]
|
|
print("Building local dependency: " + name, flush=True)
|
|
subprocess.run(configure, cwd=ROOT, check=True)
|
|
subprocess.run(["cmake", "--build", str(build), "--target", "install",
|
|
"--parallel", str(args.jobs)], cwd=ROOT, check=True)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|