#!/usr/bin/env bash # Run in an isolated build directory. No game executable runs on the host. set -euo pipefail revision=6bbf0925d221a7304ea8e0dda1e89b8dc01569b2 git clone https://github.com/caiiiycuk/emulators.git emulators cd emulators git checkout "$revision" git config submodule.native/dosbox.url https://github.com/js-dos/dosbox.git git config submodule.native/dosbox-x.url https://github.com/js-dos/dosbox-x.git git config submodule.native/sokol-tools-bin.url https://github.com/floooh/sokol-tools-bin.git git submodule update --init --recursive # Upstream Dockerfile pins Emscripten 3.1.28. Use its isolated image/toolchain. # The npm published binary is used unchanged; this recipe has not been rebuilt here. command -v emcc >/dev/null || { echo 'Activate isolated Emscripten 3.1.28 first.' >&2; exit 1; } emcc --version | head -1 | grep -q '3.1.28' || { echo 'Expected Emscripten 3.1.28.' >&2; exit 1; } command -v yarn >/dev/null || { echo 'Provide Yarn in the isolated build environment.' >&2; exit 1; } yarn --frozen-lockfile yarn gulp wasm yarn gulp # Selected outputs: dist/emulators.js dist/wdosbox.js dist/wdosbox.wasm # Compatibility engine: dist/wdosbox-x.js dist/wdosbox-x.wasm