From 47bd99a75d1608f634735831c86f53576e972d44 Mon Sep 17 00:00:00 2001 From: Matthew Faltys Date: Tue, 28 Jan 2020 18:09:55 +0000 Subject: [PATCH] Add working sotw build in docker --- .gitignore | 1 + Dockerfile | 41 +++++++++++++++++++++++++++++++++++++++++ Makefile | 12 ++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..335ec95 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.tar.gz diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ccff9ca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +FROM debian:stretch + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + git \ + g++ \ + libboost1.62-dev \ + libboost-all-dev \ + libncurses5-dev \ + libncursesw5-dev \ + libsdl2-dev \ + libxerces-c-dev \ + lua5.1 \ + liblua5.1-0-dev \ + libsdl2-image-2.0-0 \ + libsdl2-image-dev \ + make \ + premake4 \ + zlibc +RUN apt-get clean + +# fetch the sotw repo +RUN git clone https://github.com/prolog/shadow-of-the-wyrm +# cd shadow-of-the-wyrm && \ +# git checkout develop + +# build sotw +RUN cd shadow-of-the-wyrm && \ + premake4 --lua_include=/usr/include/lua5.1 --lua_link=lua5.1 gmake && \ + make config=release + +# update ini to be curses by default +RUN cd shadow-of-the-wyrm && \ + sed -i 's/display=sdl/display=curses/g' swyrm.ini + +# remove git data from package +RUN rm -rf shadow-of-the-wyrm/.git* + +RUN tar -czf shadow-of-the-wyrm.tar.gz shadow-of-the-wyrm/ + +CMD ["cp", "/shadow-of-the-wyrm.tar.gz", "/stage/"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3eb7a0a --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +STAGE_IMAGE_NAME=sotw +SOTW_VER=release-1.1.6 +OS_PERMS=sudo + +all: + $(OS_PERMS) docker build -t $(STAGE_IMAGE_NAME) . + $(OS_PERMS) docker run --name=tmpsotw -v $(shell pwd):/stage:rw $(STAGE_IMAGE_NAME) + $(OS_PERMS) docker rm tmpsotw + mv shadow-of-the-wyrm.tar.gz shadow-of-the-wyrm-$(SOTW_VER).tar.gz + +clean: + rm -rf *.tar.gz