1DOLLY 72TOOLCHAIN zero-ad-spidermonkey3REQUIRES HOST runtime@04REQUIRES HOST audio@05REQUIRES HOST display@06REQUIRES HOST download@07REQUIRES HOST dso@08REQUIRES HOST http@09REQUIRES HOST input@010REQUIRES HOST sockets@011REQUIRES HOST threads@012REQUIRES HOST upload@01314# Build-only: SpiderMonkey 128.13.0, the engine's JavaScript library, built by15# upstream's mozbuild (configure.py and Make) with Dolly's CPython, Cargo,16# cbindgen and c++ from 0 A.D.'s pinned tarball and patches.17FROM /v0.1.2/demos/zero-ad/Dollyfile-zero-ad-deps 885e93b8eb52cd42e4d691fd12580893ecf8614d1791ce6b2d179274e66db7ae18INSTALL /v0.1.2/demos/python/Dollyfile-python 5b036ab5bdd21eab0797e497b06abe8d6adb076f29f7ff9823e7c038d353b8c319INSTALL /v0.1.2/demos/rust/Dollyfile-cargo ae08f8528c040e5b44e2d445b9cbf3aff0ffe8990e4e352fc136b4a50b371cf820INSTALL /v0.1.2/demos/rust/Dollyfile-cbindgen 916ca5772b8c4188789b46e55772b400801bc92e6117e885bf23be566024e81c21REQUIRES HEADER zlib22REQUIRES LIB z23REQUIRES TOOL cc24REQUIRES TOOL c++25REQUIRES TOOL ar26REQUIRES TOOL make27REQUIRES TOOL patch28REQUIRES TOOL tar29REQUIRES TOOL gzip30REQUIRES TOOL pkg-config31REQUIRES TOOL python32REQUIRES TOOL cargo33REQUIRES TOOL rustc34REQUIRES TOOL cbindgen35REQUIRES TOOL cp36REQUIRES TOOL mkdir37REQUIRES TOOL sh3839# The pinned tree without its test suites, 0 A.D.'s patches and Dolly's.40SOURCE /v0.1.2/dist/static/zero-ad-build/mozjs.tar.gz a0e7bd4549c698ba1c84c437e4191345afde2e24746eb7ac41e7d799f1ba8808 /tmp/mozjs.tar.gz41SLOP gzip -dc /tmp/mozjs.tar.gz | tar -xf - -C /42SLOP CWD /tmp/mozjs/mozjs-128.13.0 sh ../patches/patch.sh43SLOP patch -p1 -d /tmp/mozjs/mozjs-128.13.0 -i /tmp/mozjs/spidermonkey.patch4445# The host build's configuration: mozbuild knows no Dolly OS, so the compiler46# names the target as the host build did (-D__wasi__, wasm64-unknown-wasi) and47# Dolly builds on the same triple. No JIT, no Intl, no tests, no debug symbols.48# A standalone JS build uses no bindgen, but configure still looks for libclang;49# naming Dolly's library directory (which holds none) takes mozbuild's own50# --with-libclang-path route and skips its `c++ -print-search-dirs` probe,51# a spelling Dolly's cc does not have.52FILE /tmp/mozjs/build.slop53    set -e54    export MOZCONFIG=/dev/null MOZBUILD_STATE_PATH=/tmp/mozjs/state55    export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none RUSTC_BOOTSTRAP=1 CRATE_CC_NO_DEFAULTS=156    export CC='cc -D__wasi__' CXX='c++ -D__wasi__' HOST_CC='cc -D__wasi__' HOST_CXX='c++ -D__wasi__'57    export AR=ar RUST_TARGET=wasm64-emscripten-probe CBINDGEN=/usr/bin/cbindgen58    mkdir /tmp/mozjs/mozjs-128.13.0/obj59    cd /tmp/mozjs/mozjs-128.13.0/obj60    python ../configure.py --enable-project=js --host=wasm64-unknown-wasi --target=wasm64-unknown-wasi \61      --disable-jit --disable-shared-js --without-intl-api --disable-tests --disable-js-shell \62      --disable-jemalloc --disable-debug --enable-optimize=-O2 --disable-debug-symbols \63      --disable-bootstrap --disable-warnings-as-errors --with-libclang-path=/usr/lib64    # Cargo links the Rust library and its build scripts through Dolly's rustc65    # linker adapter, which translates the Emscripten target's linker vocabulary66    # to cc; mozbuild would otherwise hand cc the raw -s/EXPORTED_FUNCTIONS flags.67    L=/opt/rust-sdk/bin/dolly-rust-link68    make -j4 MOZ_CARGO_WRAP_LD=$L MOZ_CARGO_WRAP_HOST_LD=$L MOZ_CARGO_WRAP_LD_CXX=$L \69      MOZ_CARGO_WRAP_HOST_LD_CXX=$L MOZ_CARGO_WRAP_LDFLAGS= MOZ_CARGO_WRAP_HOST_LDFLAGS=70    mkdir -p /opt/mozjs/lib /usr/share/licenses/spidermonkey/crates71    # dist/include is 328 symlinks into the source tree, which is not retained;72    # copytree dereferences them (Dolly's cp has no -L).73    python -c 'import shutil; shutil.copytree("dist/include", "/opt/mozjs/include", symlinks=False)'74    cp js/src/build/libjs_static.a wasm64-emscripten-probe/release/libjsrust.a /opt/mozjs/lib/75    ls -l /opt/mozjs/lib76    cp ../LICENSE /usr/share/licenses/spidermonkey/LICENSE77    cp ../nsprpub/LICENSE /usr/share/licenses/spidermonkey/MPL-2.078    # The notices of the crates compiled into libjsrust.a.79    for crate in $(ls wasm64-emscripten-probe/release/deps | sed -nE 's/^lib(.+)-[0-9a-f]{16}\.rlib$/\1/p' | sort -u); do80      for name in $crate $(echo $crate | tr _ -); do81        [ -d ../third_party/rust/$name ] || continue82        for notice in LICENSE LICENSE-MIT LICENSE-APACHE LICENSE-MPL LICENSE.txt LICENSE.md COPYING COPYRIGHT UNLICENSE; do83          [ -f ../third_party/rust/$name/$notice ] || continue84          mkdir -p /usr/share/licenses/spidermonkey/crates/$name85          cp ../third_party/rust/$name/$notice /usr/share/licenses/spidermonkey/crates/$name/$notice86        done87        break88      done89    done90SLOP time slop -e /tmp/mozjs/build.slop91FOLDER /opt/mozjs92FOLDER /usr/share/licenses/spidermonkey9394ENTRY /bin/foreground -i /bin/slop95