diff --git a/scripts/KlipperScreen-install.sh b/scripts/KlipperScreen-install.sh index 77d2fd32..b9c0a750 100755 --- a/scripts/KlipperScreen-install.sh +++ b/scripts/KlipperScreen-install.sh @@ -4,10 +4,13 @@ SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" KSPATH=$(sed 's/\/scripts//g' <<< $SCRIPTPATH) KSENV="${HOME}/.KlipperScreen-env" -PKGLIST="xserver-xorg-video-fbturbo xdotool xinit xinput x11-xserver-utils libopenjp2-7 python3-distutils" -PKGLIST="${PKGLIST} python3-virtualenv virtualenv matchbox-keyboard wireless-tools" -PKGLIST="${PKGLIST} libatlas-base-dev fonts-freefont-ttf" -PKGLIST="${PKGLIST} libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0" +XSERVER="xinit xinput x11-xserver-utils xdotool" +FBTURBO="xserver-xorg-video-fbturbo" +FBDEV="xserver-xorg-video-fbdev" +PYTHON="python3-virtualenv virtualenv python3-distutils" +PYGOBJECT="libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0" +MISC="libopenjp2-7 libatlas-base-dev fonts-freefont-ttf matchbox-keyboard wireless-tools" +OPTIONAL="xserver-xorg-legacy" Red='\033[0;31m' Green='\033[0;32m' @@ -49,7 +52,49 @@ install_packages() fi echo_text "Installing KlipperScreen dependencies" - sudo apt-get install -y $PKGLIST + sudo apt-get install -y $XSERVER + if [ $? -eq 0 ]; then + echo_ok "Installed X" + else + echo_error "Installation of X-server dependencies failed ($XSERVER)" + exit 1 + fi + sudo apt-get install -y $OPTIONAL + sudo apt-get install -y $FBTURBO + if [ $? -eq 0 ]; then + echo_ok "Installed FBturbo driver" + else + echo $_ + echo_error "Installation of $FBTURBO failed, trying $FBDEV" + sudo apt-get install -y $FBDEV + if [ $? -eq 0 ]; then + echo_ok "Installed FBdev" + else + echo_error "Installation of FBdev failed ($FBDEV)" + exit 1 + fi + fi + sudo apt-get install -y $PYTHON + if [ $? -eq 0 ]; then + echo_ok "Installed Python dependincies" + else + echo_error "Installation of Python dependincies failed ($PYTHON)" + exit 1 + fi + sudo apt-get install -y $PYGOBJECT + if [ $? -eq 0 ]; then + echo_ok "Installed PyGobject dependincies" + else + echo_error "Installation of PyGobject dependincies failed ($PYGOBJECT)" + exit 1 + fi + sudo apt-get install -y $MISC + if [ $? -eq 0 ]; then + echo_ok "Installed Misc packages" + else + echo_error "Installation of Misc packages failed ($MISC)" + exit 1 + fi } create_virtualenv() @@ -65,12 +110,12 @@ create_virtualenv() source ${KSENV}/bin/activate while read requirements; do - pip install $requirements + pip --disable-pip-version-check install $requirements if [ $? -gt 0 ]; then echo "Error: pip install exited with status code $?" echo "Unable to install dependencies, aborting install." deactivate - exit + exit 1 fi done < ${KSPATH}/scripts/KlipperScreen-requirements.txt deactivate @@ -125,7 +170,7 @@ start_KlipperScreen() } if [ "$EUID" == 0 ] then echo_error "Plaease do not run this script as root" - exit + exit 1 fi install_packages create_virtualenv