wip
This commit is contained in:
+24
-18
@@ -20,26 +20,32 @@ else
|
||||
ENGINE=docker
|
||||
fi
|
||||
|
||||
if [ ! -d "$SRC/.git" ]; then
|
||||
git clone --depth 1 --branch "$TAG" https://github.com/espressif/qemu "$SRC"
|
||||
fi
|
||||
# Dev Mode - Build directly out of an already-patched working tree (e.g. _scratch/qemu-fix-src);
|
||||
# skip clone/commit-check/patch so edits compile incrementally without the patch round-trip.
|
||||
if [ -n "${QEMU_WASM_DEV:-}" ]; then
|
||||
cd "$SRC"
|
||||
else
|
||||
if [ ! -d "$SRC/.git" ]; then
|
||||
git clone --depth 1 --branch "$TAG" https://github.com/espressif/qemu "$SRC"
|
||||
fi
|
||||
|
||||
cd "$SRC"
|
||||
if [ "$(git rev-parse HEAD)" != "$COMMIT" ]; then
|
||||
echo "QEMU source must be $COMMIT ($TAG)" >&2
|
||||
exit 1
|
||||
fi
|
||||
cd "$SRC"
|
||||
if [ "$(git rev-parse HEAD)" != "$COMMIT" ]; then
|
||||
echo "QEMU source must be $COMMIT ($TAG)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Re-apply Patches On Drift - The source tree is a build artifact of the patches; reset and re-apply whenever a patch is newer than the last apply so `make web` never silently rebuilds stale sources.
|
||||
STAMP=".xteink-patch-stamp"
|
||||
if [ ! -f hw/display/xteink_x3_eink.c ] || [ ! -f tcg/wasm32.c ] \
|
||||
|| [ "$ROOT/qemu/patches/0001-xteink-machine.patch" -nt "$STAMP" ] \
|
||||
|| [ "$ROOT/qemu/patches/0002-qemu-wasm.patch" -nt "$STAMP" ]; then
|
||||
git reset --hard "$COMMIT"
|
||||
git clean -fdx -e build
|
||||
git apply "$ROOT/qemu/patches/0001-xteink-machine.patch"
|
||||
git apply --whitespace=nowarn "$ROOT/qemu/patches/0002-qemu-wasm.patch"
|
||||
touch "$STAMP"
|
||||
# Re-apply Patches On Drift - The source tree is a build artifact of the patches; reset and re-apply whenever a patch is newer than the last apply so `make web` never silently rebuilds stale sources.
|
||||
STAMP=".xteink-patch-stamp"
|
||||
if [ ! -f hw/display/xteink_x3_eink.c ] || [ ! -f tcg/wasm32.c ] \
|
||||
|| [ "$ROOT/qemu/patches/0001-xteink-machine.patch" -nt "$STAMP" ] \
|
||||
|| [ "$ROOT/qemu/patches/0002-qemu-wasm.patch" -nt "$STAMP" ]; then
|
||||
git reset --hard "$COMMIT"
|
||||
git clean -fdx -e build
|
||||
git apply "$ROOT/qemu/patches/0001-xteink-machine.patch"
|
||||
git apply --whitespace=nowarn "$ROOT/qemu/patches/0002-qemu-wasm.patch"
|
||||
touch "$STAMP"
|
||||
fi
|
||||
fi
|
||||
|
||||
printf 'Building Emscripten environment (qemu-wasm %s)\n' "$QEMU_WASM_COMMIT"
|
||||
|
||||
Reference in New Issue
Block a user