From f6f8f4e83b769d62189b2666c4b8d76f8cbf4456 Mon Sep 17 00:00:00 2001 From: Carl Kittelberger Date: Mon, 17 Apr 2017 23:13:20 +0200 Subject: [PATCH] Initial commit. --- .dockerignore | 4 ++ Dockerfile | 53 +++++++++++++++++++ README.md | 31 +++++++++++ ...-Add-missing-include-for-wait-method.patch | 24 +++++++++ ...2-Add-missing-parameter-in-wait-call.patch | 28 ++++++++++ 5 files changed, 140 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 bootil-patches/0001-Add-missing-include-for-wait-method.patch create mode 100644 bootil-patches/0002-Add-missing-parameter-in-wait-call.patch diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..52b5f5b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +Dockerfile +.dockerignore +.git* +*.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..921b692 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,53 @@ +FROM ubuntu:yakkety + +ARG GMAD_GIT_URL="https://github.com/garrynewman/gmad.git" +ARG GMAD_VERSION="377f3458bf1ecb8a1a2217c2194773e3c2a2dea0" +ARG BOOTIL_GIT_URL="https://github.com/garrynewman/bootil.git" +ARG BOOTIL_VERSION="1d3e321fc2be359e2350205b8c7f1cad2164ee0b" +COPY bootil-patches/ /usr/src/bootil-patches/ +RUN \ + apt-get update \ + && apt-get install -y \ + premake4 \ + g++ \ + make \ + git \ + && apt-mark auto \ + premake4 \ + g++ \ + make \ + git \ +\ + && git config --global user.email "docker@localhost" \ + && git config --global user.name "Docker" \ +\ + && git clone "${BOOTIL_GIT_URL}" /usr/src/bootil \ + && (cd /usr/src/bootil \ + && git checkout "${BOOTIL_VERSION}" \ + && git apply /usr/src/bootil-patches/* \ + && cd projects \ + && premake4 gmake \ + && cd linux/gmake \ + && make \ + ) \ +\ + && git clone "${GMAD_GIT_URL}" /usr/src/gmad \ + && (cd /usr/src/gmad \ + && git checkout "${GMAD_VERSION}" \ + && premake4 \ + --outdir="/usr/local/bin/" \ + --bootil_lib="/usr/src/bootil/lib/linux/gmake/" \ + --bootil_inc="/usr/src/bootil/include/" \ + gmake \ + && make -j$(nproc) \ + ) \ +\ + && apt-get autoremove --purge -y \ + && apt-get clean \ + && rm -rf \ + /tmp/* \ + /var/tmp/* \ + /var/lib/apt/lists/* \ + /usr/src/* + +ENTRYPOINT ["gmad"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..6c686fa --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# GMAD Docker image + +This image includes a static build of GMAD, the GMod Addon creation and +extraction tool that is usually shipped with Garry's Mod. +The entrypoint is configured to point directly at the binary so it is possible +to use `docker run` on this image just as if you would use GMAD directly on your +system. + +## Available tags + +All available tags are always listed [in Docker Hub](https://hub.docker.com/r/icedream/gmad/tags), +the list below explains the maintained tags: + +- `latest`, `1`, `1.1`: Latest stable version. + +## Examples + +### Creating an addon + +Creating an addon from the current directory and saving the newly generated +add-on file to `example.gma`: + + docker run --rm -it -v "$(pwd):/src" -w /src icedream/gmad \ + create -folder . -out example.gma + +### Extracting an addon + +Extracting an addon `example.gma` to the current directory: + + docker run --rm -it -v "$(pwd):/src" -w /src icedream/gmad \ + extract -file example.gma -out . diff --git a/bootil-patches/0001-Add-missing-include-for-wait-method.patch b/bootil-patches/0001-Add-missing-include-for-wait-method.patch new file mode 100644 index 0000000..feb5945 --- /dev/null +++ b/bootil-patches/0001-Add-missing-include-for-wait-method.patch @@ -0,0 +1,24 @@ +From 51b3af93a29ad39514698d9263b9685d0e8f5eea Mon Sep 17 00:00:00 2001 +From: Carl Kittelberger +Date: Mon, 17 Apr 2017 22:45:26 +0200 +Subject: [PATCH 1/2] Add missing #include for wait() method. + +--- + src/Bootil/Platform/Platform_LINUX.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/Bootil/Platform/Platform_LINUX.cpp b/src/Bootil/Platform/Platform_LINUX.cpp +index 35b7e98..3157e81 100644 +--- a/src/Bootil/Platform/Platform_LINUX.cpp ++++ b/src/Bootil/Platform/Platform_LINUX.cpp +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + #include + +-- +2.10.0.windows.1 + diff --git a/bootil-patches/0002-Add-missing-parameter-in-wait-call.patch b/bootil-patches/0002-Add-missing-parameter-in-wait-call.patch new file mode 100644 index 0000000..6a6a148 --- /dev/null +++ b/bootil-patches/0002-Add-missing-parameter-in-wait-call.patch @@ -0,0 +1,28 @@ +From 5edfb090a3632c26e6d3f1e60ed30e7bd3ea11ca Mon Sep 17 00:00:00 2001 +From: Carl Kittelberger +Date: Mon, 17 Apr 2017 22:57:57 +0200 +Subject: [PATCH 2/2] Add missing parameter in wait() call. + +--- + src/Bootil/Platform/Platform_LINUX.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/Bootil/Platform/Platform_LINUX.cpp b/src/Bootil/Platform/Platform_LINUX.cpp +index 3157e81..bb927e0 100644 +--- a/src/Bootil/Platform/Platform_LINUX.cpp ++++ b/src/Bootil/Platform/Platform_LINUX.cpp +@@ -221,8 +221,10 @@ namespace Bootil + { + bool isOk = ( pid > 0 ); + ++ int status; ++ + if ( isOk && AndWait ) +- { wait(); } ++ { wait(&status); } + } + else + { +-- +2.10.0.windows.1 +