From 2d1e83e668625ef3f7b7ef28221613a60e195bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Concei=C3=A7=C3=A3o?= Date: Thu, 10 Nov 2022 18:45:29 +0000 Subject: Add compatibility to openSUSE and derivatives and trim dependencies installation --- README.md | 3 ++- Scripts/install-dependencies.sh | 11 ++++++++--- Scripts/install-uvtools.sh | 13 ++++++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 54f50ec..68d7227 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,10 @@ ## To auto install on Linux: ```bash -[ "$(command -v apt-get)" -a -z "$(command -v curl)" ] && sudo apt-get install -y curl +[ "$(command -v apt)" -a -z "$(command -v curl)" ] && sudo apt-get install -y curl [ "$(command -v pacman)" -a -z "$(command -v curl)" ] && sudo pacman -S curl [ "$(command -v dnf)" -a -z "$(command -v curl)" ] && sudo dnf install -y curl +[ "$(command -v zypper)" -a -z "$(command -v curl)" ] && sudo zypper install -y curl bash -c "$(curl -fsSL https://raw.githubusercontent.com/sn4k3/UVtools/master/Scripts/install-uvtools.sh)" ``` diff --git a/Scripts/install-dependencies.sh b/Scripts/install-dependencies.sh index 0b1dd21..2170282 100644 --- a/Scripts/install-dependencies.sh +++ b/Scripts/install-dependencies.sh @@ -36,23 +36,28 @@ elif testcmd apt; then #apt install -y libdc1394-22 libopenexr24 #apt install -y libdc1394-25 libopenexr25 #apt install -y libjpeg-dev libpng-dev libgeotiff-dev libgeotiff5 libavcodec-dev libavformat-dev libswscale-dev libtbb-dev libgl1-mesa-dev libgdiplus - apt install -y libjpeg-dev libpng-dev libgeotiff-dev libgeotiff5 libtbb-dev libgdiplus + apt install -y libgeotiff5 libgdiplus # mini only requires: libgdiplus libgeotiff-dev libgeotiff5 elif testcmd pacman; then osVariant="arch" pacman -Syu #pacman -S openjpeg2 libjpeg-turbo libpng libgeotiff libdc1394 ffmpeg openexr tbb libgdiplus - pacman -S libpng openjpeg2 libjpeg-turbo libgeotiff tbb libgdiplus + pacman -S libgeotiff libgdiplus elif testcmd dnf; then osVariant="rhel" dnf update -y #dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm #dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm #dnf install -y libjpeg-devel libjpeg-turbo-devel libpng-devel libgeotiff-devel libdc1394-devel ffmpeg-devel tbb-devel mesa-libGL libgdiplus - dnf install -y libjpeg-devel libjpeg-turbo-devel libpng-devel libgeotiff-devel tbb-devel libgdiplus + dnf install -y libgeotiff libgdiplus +elif testcmd zypper; then + osVariant="suse" + zypper refresh + zypper install -y libgeotiff5 libgdiplus0 else echo "Error: Base operative system / package manager not identified, nothing was installed" exit -1 fi +echo "- Detected: $osVariant $arch" echo "Completed: You can now run UVtools" diff --git a/Scripts/install-uvtools.sh b/Scripts/install-uvtools.sh index d8332b2..6bbf4ad 100644 --- a/Scripts/install-uvtools.sh +++ b/Scripts/install-uvtools.sh @@ -183,6 +183,9 @@ elif testcmd pacman; then elif testcmd dnf; then osVariant="rhel" [ -z "$(command -v curl)" ] && sudo dnf install -y curl +elif testcmd zypper; then + osVariant="suse" + [ -z "$(command -v curl)" ] && sudo zypper install -y curl fi if [ -z "$osVariant" ]; then @@ -211,8 +214,16 @@ if [ $(version $lddversion) -lt $(version $requiredlddversion) ]; then exit -1 fi + +LDCONFIG='' if testcmd ldconfig; then - if [ -z "$(ldconfig -p | grep libpng)" -o -z "$(ldconfig -p | grep libgdiplus)" -o -z "$(ldconfig -p | grep libgeotiff)" ]; then + LDCONFIG='ldconfig' +else + LDCONFIG="$(whereis ldconfig | awk '{ print $2 }')" +fi + +if [ -n "$LDCONFIG" ]; then + if [ -z "$($LDCONFIG -p | grep libgeotiff)" -o -z "$($LDCONFIG -p | grep libgdiplus)" ]; then echo "- Missing dependencies found, installing..." sudo bash -c "$(curl -fsSL $dependencies_url)" fi -- cgit v1.2.3