diff --git a/.tgs.yml b/.tgs.yml new file mode 100644 index 000000000000..ba3fc6b26c66 --- /dev/null +++ b/.tgs.yml @@ -0,0 +1,12 @@ +version: 1 +byond: "514.1588" +static_files: + - name: config + - name: data +linux_scripts: + PreCompile.sh: tools/tgs_scripts/PreCompile.sh + WatchdogLaunch.sh: tools/tgs_scripts/WatchdogLaunch.sh + InstallDeps.sh: tools/tgs_scripts/InstallDeps.sh +windows_scripts: + PreCompile.bat: tools/tgs_scripts/PreCompile.bat +security: Trusted diff --git a/libmariadb.dll b/libmariadb.dll deleted file mode 100644 index 7472264d89b8..000000000000 Binary files a/libmariadb.dll and /dev/null differ diff --git a/libmysql.dll b/libmysql.dll deleted file mode 100644 index 746f19ef9d9f..000000000000 Binary files a/libmysql.dll and /dev/null differ diff --git a/tools/tgs4_scripts/PreCompile.sh b/tools/tgs4_scripts/PreCompile.sh deleted file mode 100644 index b445ea0559c8..000000000000 --- a/tools/tgs4_scripts/PreCompile.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash - -# REPO MAINTAINERS: KEEP CHANGES TO THIS IN SYNC WITH /tools/LinuxOneShot/SetupProgram/PreCompile.sh -# No ~mso -set -e -set -x - -#load dep exports -#need to switch to game dir for Dockerfile weirdness -original_dir=$PWD -cd "$1" -. dependencies.sh -cd "$original_dir" - -#find out what we have (+e is important for this) -set +e -has_git="$(command -v git)" -has_cargo="$(command -v ~/.cargo/bin/cargo)" -has_sudo="$(command -v sudo)" -has_grep="$(command -v grep)" -has_youtubedl="$(command -v youtube-dl)" -has_pip3="$(command -v pip3)" -set -e - -# install cargo if needed -if ! [ -x "$has_cargo" ]; then - echo "Installing rust..." - curl https://sh.rustup.rs -sSf | sh -s -- -y - . ~/.profile -fi - -# apt packages, libssl needed by rust-g but not included in TGS barebones install -if ! ( [ -x "$has_git" ] && [ -x "$has_grep" ] && [ -f "/usr/lib/i386-linux-gnu/libssl.so" ] ); then - echo "Installing apt dependencies..." - if ! [ -x "$has_sudo" ]; then - dpkg --add-architecture i386 - apt-get update - apt-get install -y git libssl-dev:i386 - rm -rf /var/lib/apt/lists/* - else - sudo dpkg --add-architecture i386 - sudo apt-get update - sudo apt-get install -y git libssl-dev:i386 - sudo rm -rf /var/lib/apt/lists/* - fi -fi -dpkg --add-architecture i386 -apt-get update -apt-get install -y zlib1g:i386 zlib1g-dev:i386 pkg-config libssl-dev:i386 libssl-dev libssl1.1:i386 gcc-multilib -# update rust-g -if [ ! -d "rust-g" ]; then - echo "Cloning rust-g..." - git clone https://github.com/tgstation/rust-g - cd rust-g - ~/.cargo/bin/rustup target add i686-unknown-linux-gnu -else - echo "Fetching rust-g..." - cd rust-g - git fetch - ~/.cargo/bin/rustup target add i686-unknown-linux-gnu -fi - -echo "Deploying rust-g..." -git checkout "$RUST_G_VERSION" -~/.cargo/bin/rustup update stable -~/.cargo/bin/cargo update -env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-unknown-linux-gnu -mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so" -cd .. - -# install or update youtube-dl when not present, or if it is present with pip3, -# which we assume was used to install it -if ! [ -x "$has_youtubedl" ]; then - echo "Installing youtube-dl with pip3..." - if ! [ -x "$has_sudo" ]; then - apt-get install -y python3 python3-pip - else - sudo apt-get install -y python3 python3-pip - fi - pip3 install youtube-dl -elif [ -x "$has_pip3" ]; then - echo "Ensuring youtube-dl is up-to-date with pip3..." - pip3 install youtube-dl -U -fi - -# compile tgui -echo "Compiling tgui..." -cd "$1" -chmod +x tools/bootstrap/node # Workaround for https://github.com/tgstation/tgstation-server/issues/1167 -env TG_BOOTSTRAP_CACHE="$original_dir" TG_BOOTSTRAP_NODE_LINUX=1 CBT_BUILD_MODE="TGS" tools/bootstrap/node tools/build/build.js - -echo "Running changelog script..." -python3 .github/ss13_genchangelog.py html/changelogs diff --git a/tools/tgs4_scripts/WatchdogLaunch.sh b/tools/tgs_scripts/InstallDeps.sh similarity index 50% rename from tools/tgs4_scripts/WatchdogLaunch.sh rename to tools/tgs_scripts/InstallDeps.sh index cf226fd670da..6b75c49bb086 100644 --- a/tools/tgs4_scripts/WatchdogLaunch.sh +++ b/tools/tgs_scripts/InstallDeps.sh @@ -1,19 +1,29 @@ #!/bin/bash -# Special file to ensure all dependencies still exist between server lanuches. -# Mainly for use by people who abuse docker by modifying the container's system. -set -e -set -x - #find out what we have (+e is important for this) set +e has_git="$(command -v git)" +has_curl="$(command -v curl)" has_cargo="$(command -v ~/.cargo/bin/cargo)" has_sudo="$(command -v sudo)" -has_grep="$(command -v grep)" has_youtubedl="$(command -v youtube-dl)" has_pip3="$(command -v pip3)" set -e +set -x + +# apt packages, libssl needed by rust-g but not included in TGS barebones install +if ! ( [ -x "$has_git" ] && [ -x "$has_curl" ] && [ -f "/usr/lib/i386-linux-gnu/libssl.so" ] ); then + echo "Installing apt dependencies..." + if ! [ -x "$has_sudo" ]; then + dpkg --add-architecture i386 + apt-get update + apt-get install -y lib32z1 git pkg-config libssl-dev:i386 libssl-dev zlib1g-dev:i386 curl + else + sudo dpkg --add-architecture i386 + sudo apt-get update + sudo apt-get install -y lib32z1 git pkg-config libssl-dev:i386 libssl-dev zlib1g-dev:i386 curl + fi +fi # install cargo if needed if ! [ -x "$has_cargo" ]; then @@ -22,20 +32,19 @@ if ! [ -x "$has_cargo" ]; then . ~/.profile fi -# apt packages, libssl needed by rust-g but not included in TGS barebones install -if ! ( [ -x "$has_git" ] && [ -x "$has_grep" ] && [ -f "/usr/lib/i386-linux-gnu/libssl.so" ] ); then - dpkg --add-architecture i386 - apt-get update - apt-get install -y lib32z1 git pkg-config libssl-dev:i386 libssl-dev libssl1.1:i386 gcc-multilib lib32z1-dev -fi - -# install youtube-dl when not present +# install or update youtube-dl when not present, or if it is present with pip3, +# which we assume was used to install it if ! [ -x "$has_youtubedl" ]; then echo "Installing youtube-dl with pip3..." if ! [ -x "$has_sudo" ]; then + apt-get update apt-get install -y python3 python3-pip else + sudo apt-get update sudo apt-get install -y python3 python3-pip fi pip3 install youtube-dl +elif [ -x "$has_pip3" ]; then + echo "Ensuring youtube-dl is up-to-date with pip3..." + pip3 install youtube-dl -U fi diff --git a/tools/tgs_scripts/PreCompile.bat b/tools/tgs_scripts/PreCompile.bat new file mode 100644 index 000000000000..ce7572c9ef4e --- /dev/null +++ b/tools/tgs_scripts/PreCompile.bat @@ -0,0 +1,15 @@ +@echo off +cd /D "%~dp0" +set TG_BOOTSTRAP_CACHE=%cd% +IF NOT %1 == "" ( + rem TGS4+: we are passed the game directory on the command line + cd %1 +) ELSE IF EXIST "..\Game\B\tgstation.dmb" ( + rem TGS3: Game/B/tgstation.dmb exists, so build in Game/A + cd ..\Game\A +) ELSE ( + rem TGS3: Otherwise build in Game/B + cd ..\Game\B +) +set CBT_BUILD_MODE=TGS +tools\build\build diff --git a/tools/tgs_scripts/PreCompile.sh b/tools/tgs_scripts/PreCompile.sh new file mode 100644 index 000000000000..f859b8e344cd --- /dev/null +++ b/tools/tgs_scripts/PreCompile.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +./InstallDeps.sh + +set -e +set -x + +#load dep exports +#need to switch to game dir for Dockerfile weirdness +original_dir=$PWD +cd "$1" +. dependencies.sh +cd "$original_dir" + +# update rust-g +if [ ! -d "rust-g" ]; then + echo "Cloning rust-g..." + git clone https://github.com/tgstation/rust-g + cd rust-g + ~/.cargo/bin/rustup target add i686-unknown-linux-gnu +else + echo "Fetching rust-g..." + cd rust-g + git fetch + ~/.cargo/bin/rustup target add i686-unknown-linux-gnu +fi + +echo "Deploying rust-g..." +git checkout "$RUST_G_VERSION" +env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-unknown-linux-gnu --features redis_pubsub +mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so" +cd .. + +# compile tgui +echo "Compiling tgui..." +cd "$1" +chmod +x tools/bootstrap/node # Workaround for https://github.com/tgstation/tgstation-server/issues/1167 +env TG_BOOTSTRAP_CACHE="$original_dir" TG_BOOTSTRAP_NODE_LINUX=1 CBT_BUILD_MODE="TGS" tools/bootstrap/node tools/build/build.js + +echo "Running changelog script..." +python3 .github/ss13_genchangelog.py html/changelogs diff --git a/tools/tgs4_scripts/PreSynchronize.sh b/tools/tgs_scripts/PreSynchronize.sh similarity index 100% rename from tools/tgs4_scripts/PreSynchronize.sh rename to tools/tgs_scripts/PreSynchronize.sh diff --git a/tools/tgs_scripts/WatchdogLaunch.sh b/tools/tgs_scripts/WatchdogLaunch.sh new file mode 100644 index 000000000000..cd400cbb969b --- /dev/null +++ b/tools/tgs_scripts/WatchdogLaunch.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Special file to ensure all dependencies still exist between server launches. +# Mainly for use by people who abuse docker by modifying the container's system. + +./InstallDeps.sh