Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added: PreCompile for SS220.sh #846

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions tools/tgs_scripts/PreCompileSS220.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/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"
. _build_dependencies.sh
cd "$original_dir"


# update rust-g
if [ ! -d "rust-g" ]; then
echo "Cloning rust-g..."
git clone https://github.com/ParadiseSS13/rust-g
cd rust-g
git checkout "$RUSTG_VERSION"
. apply_patches.sh
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
else
echo "Fetching rust-g..."
cd rust-g
git checkout "$RUSTG_VERSION"
git fetch
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
fi

cd paradise-rust-g
echo "Deploying rust-g..."

env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --features all --target=i686-unknown-linux-gnu
mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so"
cd ../..

if [ ! -d "rust-g-tg" ]; then
echo "Cloning rust-g..."
git clone https://github.com/ss220club/rust-g-tg
cd rust-g-tg
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
else
echo "Fetching rust-g..."
cd rust-g-tg
git fetch
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
fi

echo "Deploying rust-g ss220..."
RUSTFLAGS="-C target-cpu=native"
env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --features all --target=i686-unknown-linux-gnu
rm -f "$original_dir/../GameStaticFiles/librust_g_ss220.so"
mv target/i686-unknown-linux-gnu/release/librust_g.so "$original_dir/../GameStaticFiles/librust_g_ss220.so"
cd ..