use yogs version

This commit is contained in:
Katherine Kiefer
2022-03-01 11:21:14 +11:00
parent e9344a7164
commit 981afd3ce8

View File

@@ -1,94 +1,94 @@
#!/bin/bash #!/bin/bash
# REPO MAINTAINERS: KEEP CHANGES TO THIS IN SYNC WITH /tools/LinuxOneShot/SetupProgram/PreCompile.sh # REPO MAINTAINERS: KEEP CHANGES TO THIS IN SYNC WITH /tools/LinuxOneShot/SetupProgram/PreCompile.sh
# No ~mso # No ~mso
set -e set -e
set -x set -x
#load dep exports #load dep exports
#need to switch to game dir for Dockerfile weirdness #need to switch to game dir for Dockerfile weirdness
original_dir=$PWD original_dir=$PWD
cd "$1" cd "$1"
. dependencies.sh . dependencies.sh
cd "$original_dir" cd "$original_dir"
#find out what we have (+e is important for this) #find out what we have (+e is important for this)
set +e set +e
has_git="$(command -v git)" has_git="$(command -v git)"
has_cargo="$(command -v ~/.cargo/bin/cargo)" has_cargo="$(command -v ~/.cargo/bin/cargo)"
has_sudo="$(command -v sudo)" has_sudo="$(command -v sudo)"
has_grep="$(command -v grep)" has_grep="$(command -v grep)"
set -e set -e
# install cargo if needful # install cargo if needful
if ! [ -x "$has_cargo" ]; then if ! [ -x "$has_cargo" ]; then
echo "Installing rust..." echo "Installing rust..."
curl https://sh.rustup.rs -sSf | sh -s -- -y curl https://sh.rustup.rs -sSf | sh -s -- -y
. ~/.profile . ~/.profile
fi fi
# apt packages, libssl needed by rust-g but not included in TGS barebones install # 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 if ! ( [ -x "$has_git" ] && [ -x "$has_grep" ] && [ -f "/usr/lib/i386-linux-gnu/libssl.so" ] ); then
echo "Installing apt dependencies..." echo "Installing apt dependencies..."
if ! [ -x "$has_sudo" ]; then if ! [ -x "$has_sudo" ]; then
dpkg --add-architecture i386 dpkg --add-architecture i386
apt-get update apt-get update
apt-get install -y git libssl-dev:i386 apt-get install -y git libssl-dev:i386
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
else else
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
sudo apt-get update sudo apt-get update
sudo apt-get install -y git libssl-dev:i386 sudo apt-get install -y git libssl-dev:i386
sudo rm -rf /var/lib/apt/lists/* sudo rm -rf /var/lib/apt/lists/*
fi fi
fi fi
dpkg --add-architecture i386 dpkg --add-architecture i386
apt-get update apt-get update
#apt-get upgrade -y #apt-get upgrade -y
apt-get install -y lib32z1 pkg-config libssl-dev:i386 libssl-dev apt-get install -y lib32z1 pkg-config libssl-dev:i386 libssl-dev
#update rust-g #update rust-g
if [ ! -d "rust-g" ]; then if [ ! -d "rust-g" ]; then
echo "Cloning rust-g..." echo "Cloning rust-g..."
git clone https://github.com/tgstation/rust-g git clone https://github.com/tgstation/rust-g
cd rust-g cd rust-g
~/.cargo/bin/rustup target add i686-unknown-linux-gnu ~/.cargo/bin/rustup target add i686-unknown-linux-gnu
else else
echo "Fetching rust-g..." echo "Fetching rust-g..."
cd rust-g cd rust-g
git fetch git fetch
~/.cargo/bin/rustup target add i686-unknown-linux-gnu ~/.cargo/bin/rustup target add i686-unknown-linux-gnu
fi fi
echo "Deploying rust-g..." echo "Deploying rust-g..."
git checkout "$RUST_G_VERSION" git checkout "$RUST_G_VERSION"
env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-unknown-linux-gnu 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" mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so"
cd .. cd ..
# Auxtools dependencies # Auxtools dependencies
apt-get install -y build-essential g++-multilib libc6-i386 libstdc++6:i386 apt-get install -y build-essential g++-multilib libc6-i386 libstdc++6:i386
# Update auxmos # Update auxmos
if [ ! -d "auxmos" ]; then if [ ! -d "auxmos" ]; then
echo "Cloning auxmos..." echo "Cloning auxmos..."
git clone https://github.com/Putnam3145/auxmos git clone https://github.com/yogstation13/auxmos
cd auxmos cd auxmos
~/.cargo/bin/rustup target add i686-unknown-linux-gnu ~/.cargo/bin/rustup target add i686-unknown-linux-gnu
else else
echo "Fetching auxmos..." echo "Fetching auxmos..."
cd auxmos cd auxmos
git fetch git fetch
~/.cargo/bin/rustup target add i686-unknown-linux-gnu ~/.cargo/bin/rustup target add i686-unknown-linux-gnu
fi fi
echo "Deploying auxmos..." echo "Deploying auxmos..."
git checkout "$AUXMOS_VERSION" git checkout "$AUXMOS_VERSION"
env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo rustc --release --target=i686-unknown-linux-gnu --features all_reaction_hooks,katmos -- -C target-cpu=native env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo rustc --release --target=i686-unknown-linux-gnu --features all_reaction_hooks,katmos -- -C target-cpu=native
mv -f target/i686-unknown-linux-gnu/release/libauxmos.so "$1/libauxmos.so" mv -f target/i686-unknown-linux-gnu/release/libauxmos.so "$1/libauxmos.so"
cd .. cd ..
# compile tgui # compile tgui
echo "Compiling tgui..." echo "Compiling tgui..."
cd "$1" cd "$1"
chmod +x tools/bootstrap/node # Workaround for https://github.com/tgstation/tgstation-server/issues/1167 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 TG_BUILD_TGS_MODE=1 tools/bootstrap/node tools/build/build.js env TG_BOOTSTRAP_CACHE="$original_dir" TG_BOOTSTRAP_NODE_LINUX=1 TG_BUILD_TGS_MODE=1 tools/bootstrap/node tools/build/build.js