Add install script

This commit is contained in:
2025-12-12 18:01:23 -06:00
parent 86fd57ea12
commit 808b803617
2 changed files with 138 additions and 0 deletions

View File

@@ -4,6 +4,11 @@ type = "chapter"
weight = 1
+++
If you use Linux, MacOS or FreeBSD you can also use this command to install
```bash
curl -o crosslang-install.sh https://crosslang.tesseslanguage.com/crosslang-install.sh && sh crosslang-install.sh; rm crosslang-install.sh
```
- [Linux](linux)
- [Windows](windows.md)
- [Shell Binary](https://downloads.tesses.net/ShellPackage.crvm)

133
static/crosslang-install.sh Executable file
View File

@@ -0,0 +1,133 @@
#!/usr/bin/env sh
OS=`uname -s`
ARCH=`uname -m`
OsLinux() {
. /etc/os-release
case $ID in
"arch" )
OsArchLinux ;;
"debian" )
OsDebianLinux ;;
"ubuntu" )
OsUbuntuLinux ;;
esac
}
CompileFromSourceConfirmed() {
git clone https://onedev.site.tesses.net/crosslang || exit 1
cd crosslang
mkdir -p build
cd build
cmake -S .. -B .
CPUS := $(shell nproc 2>/dev/null || echo 1)
make -j`$CPUS`
while true; do
read -p "Do you want to install it (Y/n)? " yn
case $yn in
[Yy]* ) sudo make install; break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
while true; do
read -p "Do you want to delete the source code (Y/n)? " yn
case $yn in
[Yy]* ) cd ../..; rm -rf crosslang; break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
}
CompileFromSource() {
while true; do
echo "Required dependencies: cmake and a compiler"
read -p "Your platform configuration does not have a binary, do you want to compile from source (Y/n)? " yn
case $yn in
[Yy]* ) CompileFromSourceConfirmed; break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
done
}
OldDistroMessage() {
if [ "$ARCH" = "ppc" ]; then
if cat /proc/cpuinfo | grep wii > /dev/null; then
echo "You can upgrade to the Wii Linux Continuation Project"
echo "Make sure its the arch linux version"
echo "Here is the link to the page: https://wii-linux.org/downloads"
echo "Or via another linux machine you can cross compile for powerpc"
echo "using musl and staticly linking to musl"
exit 1
fi
fi
echo "You will need to cross compile a static build using musl, sorry"
exit 1
}
OsArchLinux() {
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "ppc"]; then
wget -O repository.key https://git.tesseslanguage.com/api/packages/tesses50/arch/repository.key
sudo pacman-key --add repository.key
rm repository.key
printf "[tesses50.git.tesseslanguage.com]\nSigLevel = Optional TrustAll\nServer = https://git.tesseslanguage.com/api/packages/tesses50/arch/core/\$arch\n" | sudo tee -a /etc/pacman.conf
sudo pacman -Sy crosslang
else
CompileFromSource
fi
}
OsDebianLinux() {
if [ "$VERSION_ID" -lt "12" ]; then
OldDistroMessage
elif [ "$VERSION_ID" -lt "13" ]; then
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "riscv64" ]; then
sudo curl https://git.tesseslanguage.com/api/packages/tesses50/debian/repository.key -o /etc/apt/keyrings/gitea-tesses50.asc
echo "deb [signed-by=/etc/apt/keyrings/gitea-tesses50.asc] https://git.tesseslanguage.com/api/packages/tesses50/debian jammy main" | sudo tee -a /etc/apt/sources.list.d/gitea.list
sudo apt update
sudo apt install crosslang
else
CompileFromSource
fi
else
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "riscv64" ]; then
sudo curl https://git.tesseslanguage.com/api/packages/tesses50/debian/repository.key -o /etc/apt/keyrings/gitea-tesses50.asc
echo "deb [signed-by=/etc/apt/keyrings/gitea-tesses50.asc] https://git.tesseslanguage.com/api/packages/tesses50/debian plucky main" | sudo tee -a /etc/apt/sources.list.d/gitea.list
sudo apt update
sudo apt install crosslang
else
CompileFromSource
fi
fi
}
OsUbuntuLinux() {
if [ 1 -eq "$(echo "$VERSION_ID 22.04" | awk '{print ($1 < $2)}')" ]; then
OldDistroMessage
elif [ 1 -eq "$(echo "$VERSION_ID 25.04" | awk '{print ($1 < $2)}')" ]; then
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "riscv64" ]; then
sudo curl https://git.tesseslanguage.com/api/packages/tesses50/debian/repository.key -o /etc/apt/keyrings/gitea-tesses50.asc
echo "deb [signed-by=/etc/apt/keyrings/gitea-tesses50.asc] https://git.tesseslanguage.com/api/packages/tesses50/debian jammy main" | sudo tee -a /etc/apt/sources.list.d/gitea.list
sudo apt update
sudo apt install crosslang
else
CompileFromSource
fi
else
if [ "$ARCH" = "x86_64" ] || [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "riscv64" ]; then
sudo curl https://git.tesseslanguage.com/api/packages/tesses50/debian/repository.key -o /etc/apt/keyrings/gitea-tesses50.asc
echo "deb [signed-by=/etc/apt/keyrings/gitea-tesses50.asc] https://git.tesseslanguage.com/api/packages/tesses50/debian plucky main" | sudo tee -a /etc/apt/sources.list.d/gitea.list
sudo apt update
sudo apt install crosslang
else
CompileFromSource
fi
fi
}
case $OS in
"Linux")
OsLinux ;;
*)
CompileFromSource ;;
esac