Merge pull request #14908 from cadyn/makelinuxgreatagain

Make cit actually work on linux by updating scripts
This commit is contained in:
Putnam3145
2021-07-03 01:37:41 -07:00
committed by GitHub
8 changed files with 106 additions and 21 deletions
+4
View File
@@ -7,6 +7,10 @@
#Ignore byond config folder.
/cfg/**/*
#Ignore rust-g and auxmos libraries which are compiled with scripts
*.so
/tools/build/binaries/**/*
#Ignore compiled files and other files generated during compilation.
*.mdme
*.dmb
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
cd "$(dirname "$(readlink -f "$0")")"
cd ./tools/build
sudo bash ./build.sh
+4 -1
View File
@@ -8,7 +8,10 @@ export BYOND_MAJOR=513
export BYOND_MINOR=1536
#rust_g git tag
export RUST_G_VERSION=0.4.7
export RUST_G_VERSION=0.4.8
#auxmos git tag
export AUXMOS_VERSION=0.2.0
#node version
export NODE_VERSION=12
BIN
View File
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
This directory is used to store temporary files to create binaries on linux
+2
View File
@@ -1,4 +1,6 @@
#!/bin/sh
#Build TGUI
set -e
cd "$(dirname "$0")"
exec ../bootstrap/node build.js "$@"
+75
View File
@@ -0,0 +1,75 @@
#!/bin/sh
#Detect OS and use corresponding package manager for dependencies. Currently only works for arch, debian/ubuntu, and RHEL/fedora/CentOS
if [[ -f '/etc/arch-release' ]]; then
echo -ne '\n y' | sudo pacman --needed -Sy base-devel git curl nodejs unzip
fi
if [[ -f '/etc/debian version' ]]; then
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y build-essential git curl lib32z1 pkg-config libssl-dev:i386 libssl-dev nodejs unzip g++-multilib libc6-i386 libstdc++6:i386
fi
if [[ -f '/etc/centos-release' ]] || [[ -f '/etc/fedora-release' ]]; then #DNF should work for both of these
sudo dnf --refresh install make automake gcc gcc-c++ kernel-devel git curl unzip glibc-devel.i686 openssl-devel.i686 libgcc.i686 libstdc++-devel.i686
fi
cd binaries
#Install rust if not present
if ! [ -x "$has_cargo" ]; then
echo "Installing rust..."
curl https://sh.rustup.rs -sSf | sh -s -- -y
. ~/.profile
fi
#Download/update rust-g repo
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
#Compile and move rust-g binary to repo root
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
mv target/i686-unknown-linux-gnu/release/librust_g.so ../../../../librust_g.so
cd ..
#Download/update auxmos repo
if [ ! -d "auxmos" ]; then
echo "Cloning auxmos..."
git clone https://github.com/Putnam3145/auxmos
cd auxmos
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
else
echo "Fetching auxmos..."
cd auxmos
git fetch
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
fi
#Compile and move auxmos binary to repo root
echo "Deploying auxmos..."
git checkout "$AUXMOS_VERSION"
env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-unknown-linux-gnu
mv target/i686-unknown-linux-gnu/release/libauxmos.so ../../../../libauxmos.so
cd ../..
#Install BYOND
cd ../..
./tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
cd tools/build
#Build TGUI
set -e
cd "$(dirname "$0")"
exec ../bootstrap/node build.js "$@"
+16 -20
View File
@@ -66,31 +66,27 @@ env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-un
mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so"
cd ..
# get dependencies for extools
apt-get install -y cmake build-essential gcc-multilib g++-multilib cmake wget
# Auxtools dependencies
apt-get install build-essential g++-multilib libc6-i386 libstdc++6:i386
# update extools
if [ ! -d "extools" ]; then
echo "Cloning extools..."
git clone https://github.com/MCHSL/extools
cd extools/byond-extools
# Update auxmos
if [ ! -d "auxmos" ]; then
echo "Cloning auxmos..."
git clone https://github.com/Putnam3145/auxmos
cd auxmos
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
else
echo "Fetching extools..."
cd extools/byond-extools
echo "Fetching auxmos..."
cd auxmos
git fetch
~/.cargo/bin/rustup target add i686-unknown-linux-gnu
fi
echo "Deploying extools..."
git checkout "$EXTOOLS_VERSION"
if [ -d "build" ]; then
rm -R build
fi
mkdir build
cd build
cmake ..
make
mv libbyond-extools.so "$1/libbyond-extools.so"
cd ../../..
echo "Deploying auxmos..."
git pull origin master
env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-unknown-linux-gnu
mv -f target/i686-unknown-linux-gnu/release/libauxmos.so "$1/libauxmos.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