From fd19c778ddff83f5c97812b76da8862b5f8f08fc Mon Sep 17 00:00:00 2001 From: jhagrid77 Date: Tue, 5 Mar 2019 13:10:03 -0500 Subject: [PATCH 1/3] Testing for added distrobution support --- Cataclysm-Ubuntu-Compiler.sh | 63 ++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 9 deletions(-) diff --git a/Cataclysm-Ubuntu-Compiler.sh b/Cataclysm-Ubuntu-Compiler.sh index 05e69a8..574693c 100644 --- a/Cataclysm-Ubuntu-Compiler.sh +++ b/Cataclysm-Ubuntu-Compiler.sh @@ -1,5 +1,16 @@ #!/bin/bash +if type apt-get >/dev/null 2>&1 +then + OS=Debian +elif type pacman >/dev/null 2>&1 +then + OS=Arch + #elif type rpm >/dev/null 2>&1 + #then + # OS=RPM +fi + read -n 1 -p "Would you like to install Cataclysm: Dark Days Ahead? You can choose to install the updater script either way. (Please enter Y or N): " INSTALL echo "" if [[ ( "$INSTALL" = 'Y' ) || ( "$INSTALL" = 'y' ) ]] @@ -9,7 +20,15 @@ then if [[ ( "$VERSION" = 'N' ) || ( "$VERSION" = 'n' ) ]] then echo "Installing needed dependencies." - sudo apt-get update && sudo apt-get install astyle build-essential ccache clang git libglib2.0-dev liblua5.2-0 liblua5.2-dev libncurses5-dev libncursesw5-dev lua5.2 tmux -y + if [ "$OS" = "Debian" ] + then + sudo apt-get update && sudo apt-get install astyle build-essential ccache clang git libglib2.0-dev liblua5.3-dev libncurses5-dev libncursesw5-dev lua5.3 zip -y + elif [ "$OS" = "Arch" ] + then + sudo pacman -Syy && sudo pacman -S astyle ccache clang git glib2 lua lua52 ncurses zip + #elif [ "$OS" = "RPM" ] + #then + fi read -n 1 -p "Would you like to choose a different font to use for the game? Doing so will create a launcher for you (Please enter Y or N): " FONT echo "" if [[ ( "$FONT" = 'Y' ) || ( "$FONT" = 'y' ) ]] @@ -42,20 +61,45 @@ then echo "unset GAMEDIRECTORY" >> $LAUNCHER/cataclysm-launcher.sh chmod +x $LAUNCHER/cataclysm-launcher.sh fi - elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] +elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] then echo "Installing needed dependencies." - sudo apt-get update && sudo apt-get install astyle build-essential ccache clang git libfreetype6-dev libglib2.0-dev liblua5.2-0 liblua5.2-dev libncurses5-dev libncursesw5-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev lua5.2 -y - GRAPHICS=$(dpkg -l 2>/dev/null | grep "xserver-xorg" | tail -n 1 | awk '{print $1}') - if [ "$GRAPHICS" != "ii" ] + if [ "$OS" = 'Debian' ] + then + sudo apt-get update && sudo apt-get install build-essential ccache clang git libfreetype6-dev liblua5.3-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev lua5.3 zip -y + elif [ "$OS" = 'Arch' ] + then + sudo pacman -Syy && sudo pacman -S base-devel bzip2 ccache clang freetype2 gcc-libs git glibc lua sdl2 sdl2_image sdl2_mixer sdl2_ttf zip zlib + #elif [ "$OS" = 'RPM' ] + #then + fi + if [ "$OS" = 'Debian' ] + then + GRAPHICS=$(dpkg -l 2>/dev/null | grep "xinit" | awk '{print $2}') + elif [ "$OS" = 'Arch' ] + then + GRAPHICS=$(pacman -Q | awk '{print $1}' | grep "xinit") + #elif [ "$OS" = 'RPM' ] + #then + fi + if ! [[ "$GRAPHICS" =~ xinit ]] then echo "It would appear that you do not have a graphical environment installed." read -n 1 -p "Would you like to install one now so you can play the Tiles version? (Please enter Y or N.) (If you select Y, then i3WM and Xorg will be installed): " GUI echo "" if [[ ( "$GUI" = 'Y' ) || ( "$GUI" = 'y' ) ]] then - sudo apt-get update && sudo apt-get install i3 lightdm xinit x11-server-utils zip -y - elif [[ ( "$GUI" = 'N' ) || ( "$GUI" = 'n' ) ]] + if [ "$OS" = 'Debian' ] + then + sudo apt-get update && sudo apt-get install i3 lightdm xinit x11-server-utils -y + fi + if [ "$OS" = 'Arch' ] + then + sudo pacman -Syy && sudo pacman -S i3 lightdm xinit + #elif [ "$OS" = 'RPM' ] + #then + fi + elif [[ ( "$GUI" = 'N' ) || ( "$GUI" = 'n' ) ]] then echo "Sorry, the Tiles version of C:DDA cannot work without a GUI." exit @@ -119,7 +163,7 @@ then if [[ ( "$VERSION" = 'N' ) || ( "$VERSION" = 'n' ) ]] then make -s -j$(nproc --all) CLANG=1 CCACHE=1 RELEASE=1 LUA=1 USE_HOME_DIR=1 - elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] +elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] then make -s -j$(nproc --all) CLANG=1 CCACHE=1 RELEASE=1 LUA=1 TILES=1 USE_HOME_DIR=1 fi @@ -151,7 +195,7 @@ then if [[ ( "$VERSION" = 'N' ) || ( "$VERSION" = 'n' ) ]] then echo "make -s -j$(nproc --all) CLANG=1 CCACHE=1 RELEASE=1 LUA=1 USE_HOME_DIR=1" >> $LAUNCHER/cataclysm-updater.sh - elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] +elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] then echo "make -s -j$(nproc --all) CLANG=1 CCACHE=1 RELEASE=1 LUA=1 TILES=1 USE_HOME_DIR=1" >> $LAUNCHER/cataclysm-updater.sh fi @@ -164,3 +208,4 @@ unset FONT unset LAUNCHER unset UPDATE unset GUI +unset OS From 30827d9a20738550e082450558ca4b24e83762cc Mon Sep 17 00:00:00 2001 From: jhagrid77 Date: Tue, 5 Mar 2019 18:09:59 -0500 Subject: [PATCH 2/3] Testing for DNF/YUM/Pacman compatibility --- Cataclysm-Ubuntu-Compiler.sh | 154 ++++++++++++++++++++++++++++++----- 1 file changed, 133 insertions(+), 21 deletions(-) diff --git a/Cataclysm-Ubuntu-Compiler.sh b/Cataclysm-Ubuntu-Compiler.sh index 574693c..df60ea1 100644 --- a/Cataclysm-Ubuntu-Compiler.sh +++ b/Cataclysm-Ubuntu-Compiler.sh @@ -6,11 +6,19 @@ then elif type pacman >/dev/null 2>&1 then OS=Arch - #elif type rpm >/dev/null 2>&1 +elif type dnf >/dev/null 2>&1 +then + OS=RPM-DNF + #elif type zypper >/dev/null 2>&1 #then - # OS=RPM + # OS=RPM-ZYPPER +elif type yum >/dev/null 2>&1 +then + OS=RPM-YUM fi +ARCH=$(arch) + read -n 1 -p "Would you like to install Cataclysm: Dark Days Ahead? You can choose to install the updater script either way. (Please enter Y or N): " INSTALL echo "" if [[ ( "$INSTALL" = 'Y' ) || ( "$INSTALL" = 'y' ) ]] @@ -25,9 +33,27 @@ then sudo apt-get update && sudo apt-get install astyle build-essential ccache clang git libglib2.0-dev liblua5.3-dev libncurses5-dev libncursesw5-dev lua5.3 zip -y elif [ "$OS" = "Arch" ] then - sudo pacman -Syy && sudo pacman -S astyle ccache clang git glib2 lua lua52 ncurses zip - #elif [ "$OS" = "RPM" ] + sudo pacman -Syy && sudo pacman -S astyle ccache clang git glib2 lua ncurses zip + elif [ "$OS" = "RPM-DNF" ] + then + if [ "$ARCH" = 'x86_64' ] + then + sudo dnf install astyle.$ARCH ccache.$ARCH clang.$ARCH git.$ARCH glib2.$ARCH lua.$ARCH lua-devel.$ARCH ncurses-devel.$ARCH zip.$ARCH + elif [ "$ARCH" = 'i686' ] + then + sudo dnf install astyle.$ARCH clang.$ARCH git.$ARCH glib2.$ARCH lua.$ARCH lua-devel.$ARCH ncurses-devel.$ARCH zip.$ARCH + fi + #elif [ "$OS" = "RPM-ZYPPER" ] #then + elif [ "$OS" = "RPM-YUM" ] + then + if [ "$ARCH" = 'x86_64' ] + then + sudo yum install astyle.$ARCH ccache.$ARCH clang.$ARCH git.$ARCH glib2.$ARCH lua.$ARCH lua-devel.$ARCH ncurses-devel.$ARCH zip.$ARCH + elif [ "$ARCH" = 'i686' ] + then + sudo yum install astyle.$ARCH clang.$ARCH git.$ARCH glib2.$ARCH lua.$ARCH lua-devel.$ARCH ncurses-devel.$ARCH zip.$ARCH + fi fi read -n 1 -p "Would you like to choose a different font to use for the game? Doing so will create a launcher for you (Please enter Y or N): " FONT echo "" @@ -40,12 +66,31 @@ then LAUNCHER=$(pwd) fi mkdir $LAUNCHER/backups - sudo echo -e 'ACTIVE_CONSOLES="/dev/tty[1-6]"\n' | sudo tee $LAUNCHER/backups/game-font 1> /dev/null - sudo echo -e 'CHARMAP="UTF-8"\n' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null - sudo echo 'CODESET="guess"' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null - sudo echo 'FONTFACE="Terminus"' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null - sudo echo -e 'FONTSIZE="14x28"\n' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null - sudo echo 'VIDEOMODE=' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null + if [ -f /etc/default/console-setup ] + then + sudo echo -e 'ACTIVE_CONSOLES="/dev/tty[1-6]"\n' | sudo tee $LAUNCHER/backups/game-font 1> /dev/null + sudo echo -e 'CHARMAP="UTF-8"\n' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null + sudo echo 'CODESET="guess"' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null + sudo echo 'FONTFACE="Terminus"' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null + sudo echo -e 'FONTSIZE="14x28"\n' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null + sudo echo 'VIDEOMODE=' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null + elif [ -f /etc/vconsole.conf ] + then + if [ "$OS" = 'RPM-DNF' ] + then + sudo dnf install terminus-fonts-console + #elif [ "$OS" = 'RPM-ZYPPER' ] + #then + elif [ "$OS" = 'RPM-YUM' ] + then + sudo yum install terminus-fonts-console + elif [ "$OS" = 'Arch' ] + then + sudo pacman -S terminus-font + fi + sudo echo 'KEYMAP="us"' | sudo tee $LAUNCHER/backups/game-font 1> /dev/null + sudo echo 'FONT="ter-v32n"' | sudo tee -a $LAUNCHER/backups/game-font 1> /dev/null + fi sudo chown root:root $LAUNCHER/backups/game-font sudo chmod 644 $LAUNCHER/backups/game-font @@ -53,10 +98,25 @@ then echo "LAUNCHDIRECTORY=$LAUNCHER" >> $LAUNCHER/cataclysm-launcher.sh echo "GAMEDIRECTORY=$(pwd)/Cataclysm-DDA" >> $LAUNCHER/cataclysm-launcher.sh echo "echo 'Backing up current font.'" >> $LAUNCHER/cataclysm-launcher.sh - echo "sudo cp /etc/default/console-setup \$LAUNCHDIRECTORY/backups/regular-font" >> $LAUNCHER/cataclysm-launcher.sh - echo "sudo cp \$LAUNCHDIRECTORY/backups/game-font /etc/default/console-setup" >> $LAUNCHER/cataclysm-launcher.sh + if [ -f /etc/default/console-setup ] + then + echo "sudo cp /etc/default/console-setup \$LAUNCHDIRECTORY/backups/regular-font" >> $LAUNCHER/cataclysm-launcher.sh + echo "sudo cp \$LAUNCHDIRECTORY/backups/game-font /etc/default/console-setup" >> $LAUNCHER/cataclysm-launcher.sh + elif [ -f /etc/vconsole.conf ] + then + echo "sudo cp /etc/vconsole.conf \$LAUNCHDIRECTORY/backups/regular-font">> $LAUNCHER/cataclysm-launcher.sh + echo "sudo cp \$LAUNCHDIRECTORY/backups/game-font /etc/vconsole.conf" >> $LAUNCHER/cataclysm-launcher.sh + echo "sudo systemctl restart systemd-vconsole-setup.service" >> $LAUNCHER/cataclysm-launcher.sh + fi echo "cd \$GAMEDIRECTORY; ./cataclysm" >> $LAUNCHER/cataclysm-launcher.sh - echo "sudo cp \$LAUNCHDIRECTORY/backups/regular-font /etc/default/console-setup" >> $LAUNCHER/cataclysm-launcher.sh + if [ -f /etc/default/console-setup ] + then + echo "sudo cp \$LAUNCHDIRECTORY/backups/regular-font /etc/default/console-setup" >> $LAUNCHER/cataclysm-launcher.sh + elif [ -f /etc/vconsole.conf ] + then + echo "sudo cp \$LAUNCHDIRECTORY/backups/regular-font /etc/vconsole.conf" >> $LAUNCHER/cataclysm-launcher.sh + echo "sudo systemctl restart systemd-vconsole-setup.service" >> $LAUNCHER/cataclysm-launcher.sh + fi echo "unset LAUNCHDIRECTORY" >> $LAUNCHER/cataclysm-launcher.sh echo "unset GAMEDIRECTORY" >> $LAUNCHER/cataclysm-launcher.sh chmod +x $LAUNCHER/cataclysm-launcher.sh @@ -70,8 +130,26 @@ elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] elif [ "$OS" = 'Arch' ] then sudo pacman -Syy && sudo pacman -S base-devel bzip2 ccache clang freetype2 gcc-libs git glibc lua sdl2 sdl2_image sdl2_mixer sdl2_ttf zip zlib - #elif [ "$OS" = 'RPM' ] + elif [ "$OS" = 'RPM-DNF' ] + then + if [ "$ARCH" = 'x86_64' ] + then + sudo dnf install bzip2.$ARCH ccache.$ARCH clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH + elif [ "$ARCH" = 'i686' ] + then + sudo dnf install clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH + fi + #elif [ "$OS" = 'RPM-ZYPPER' ] #then + elif [ "$OS" = 'RPM-YUM' ] + then + if [ "$ARCH" = 'x86_64' ] + then + sudo yum install bzip2.$ARCH ccache.$ARCH clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH + elif [ "$ARCH" = 'i686' ] + then + sudo yum install clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH + fi fi if [ "$OS" = 'Debian' ] then @@ -79,8 +157,15 @@ elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] elif [ "$OS" = 'Arch' ] then GRAPHICS=$(pacman -Q | awk '{print $1}' | grep "xinit") - #elif [ "$OS" = 'RPM' ] + elif [ "$OS" = 'RPM-DNF' ] + then + GRAPHICS=$(dnf list installed | grep xinit | awk '{print $1}') + #elif [ "$OS" = 'RPM-ZYPPER' ] #then + # GRAPHICS=$(rpm -qa | grep xinit | awk '{print $1}') + elif [ "$OS" = 'RPM-YUM' ] + then + GRAPHICS=$(yum list installed | grep xinit | awk '{print $1}') fi if ! [[ "$GRAPHICS" =~ xinit ]] then @@ -92,12 +177,29 @@ elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] if [ "$OS" = 'Debian' ] then sudo apt-get update && sudo apt-get install i3 lightdm xinit x11-server-utils -y - fi - if [ "$OS" = 'Arch' ] + elif [ "$OS" = 'Arch' ] then sudo pacman -Syy && sudo pacman -S i3 lightdm xinit - #elif [ "$OS" = 'RPM' ] + elif [ "$OS" = 'RPM-DNF' ] + then + if [ "$ARCH" = 'x86_64' ] + then + sudo dnf install i3.$ARCH lightdm.$ARCH + elif [ "$ARCH" = 'i686' ] + then + echo "Sorry, I couldn't find a way to install a GUI environment on a 32-bit system for!" + fi + #elif [ "$OS" = 'RPM-ZYPPER' ] #then + elif [ "$OS" = 'RPM-YUM' ] + then + if [ "$ARCH" = 'x86_64' ] + then + sudo yum install i3.$ARCH lightdm.$ARCH + elif [ "$ARCH" = 'i686' ] + then + echo "Sorry, I couldn't find a way to install a GUI environment on a 32-bit system for!" + fi fi elif [[ ( "$GUI" = 'N' ) || ( "$GUI" = 'n' ) ]] then @@ -123,7 +225,8 @@ elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] wget https://www.fontsquirrel.com/fonts/download/white-rabbit mv white-rabbit white-rabbit.zip unzip white-rabbit.zip - sudo mv whitrabt.ttf /usr/local/share/fonts/ + sudo mv whitrabt.ttf /usr/share/fonts/ + fc-cache -f cd .. && rm -r temp echo "xterm*faceName: White Rabbit" > $LAUNCHER/backups/game-font echo "xterm*faceSize: 14" >> $LAUNCHER/backups/game-font @@ -194,8 +297,16 @@ then echo "make clean" >> $LAUNCHER/cataclysm-updater.sh if [[ ( "$VERSION" = 'N' ) || ( "$VERSION" = 'n' ) ]] then - echo "make -s -j$(nproc --all) CLANG=1 CCACHE=1 RELEASE=1 LUA=1 USE_HOME_DIR=1" >> $LAUNCHER/cataclysm-updater.sh -elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] + if [[ "$OS" =~ 'RPM' ]] + then + if [ "$ARCH" = 'i686' ] + then + echo "make -s -j$(nproc --all) CLANG=1 RELEASE=1 LUA=1 USE_HOME_DIR=1" >> $LAUNCHER/cataclysm-updater.sh + fi + else + echo "make -s -j$(nproc --all) CLANG=1 CCACHE=1 RELEASE=1 LUA=1 USE_HOME_DIR=1" >> $LAUNCHER/cataclysm-updater.sh + fi + elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] then echo "make -s -j$(nproc --all) CLANG=1 CCACHE=1 RELEASE=1 LUA=1 TILES=1 USE_HOME_DIR=1" >> $LAUNCHER/cataclysm-updater.sh fi @@ -209,3 +320,4 @@ unset LAUNCHER unset UPDATE unset GUI unset OS +unset GRAPHICS From 9b7ba5871b2972ce2c158159eff13ba9a995be17 Mon Sep 17 00:00:00 2001 From: jhagrid77 Date: Tue, 5 Mar 2019 18:56:54 -0500 Subject: [PATCH 3/3] Fixed compatibility for DNF/YUM/Pacman --- Cataclysm-Ubuntu-Compiler.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Cataclysm-Ubuntu-Compiler.sh b/Cataclysm-Ubuntu-Compiler.sh index df60ea1..8372d4a 100644 --- a/Cataclysm-Ubuntu-Compiler.sh +++ b/Cataclysm-Ubuntu-Compiler.sh @@ -30,7 +30,7 @@ then echo "Installing needed dependencies." if [ "$OS" = "Debian" ] then - sudo apt-get update && sudo apt-get install astyle build-essential ccache clang git libglib2.0-dev liblua5.3-dev libncurses5-dev libncursesw5-dev lua5.3 zip -y + sudo apt-get update && sudo apt-get install astyle build-essential ccache clang git libglib2.0-dev liblua5.2-devel liblua5.3-dev libncurses5-dev libncursesw5-dev lua5.2 lua5.3 zip -y elif [ "$OS" = "Arch" ] then sudo pacman -Syy && sudo pacman -S astyle ccache clang git glib2 lua ncurses zip @@ -49,10 +49,10 @@ then then if [ "$ARCH" = 'x86_64' ] then - sudo yum install astyle.$ARCH ccache.$ARCH clang.$ARCH git.$ARCH glib2.$ARCH lua.$ARCH lua-devel.$ARCH ncurses-devel.$ARCH zip.$ARCH + sudo yum install astyle.$ARCH ccache.$ARCH clang.$ARCH git.$ARCH glib2.$ARCH lua.$ARCH lua-devel.$ARCH make.$ARCH ncurses-devel.$ARCH zip.$ARCH elif [ "$ARCH" = 'i686' ] then - sudo yum install astyle.$ARCH clang.$ARCH git.$ARCH glib2.$ARCH lua.$ARCH lua-devel.$ARCH ncurses-devel.$ARCH zip.$ARCH + sudo yum install astyle.$ARCH clang.$ARCH git.$ARCH glib2.$ARCH lua.$ARCH lua-devel.$ARCH make.$ARCH ncurses-devel.$ARCH zip.$ARCH fi fi read -n 1 -p "Would you like to choose a different font to use for the game? Doing so will create a launcher for you (Please enter Y or N): " FONT @@ -126,7 +126,7 @@ elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] echo "Installing needed dependencies." if [ "$OS" = 'Debian' ] then - sudo apt-get update && sudo apt-get install build-essential ccache clang git libfreetype6-dev liblua5.3-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev lua5.3 zip -y + sudo apt-get update && sudo apt-get install build-essential ccache clang git libfreetype6-dev liblua5.2-dev liblua5.3-dev libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev lua5.2 lua5.3 zip -y elif [ "$OS" = 'Arch' ] then sudo pacman -Syy && sudo pacman -S base-devel bzip2 ccache clang freetype2 gcc-libs git glibc lua sdl2 sdl2_image sdl2_mixer sdl2_ttf zip zlib @@ -134,10 +134,10 @@ elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] then if [ "$ARCH" = 'x86_64' ] then - sudo dnf install bzip2.$ARCH ccache.$ARCH clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH + sudo dnf install bzip2.$ARCH ccache.$ARCH clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH make.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH elif [ "$ARCH" = 'i686' ] then - sudo dnf install clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH + sudo dnf install clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH make.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH fi #elif [ "$OS" = 'RPM-ZYPPER' ] #then @@ -145,10 +145,10 @@ elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] then if [ "$ARCH" = 'x86_64' ] then - sudo yum install bzip2.$ARCH ccache.$ARCH clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH + sudo yum install bzip2.$ARCH ccache.$ARCH clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH make.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH elif [ "$ARCH" = 'i686' ] then - sudo yum install clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH + sudo yum install clang.$ARCH freetype.$ARCH git.$ARCH glibc.$ARCH lua.$ARCH make.$ARCH SDL2-devel.$ARCH SDL2_image-devel.$ARCH SDL2_mixer-devel.$ARCH SDL2_ttf-devel.$ARCH zip.$ARCH fi fi if [ "$OS" = 'Debian' ] @@ -217,7 +217,10 @@ elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] then LAUNCHER=$(pwd) fi - mkdir $LAUNCHER/backups + if [ -d $LAUNCHER/backups ] + then + mkdir $LAUNCHER/backups + fi echo "Installing new font." mkdir temp @@ -226,7 +229,10 @@ elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] mv white-rabbit white-rabbit.zip unzip white-rabbit.zip sudo mv whitrabt.ttf /usr/share/fonts/ - fc-cache -f + if type fc-cache >/dev/null 2>&1 + then + fc-cache -f + fi cd .. && rm -r temp echo "xterm*faceName: White Rabbit" > $LAUNCHER/backups/game-font echo "xterm*faceSize: 14" >> $LAUNCHER/backups/game-font @@ -250,7 +256,7 @@ elif [[ ( "$VERSION" = 'T' ) || ( "$VERSION" = 't' ) ]] echo " echo 'Restoring regular font.'" >> $LAUNCHER/cataclysm-launcher.sh echo " cp \$LAUNCHDIRECTORY/backups/regular-font ~/.Xresources" >> $LAUNCHER/cataclysm-launcher.sh echo "else" >> $LAUNCHER/cataclysm-launcher.sh - echo " rm ~/.Xresources" >> $LAUNCHER/cataclysm-launcher.sh + echo " rm -f ~/.Xresources" >> $LAUNCHER/cataclysm-launcher.sh echo "fi" >> $LAUNCHER/cataclysm-launcher.sh echo "unset LAUNCHDIRECTORY" >> $LAUNCHER/cataclysm-launcher.sh echo "unset GAMEDIRECTORY" >> $LAUNCHER/cataclysm-launcher.sh