KShare/install.sh

36 lines
1.1 KiB
Bash
Raw Normal View History

2017-07-11 16:24:36 +02:00
#!/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"
installIfNeeded qt
installIfNeeded ffmpeg
installIfNeeded pkg-config
installIfNeeded git
resultfile="$(pwd)/KShare/build/KShare.app/"
elif [[ "$uname" = "Linux" ]]; then
2017-07-13 17:29:29 +02:00
echo "Please install Qt5 SDK, qmake, ffmpeg development files, git, and pkgconfig"
2017-07-11 16:24:36 +02:00
bash
resultfile="$(pwd)/KShare/build/KShare"
else echo "Unsupported OS!" && exit 1; fi
git clone --recursive https://github.com/ArsenArsen/KShare.git || exit 2
cd KShare
mkdir build || exit 3
cd build
qmake-qt5 .. || qmake .. || exit 4
2017-07-21 22:35:25 +02:00
make || exit 5
2017-07-11 16:24:36 +02:00
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 ..
2017-07-21 22:35:25 +02:00
echo "To update, go to $(pwd), git pull, cd build, and \`make\`"
2017-07-11 16:24:36 +02:00
echo "------------------------------------------------------"