1DOLLY 72PACKAGE spidermonkey3REQUIRES HOST runtime@045# SpiderMonkey 128.13.0, the JavaScript library 0 A.D. links, for programs the6# cc package builds: upstream's mozbuild (configure.py and Make) with Dolly's7# CPython, Cargo, cbindgen and c++, from 0 A.D.'s pinned tarball and patches.8# The tools serve the build and are not installed with it; a program links9# -ljs_static -ljsrust -lz.10FROM /v0.1.6/Dollyfile-system-tools 69127104c12ae52e00d0e0a8787c3c99ece25f59a2c382fc9c811d66a090e5ec11INSTALL /v0.1.6/Dollyfile-zlib 48ee0a5552eada81c0324749ba5ce9a7d2a2505a91f3ffcaf51f81c36a641f8212USE /v0.1.6/demos/python/Dollyfile-python a2bee41935e12229aed6db1256f11dde6b22125b8696ca3d31afcf70f9d7295b13USE /v0.1.6/demos/rust/Dollyfile-cargo 0ff519fd8ddfb258f756f826a8cd144364968d3d4ece99d2650a8a12ac1a681414USE /v0.1.6/demos/rust/Dollyfile-cbindgen b92af9da77dbf25257071642aeb00dc1ff63415ce0d1b32c47434f7f6745f74015USE /v0.1.6/demos/zero-ad/Dollyfile-pkgconf c23689c5e826c5143377ee1b66de9a5c2830187fa84d6b7cc9bd4fe63e6d2bba16REQUIRES HEADER zlib17REQUIRES LIB z18REQUIRES TOOL cc19REQUIRES TOOL c++20REQUIRES TOOL ar21REQUIRES TOOL make22REQUIRES TOOL patch23REQUIRES TOOL tar24REQUIRES TOOL gzip25REQUIRES TOOL pkg-config26REQUIRES TOOL python27REQUIRES TOOL cargo28REQUIRES TOOL rustc29REQUIRES TOOL cbindgen30REQUIRES TOOL cp31REQUIRES TOOL mkdir32REQUIRES TOOL sh33REQUIRES TOOL rm3435# The pinned tree without its test suites, 0 A.D.'s patches and Dolly's.36SOURCE /v0.1.6/dist/static/spidermonkey/source.tar.gz a0e7bd4549c698ba1c84c437e4191345afde2e24746eb7ac41e7d799f1ba8808 /tmp/mozjs.tar.gz37SLOP gzip -dc /tmp/mozjs.tar.gz | tar -xf - -C /38SLOP CWD /tmp/mozjs/mozjs-128.13.0 sh ../patches/patch.sh39SLOP patch -p1 -d /tmp/mozjs/mozjs-128.13.0 -i /tmp/mozjs/spidermonkey.patch4041# The host build's configuration: mozbuild knows no Dolly OS, so the compiler42# names the target as the host build did (-D__wasi__, wasm64-unknown-wasi) and43# Dolly builds on the same triple. No JIT, no Intl, no tests, no debug symbols.44# A standalone JS build uses no bindgen, but configure still looks for libclang;45# naming Dolly's library directory (which holds none) takes mozbuild's own46# --with-libclang-path route and skips its `c++ -print-search-dirs` probe,47# a spelling Dolly's cc does not have.48FILE /tmp/mozjs/build.slop49    set -e50    export MOZCONFIG=/dev/null MOZBUILD_STATE_PATH=/tmp/mozjs/state51    export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=none RUSTC_BOOTSTRAP=1 CRATE_CC_NO_DEFAULTS=152    export CC='cc -D__wasi__' CXX='c++ -D__wasi__' HOST_CC='cc -D__wasi__' HOST_CXX='c++ -D__wasi__'53    export AR=ar RUST_TARGET=wasm64-emscripten-probe CBINDGEN=/usr/bin/cbindgen54    mkdir /tmp/mozjs/mozjs-128.13.0/obj55    cd /tmp/mozjs/mozjs-128.13.0/obj56    python ../configure.py --enable-project=js --host=wasm64-unknown-wasi --target=wasm64-unknown-wasi \57      --disable-jit --disable-shared-js --without-intl-api --disable-tests --disable-js-shell \58      --disable-jemalloc --disable-debug --enable-optimize=-O2 --disable-debug-symbols \59      --disable-bootstrap --disable-warnings-as-errors --with-libclang-path=/usr/lib60    # Cargo links the Rust library and its build scripts through Dolly's rustc61    # linker adapter, which translates the Emscripten target's linker vocabulary62    # to cc; mozbuild would otherwise hand cc the raw -s/EXPORTED_FUNCTIONS flags.63    L=/opt/rust-sdk/bin/dolly-rust-link64    make -j4 MOZ_CARGO_WRAP_LD=$L MOZ_CARGO_WRAP_HOST_LD=$L MOZ_CARGO_WRAP_LD_CXX=$L \65      MOZ_CARGO_WRAP_HOST_LD_CXX=$L MOZ_CARGO_WRAP_LDFLAGS= MOZ_CARGO_WRAP_HOST_LDFLAGS=66    mkdir -p /opt/mozjs/lib /usr/share/licenses/spidermonkey/crates67    # dist/include is 328 symlinks into the source tree, which is not retained;68    # copytree dereferences them (Dolly's cp has no -L).69    python -c 'import shutil; shutil.copytree("dist/include", "/opt/mozjs/include", symlinks=False)'70    cp js/src/build/libjs_static.a wasm64-emscripten-probe/release/libjsrust.a /opt/mozjs/lib/71    ls -l /opt/mozjs/lib72    cp ../LICENSE /usr/share/licenses/spidermonkey/LICENSE73    cp ../nsprpub/LICENSE /usr/share/licenses/spidermonkey/MPL-2.074    # The notices of the crates compiled into libjsrust.a.75    for crate in $(ls wasm64-emscripten-probe/release/deps | sed -nE 's/^lib(.+)-[0-9a-f]{16}\.rlib$/\1/p' | sort -u); do76      for name in $crate $(echo $crate | tr _ -); do77        [ -d ../third_party/rust/$name ] || continue78        for notice in LICENSE LICENSE-MIT LICENSE-APACHE LICENSE-MPL LICENSE.txt LICENSE.md COPYING COPYRIGHT UNLICENSE; do79          [ -f ../third_party/rust/$name/$notice ] || continue80          mkdir -p /usr/share/licenses/spidermonkey/crates/$name81          cp ../third_party/rust/$name/$notice /usr/share/licenses/spidermonkey/crates/$name/$notice82        done83        break84      done85    done86SLOP time slop -e /tmp/mozjs/build.slop8788EXPORTS LIB    js_static /opt/mozjs/lib/libjs_static.a89EXPORTS LIB    jsrust    /opt/mozjs/lib/libjsrust.a90EXPORTS HEADER mozjs-128 /opt/mozjs/include91FILE /usr/lib/pkgconfig/mozjs-128.pc92    Name: SpiderMonkey 128.13.093    Description: The Mozilla library for JavaScript94    Version: 128.13.095    Cflags: -I/opt/mozjs/include96    Libs: -L/opt/mozjs/lib -ljs_static -ljsrust -lz97FOLDER /usr/share/licenses/spidermonkey98SLOP rm -rf /tmp/mozjs /tmp/mozjs.tar.gz99