mirror of
https://github.com/riegera2412/UVtools.git
synced 2026-07-08 17:42:31 +02:00
Update scripts
This commit is contained in:
@@ -36,24 +36,24 @@ 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 libgeotiff5 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 libgeotiff 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 libgeotiff libgdiplus
|
||||
#dnf install -y libgeotiff libgdiplus
|
||||
elif testcmd zypper; then
|
||||
osVariant="suse"
|
||||
zypper refresh
|
||||
zypper install -y libgeotiff5 libgdiplus0
|
||||
#zypper install -y libgeotiff5 libgdiplus0
|
||||
else
|
||||
echo "Error: Base operative system / package manager not identified, nothing was installed"
|
||||
exit -1
|
||||
|
||||
+15
-14
@@ -175,21 +175,22 @@ else
|
||||
fi
|
||||
|
||||
|
||||
LDCONFIG=''
|
||||
if testcmd ldconfig; then
|
||||
LDCONFIG='ldconfig'
|
||||
else
|
||||
LDCONFIG="$(whereis ldconfig | awk '{ print $2 }')"
|
||||
fi
|
||||
# Not required for mini
|
||||
#LDCONFIG=''
|
||||
#if testcmd ldconfig; 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
|
||||
else
|
||||
echo "Unable to detect for missing dependencies, ldconfig not found, however installation will continue."
|
||||
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
|
||||
#else
|
||||
# echo "Unable to detect for missing dependencies, ldconfig not found, however installation will continue."
|
||||
#fi
|
||||
|
||||
echo '- Detecting download'
|
||||
response="$(curl -s "$api_url")"
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Attempts to create symbolic for libdl.so
|
||||
# And to solve the OpenCV "unable to load shared library 'cvextern' or one of its dependencies" error
|
||||
# Note: Run with sudo bash not sh!
|
||||
#
|
||||
# Author: Tiago Conceição
|
||||
# Version: 1
|
||||
#
|
||||
|
||||
if [ $EUID -ne 0 ]; then
|
||||
echo "This script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#####################
|
||||
## CONFIGURATION ##
|
||||
#####################
|
||||
libdlso="libdl.so"
|
||||
libdlso2="libdl.so.2"
|
||||
|
||||
directories="/lib"
|
||||
directories="$directories /usr/lib64"
|
||||
directories="$directories /lib/x86_64-linux-gnu"
|
||||
|
||||
#####################
|
||||
## DON'T TOUCH ##
|
||||
#####################
|
||||
checks=0
|
||||
links=0
|
||||
echo "Attempting to create symbolic from '$libdlso2' to '$libdlso' on known path's:"
|
||||
ldconfig -p | grep libdl
|
||||
echo ""
|
||||
for directory in $directories; do
|
||||
let "checks++"
|
||||
echo "Checking for $directory/$libdlso2"
|
||||
if [[ -f "$directory/$libdlso2" && ! -f "$directory/$libdlso" ]]; then
|
||||
echo "Match: Creating symbolic link to $libdlso"
|
||||
ln -s "$directory/$libdlso2" "$directory/$libdlso"
|
||||
let "links++"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "######## Results #########"
|
||||
echo "File checks: $checks"
|
||||
echo "Created links: $links"
|
||||
echo "Finished!"
|
||||
echo "##########################"
|
||||
+3
-3
@@ -24,9 +24,9 @@ if ($args.Count -gt 0){
|
||||
|
||||
if (-not (Test-Path -Path "$libFolder/$buildFile" -PathType Leaf)) {
|
||||
$confirmation = Read-Host "$libFolder directory does not exists, do you want to download it?
|
||||
y/yes = Download master branch
|
||||
4.6.0 = Download specific tag
|
||||
n/no = Cancel
|
||||
y/yes: Download master branch
|
||||
4.7.0: Download specific tag
|
||||
n/no: Cancel
|
||||
Option"
|
||||
|
||||
if ($confirmation -eq 'y' -or $confirmation -eq 'yes') {
|
||||
|
||||
+45
-9
@@ -6,7 +6,7 @@
|
||||
# usage 1: ./libcvextern.sh clean
|
||||
# usage 2: ./libcvextern.sh -i
|
||||
# usage 3: ./libcvextern.sh
|
||||
# usage 3: ./libcvextern.sh 4.6.0
|
||||
# usage 3: ./libcvextern.sh 4.7.0
|
||||
#
|
||||
#cd "$(dirname "$0")"
|
||||
echo $PWD
|
||||
@@ -31,6 +31,30 @@ if [ $lastArg == "clean" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "$lastArg" ]; then
|
||||
read -p "You are about to clone the master branch which are not recommended, you should choose a stable tag instead.
|
||||
Are you sure you want to continue with the master branch?
|
||||
|
||||
y/yes/blank: Continue with master
|
||||
4.7.0: Continue with specified tag
|
||||
n/no: Cancel
|
||||
|
||||
Anwser: " confirmation
|
||||
|
||||
if [ -z "$confirmation" -o "$confirmation" == "y" -o "$confirmation" == "yes" ]; then
|
||||
echo "Continuing with master..."
|
||||
elif [ "$confirmation" == "n" -o "$confirmation" == "no" -o "$confirmation" == "cancel" ]; then
|
||||
exit 1
|
||||
elif [[ "$confirmation" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo "Changing from master to $confirmation branch"
|
||||
lastArg="$confirmation"
|
||||
else
|
||||
echo "Unable to recognize your input, continuing with master branch..."
|
||||
sleep 2
|
||||
fi
|
||||
fi
|
||||
|
||||
installDependencies=false
|
||||
while getopts 'i' flag; do
|
||||
case "${flag}" in
|
||||
@@ -46,7 +70,8 @@ done
|
||||
echo "Script to build libcvextern.so|dylib on $(uname -a) $arch"
|
||||
|
||||
if testcmd ldconfig; then
|
||||
if [ -z "$(ldconfig -p | grep libpng)" -o -z "$(ldconfig -p | grep libgdiplus)" -o -z "$(ldconfig -p | grep libavcodec)" -o -z "$(command -v git)" -o -z "$(command -v cmake)" -o -z "$(command -v dotnet)" ]; then
|
||||
#if [ -z "$(ldconfig -p | grep libpng)" -o -z "$(ldconfig -p | grep libgdiplus)" -o -z "$(ldconfig -p | grep libavcodec)" -o -z "$(command -v git)" -o -z "$(command -v cmake)" -o -z "$(command -v dotnet)" ]; then
|
||||
if [ -z "$(ldconfig -p | grep libpng)" -o -z "$(command -v git)" -o -z "$(command -v cmake)" -o -z "$(command -v dotnet)" ]; then
|
||||
installDependencies=true
|
||||
fi
|
||||
fi
|
||||
@@ -71,16 +96,25 @@ elif testcmd apt; then
|
||||
osVariant="debian"
|
||||
if [ "$installDependencies" == true ]; then
|
||||
sudo apt update
|
||||
sudo apt -y install git build-essential libgtk-3-dev libgstreamer1.0-dev libavcodec-dev libswscale-dev libavformat-dev libdc1394-dev libv4l-dev cmake-curses-gui ocl-icd-dev freeglut3-dev libgeotiff-dev libusb-1.0-0-dev
|
||||
#FULL: sudo apt -y install git build-essential libgtk-3-dev libgstreamer1.0-dev libavcodec-dev libswscale-dev libavformat-dev libdc1394-dev libv4l-dev cmake-curses-gui ocl-icd-dev freeglut3-dev libgeotiff-dev libusb-1.0-0-dev
|
||||
sudo apt -y install git build-essential cmake-curses-gui
|
||||
sudo apt install -y apt-transport-https
|
||||
sudo apt update
|
||||
sudo apt install -y dotnet-sdk-6.0
|
||||
if ! testcmd dotnet; then
|
||||
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
|
||||
sudo dpkg -i packages-microsoft-prod.deb
|
||||
rm packages-microsoft-prod.deb
|
||||
sudo apt update
|
||||
sudo apt install -y dotnet-sdk-6.0
|
||||
fi
|
||||
fi
|
||||
elif testcmd pacman; then
|
||||
osVariant="arch"
|
||||
if [ "$installDependencies" == true ]; then
|
||||
sudo pacman -Syu
|
||||
sudo pacman -S git base-devel cmake msbuild gtk3 gstreamer ffmpeg libdc1394 v4l-utils ocl-icd freeglut libgeotiff libusb dotnet-sdk
|
||||
#FULL: sudo pacman -S git base-devel cmake msbuild gtk3 gstreamer ffmpeg libdc1394 v4l-utils ocl-icd freeglut libgeotiff libusb dotnet-sdk
|
||||
sudo pacman -S git base-devel cmake msbuild dotnet-sdk
|
||||
fi
|
||||
elif testcmd dnf; then
|
||||
osVariant="rhel"
|
||||
@@ -89,11 +123,17 @@ elif testcmd dnf; then
|
||||
sudo dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
|
||||
sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||
sudo dnf groupinstall -y "Development Tools" "Development Libraries"
|
||||
sudo dnf install -y git cmake gcc-c++ gtk3-devel gstreamer1-devel ffmpeg ffmpeg-devel libdc1394 libv4l-devel cmake-gui ocl-icd-devel freeglut libgeotiff libusb dotnet-sdk-6.0
|
||||
#FULL: sudo dnf install -y git cmake gcc-c++ gtk3-devel gstreamer1-devel ffmpeg ffmpeg-devel libdc1394 libv4l-devel cmake-gui ocl-icd-devel freeglut libgeotiff libusb dotnet-sdk-6.0
|
||||
sudo dnf install -y git cmake gcc-c++ dotnet-sdk-6.0
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "- Checks"
|
||||
if [ -z "$osVariant" ]; then
|
||||
echo "Error: Unable to detect your Operative System."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if ! testcmd git; then
|
||||
echo "Error: git not installed. Please re-run this script with -i flag."
|
||||
exit -1
|
||||
@@ -109,10 +149,6 @@ if ! testcmd dotnet; then
|
||||
exit -1
|
||||
fi
|
||||
|
||||
if [ -z "$osVariant" ]; then
|
||||
echo "Error: Unable to detect your Operative System."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
[ -n "$lastArg" ] && directory="$directory-$lastArg"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user