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"
|
2017-07-23 13:32:02 +02:00
|
|
|
command -v brew >/dev/null || { echo "Homebrew is required!"; exit }
|
2017-07-11 16:24:36 +02:00
|
|
|
installIfNeeded qt
|
|
|
|
installIfNeeded ffmpeg
|
|
|
|
installIfNeeded pkg-config
|
|
|
|
installIfNeeded git
|
2017-09-13 22:51:49 +02:00
|
|
|
brew link --force qt
|
2017-07-11 16:24:36 +02:00
|
|
|
resultfile="$(pwd)/KShare/build/KShare.app/"
|
|
|
|
elif [[ "$uname" = "Linux" ]]; then
|
2017-07-23 13:32:02 +02:00
|
|
|
echo "Please install Qt5 GUI, Widgets, Networking, and X11 Extras, qmake, ffmpeg development files, git, and pkgconfig"
|
|
|
|
sh
|
2017-09-08 14:42:08 +02:00
|
|
|
resultfile="$(pwd)/KShare/build/src/KShare"
|
2017-07-11 16:24:36 +02:00
|
|
|
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 "------------------------------------------------------"
|