-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathinstall.sh
executable file
·77 lines (64 loc) · 1.76 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
# Function to install packages using apt (Debian/Ubuntu)
install_with_apt() {
sudo apt update
sudo apt-get install mesa-utils
}
# Function to install packages using yum (Red Hat/CentOS)
install_with_yum() {
sudo yum install glx-utils
}
# Function to install packages using pacman (Arch Linux)
install_with_pacman() {
sudo pacman -Sy --noconfirm glxinfo
}
if [ -f /etc/arch-release ]; then
install_with_pacman
elif [ -f /etc/debian_version ]; then
install_with_apt
elif [ -f /etc/redhat-release ] || [ -f /etc/centos-release ]; then
install_with_yum
else
echo "Your linux distro is not supported currently."
echo "You need to manually install those packages: exiftool, jq, glfw"
fi
get_opengl_version() {
glxinfo | grep "OpenGL version string" | awk '{print $4}'
}
REQUIRED_VERSION="4.5"
CURRENT_VERSION=$(get_opengl_version)
if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$CURRENT_VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then
echo "Your OpenGL version is $CURRENT_VERSION. OpenGL version $REQUIRED_VERSION or higher is required."
echo "Please update your OpenGL drivers."
exit 1
fi
echo "OpenGL $CURRENT_VERSION is sufficient."
if ! pkg-config cglm; then
echo "cglm not found on the system"
echo "building cglm"
git clone https://github.com/recp/cglm
cd cglm
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
cd ../../
rm -rf cglm
fi
if ! pkg-config libclipboard; then
echo "libclipboard not found on the system"
echo "building libclipboard"
git clone https://github.com/jtanx/libclipboard
cd libclipboard
cmake .
make -j$(nproc)
sudo make install
cd ..
rm -rf libclipboard
fi
make -j$(nproc) && sudo make install
cp -rf ./.leif ~/
echo "====================="
echo "INSTALLATION FINISHED"
echo "====================="