Initial commit
This commit is contained in:
commit
3dd53cf457
105 changed files with 35670 additions and 0 deletions
28
docker/Dockerfile
Normal file
28
docker/Dockerfile
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
FROM registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt update && apt install -y \
|
||||
build-essential \
|
||||
g++ \
|
||||
cmake \
|
||||
ninja-build \
|
||||
git \
|
||||
zlib1g \
|
||||
zlib1g-dev \
|
||||
libssl-dev \
|
||||
libprotobuf-dev \
|
||||
protobuf-compiler \
|
||||
pkg-config \
|
||||
libcurl4-openssl-dev \
|
||||
libmaxminddb-dev \
|
||||
curl
|
||||
|
||||
RUN git config --system --add safe.directory '*'
|
||||
|
||||
COPY docker/docker-entrypoint.sh ./docker-entrypoint.sh
|
||||
RUN sed -i 's/\r$//' ./docker-entrypoint.sh && chmod +x ./docker-entrypoint.sh
|
||||
|
||||
WORKDIR /app/source
|
||||
|
||||
CMD ["/bin/bash", "../docker-entrypoint.sh"]
|
||||
8
docker/docker-compose.yml
Normal file
8
docker/docker-compose.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
services:
|
||||
builder:
|
||||
image: cmake-builder
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile
|
||||
volumes:
|
||||
- ..:/app/source
|
||||
53
docker/docker-entrypoint.sh
Normal file
53
docker/docker-entrypoint.sh
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
git submodule update --init --recursive
|
||||
|
||||
if git describe --tags --exact-match >/dev/null 2>&1; then
|
||||
export SEMVER="$(git describe --tags --exact-match)"
|
||||
fi
|
||||
|
||||
export GITHUB_SHA_SHORT="$(git rev-parse --short HEAD)"
|
||||
|
||||
### --- Download HL2SDK-CS2 + Metamod-Source -------------------------------
|
||||
SDK_DIR="/tmp/sdk"
|
||||
HL2SDK_DIR="$SDK_DIR/hl2sdk-cs2"
|
||||
MMSOURCE_DIR="$SDK_DIR/metamod-source"
|
||||
CSGO_PROTO_DIR="$SDK_DIR/Protobufs"
|
||||
|
||||
echo "=== Preparing temporary SDK directory ==="
|
||||
rm -rf "$SDK_DIR"
|
||||
mkdir -p "$SDK_DIR"
|
||||
|
||||
echo "=== Downloading HL2SDK-CS2 ==="
|
||||
git clone --depth=1 -b cs2 https://github.com/alliedmodders/hl2sdk "$HL2SDK_DIR"
|
||||
|
||||
echo "=== Downloading Metamod-Source ==="
|
||||
git clone --depth=1 https://github.com/alliedmodders/metamod-source "$MMSOURCE_DIR"
|
||||
|
||||
echo "=== Downloading Protobufs ==="
|
||||
git clone --depth=1 https://github.com/SteamDatabase/Protobufs "$CSGO_PROTO_DIR"
|
||||
|
||||
### --- Export env vars for CMake ------------------------------------------
|
||||
export HL2SDKCS2="$HL2SDK_DIR"
|
||||
export MMSOURCE_DEV="$MMSOURCE_DIR"
|
||||
export CSGO_PROTO="$CSGO_PROTO_DIR/csgo"
|
||||
|
||||
echo "Using HL2SDKCS2=$HL2SDKCS2"
|
||||
echo "Using MMSOURCE_DEV=$MMSOURCE_DEV"
|
||||
echo "Using CSGO_PROTO=$CSGO_PROTO"
|
||||
|
||||
### --- Build ---------------------------------------------------------------
|
||||
echo "=== Starting build ==="
|
||||
|
||||
rm -rf build
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
cmake .. \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_C_COMPILER=gcc \
|
||||
-DCMAKE_CXX_COMPILER=g++
|
||||
|
||||
echo "=== Building with GCC | Release | All ==="
|
||||
cmake --build . --config Release -j"$(nproc)"
|
||||
Loading…
Add table
Add a link
Reference in a new issue