Skip to content

Commit

Permalink
Fix: More-tgs-fixes (#258)
Browse files Browse the repository at this point in the history
Исправляет некоторые косяки в скриптах для тгс
  • Loading branch information
Furrior authored Sep 29, 2023
1 parent cfee229 commit e1d0618
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 21 deletions.
21 changes: 5 additions & 16 deletions tools/tgs_scripts/InstallDeps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ has_git="$(command -v git)"
has_curl="$(command -v curl)"
has_cargo="$(command -v ~/.cargo/bin/cargo)"
has_sudo="$(command -v sudo)"
has_youtubedl="$(command -v youtube-dl)"
has_pip3="$(command -v pip3)"
has_ffmpeg="$(command -v ffmpeg)"
set -e
set -x

Expand All @@ -32,19 +32,8 @@ if ! [ -x "$has_cargo" ]; then
. ~/.profile
fi

# 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
if ! ( [ -x "$has_ffmpeg" ] ); then
echo "Installing ffmpeg..."
apt-get update
apt-get install -y ffmpeg
fi
12 changes: 7 additions & 5 deletions tools/tgs_scripts/PreCompile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ set -x
# Need to switch to game dir for Dockerfile weirdness
original_dir=$PWD
cd "$1"
. build_dependencies.sh
. _build_dependencies.sh
cd "$original_dir"


# update rust-g
if [ ! -d "rust-g-tg" ]; then
echo "Cloning rust-g..."
git clone https://github.com/ss220-space/rust-g-tg # Aziz one
git clone https://github.com/ss220club/rust-g-tg
cd rust-g-tg
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
else
Expand All @@ -27,13 +27,15 @@ else
fi

echo "Deploying rust-g..."
git checkout "$RUST_G_VERSION"
RUSTFLAGS="-C target-cpu=native"
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_ss220.so "$1/librust_g_ss220.so"
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 ..

# SS220 TODO: #22629 tg like compile tgui
# SS220 TODO: compile aa's rustg natively too

# SS220 TODO: tg like compile tgui
# compile tgui
# echo "Compiling tgui..."
# cd "$1"
Expand Down

0 comments on commit e1d0618

Please sign in to comment.