-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
executable file
·37 lines (34 loc) · 1.22 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
#!/usr/bin/env bash
uname=$(uname)
function installIfNeeded {
brew ls --versions $1 > /dev/null
if [[ ! $? = 0 ]]; then brew install $1
else brew upgrade $1; fi
}
resultfile=""
if [[ "$uname" = "Darwin" ]]; then
export PATH="/usr/local/opt/qt/bin:$PATH"
command -v brew >/dev/null || { echo "Homebrew is required!"; exit }
installIfNeeded qt
installIfNeeded ffmpeg
installIfNeeded pkg-config
installIfNeeded git
brew link --force qt
resultfile="$(pwd)/KShare/build/KShare.app/"
elif [[ "$uname" = "Linux" ]]; then
echo "Please install Qt5 GUI, Widgets, Networking, and X11 Extras, qmake, ffmpeg development files, git, and pkgconfig"
sh
resultfile="$(pwd)/KShare/build/src/KShare"
else echo "Unsupported OS!" && exit 1; fi
git clone --recursive https://github.com/Gurkengewuerz/KShare.git || exit 2
cd KShare
mkdir build || exit 3
cd build
qmake-qt5 .. || qmake .. || exit 4
make || exit 5
echo "------------------------------------------------------"
echo "Resulting file is $resultfile"
if [[ "$uname" = "Linux" ]]; then echo "To link the file into path, run sudo ln -s $resultfile /usr/bin/kshare"; fi
cd ..
echo "To update, go to $(pwd), git pull, cd build, and \`make\`"
echo "------------------------------------------------------"