diff --git a/README.md b/README.md index 05ee92dc..43aa4de5 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,12 @@ sudo pacman -S sdl2 glew glm openssl cmake base-devel \ stormlib # for asset_extract ``` +### Container build +You can use podman to build application in separate container. +- Install podman +- Then run `container/build-in-container.sh` +- Artifacts can be found in `/tmp/wowee.[random value].[commit hash]` + ### Game Data This project requires WoW client data that you extract from your own legally obtained install. diff --git a/container/build-in-container.sh b/container/build-in-container.sh new file mode 100755 index 00000000..cc0822b4 --- /dev/null +++ b/container/build-in-container.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -eu +set -o pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" + +podman build \ + -f "${SCRIPT_DIR}/builder-ubuntu.Dockerfile" \ + -t wowee-builder-ubuntu + +BUILD_DIR="$(mktemp --tmpdir -d wowee.XXXXX \ + --suffix=".$(cd "${PROJECT_ROOT}"; git rev-parse --short HEAD)")" +podman run \ + --mount "type=bind,src=${PROJECT_ROOT},dst=/WoWee-src,ro=true" \ + --mount "type=bind,src=${BUILD_DIR},dst=/build" \ + localhost/wowee-builder-ubuntu \ + ./build-wowee.sh diff --git a/container/build-wowee.sh b/container/build-wowee.sh new file mode 100755 index 00000000..aabd8396 --- /dev/null +++ b/container/build-wowee.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -eu +set -o pipefail + +cp -r /WoWee-src /WoWee + +pushd /WoWee +./build.sh +popd + +pushd /WoWee/build +cmake --install . --prefix=/build +popd diff --git a/container/builder-ubuntu.Dockerfile b/container/builder-ubuntu.Dockerfile new file mode 100644 index 00000000..13da080f --- /dev/null +++ b/container/builder-ubuntu.Dockerfile @@ -0,0 +1,23 @@ +FROM ubuntu:24.04 + +RUN apt-get update && \ + apt install -y \ + cmake \ + build-essential \ + pkg-config \ + git \ + libsdl2-dev \ + libglew-dev \ + libglm-dev \ + libssl-dev \ + zlib1g-dev \ + libavformat-dev \ + libavcodec-dev \ + libswscale-dev \ + libavutil-dev \ + libstorm-dev && \ + rm -rf /var/lib/apt/lists/* + +COPY build-wowee.sh / + +ENTRYPOINT ./build-wowee.sh