diff --git a/INSTALL.md b/INSTALL.md index 264e15f00..a2d071816 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -456,13 +456,53 @@ packages necessary for building .debs, so be prepared to type your password for ## OS X + Compiling qTox on OS X for development requires 3 tools, [Xcode](https://developer.apple.com/xcode/) and [Qt 5.4+](http://www.qt.io/qt5-4/), and [homebrew](http://brew.sh). -### Required Libraries +### Automated Script +You can now set up your OS X system to compile qTox automatically thanks to the script in: +`./osx/qTox-Mac-Deployer-ULTIMATE.sh` + +This script can be run independently of the qTox repo and is all that's needed to build from scratch on OS X. + +To use this script you must launch terminal which can be found: `Applications > Utilities > Terminal.app` + +If you wish to lean more you can run `./qTox-Mac-Deployer-ULTIMATE.sh -h` + +#### First Run / Install +If you are running the script for the first time you will want to makesure your system is ready. +To do this simply run `./qTox-Mac-Deployer-ULTIMATE.sh -i` to run you through the automated install set up. + +After running the installation setup you are now ready to build qTox from source, to do this simply run: +`./qTox-Mac-Deployer-ULTIMATE.sh -b` + +If there aren't any errors then you'll find a locally working qTox application in your home folder under +`~/qTox-Mac_Build` + +#### Updating +If you want to update your application for testing purposes or you want to run a nightly build setup then run: +`./qTox-Mac-Deployer-ULTIMATE.sh -u` and follow the prompts. +(NOTE: If you know you updated the repos before running this hit Y) +followed by +`./qTox-Mac-Deployer-ULTIMATE.sh -b` +to build the application once more. (NOTE: This will delete your previous build.) + +#### Deploying +OS X requires an extra step to make the `qTox.app` file shareable on a system that doesn't have the required libraries installed already. + +If you want to share the build you've made with your other friends who use OS X then simply run: +`./qTox-Mac-Deployer-ULTIMATE.sh -d` + +### Manual Compiling +#### Required Libraries +Install homebrew if you don't have it: +```bash +ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` First, let's install the dependencies available via brew. ```bash -brew install git ffmpeg qrencode +brew install git ffmpeg qrencode libtool automake autoconf check qt5 libvpx opus sqlcipher libsodium ``` Next, install [filter_audio](https://github.com/irungentoo/filter_audio) (you may delete the directory it creates afterwards): @@ -473,6 +513,8 @@ sudo make install cd ../ ``` +Next, install [Toxcore](https://github.com/irungentoo/toxcore/blob/master/INSTALL.md#osx) + Then, clone qTox: ```bash git clone https://github.com/tux3/qTox`` @@ -480,38 +522,36 @@ git clone https://github.com/tux3/qTox`` Finally, copy all required files. Whenever you update your brew packages, you may skip all of the above steps and simply run the following commands: ```bash -cd qTox +cd ./git/qTox sudo bash bootstrap-osx.sh ``` -###Compiling +#### Compiling +You can build qTox with Qt Creator [seperate download](http://www.qt.io/download-open-source/#section-6) or you can hunt down the version of home brew qt5 your using in the `/usr/local/Cellar/qt5/` directory. +e.g. `/usr/local/Cellar/qt5/5.5.1_2/bin/qmake` with `5.5.1_2` being the version of Qt5 that's been installed. -Either open Qt creator and hit build or run ```qmake && make``` in your qTox folder and it'll just work™. - -Note that if you use the CLI to build you'll need to add Qt5's bins to your path. +With that; in your terminal you can compile qTox in the git dir: ```bash -export PATH=$PATH:~/Qt/5.4/clang_64/bin/ +/usr/local/Cellar/qt5/5.5.1_2/bin/qmake ./qtox.pro ``` -### Fixing things up - -The bad news is that Qt breaks our linker paths so we need to fix those. First cd in to your qtox.app directory, if you used Qt Creator it's in ```~/build-qtox-Desktop_Qt_5_4_1_clang_64bit-Release``` most likely, otherwise it's in your qTox folder. - -Install qTox so we can copy its libraries and shove the following in a script somewhere: - +Or a cleaner method would be to: ```bash -~macdeployqt qtox.app -cp -r /Applications/qtox.app qtox_old.app -cp qtox.app/Contents/MacOS/qtox qtox_old.app/Contents/MacOS/qtox -rm -rf qtox.app -mv qtox_old.app qtox.app +cd ./git/dir/qTox +mkdir ./build +cd build +/usr/local/Cellar/qt5/5.5.1_2/bin/qmake ../qtox.pro ``` -* Give it a name like ~/deploy.qtox.sh -* cd in to the folder with qtox.app -* run ```bash ~/deploy.qtox.sh``` +#### Deploying +If you compiled qTox properly you can now deploy the `qTox.app` that's created where you built qTox so you can distribute the package. -### Running qTox +Using your qt5 homebrew installation from the build directory: +```bash +/usr/local/Cellar/qt5/5.5.1_2/bin/macdeployqt ./qTox.app +``` + +#### Running qTox You've got 2 choices, either click on the qTox app that suddenly exists, or do the following: ```bash qtox.app/Contents/MacOS/qtox diff --git a/osx/qTox-Mac-Deployer-ULTIMATE.sh b/osx/qTox-Mac-Deployer-ULTIMATE.sh index 5a91cfc7f..b5d47a9a4 100755 --- a/osx/qTox-Mac-Deployer-ULTIMATE.sh +++ b/osx/qTox-Mac-Deployer-ULTIMATE.sh @@ -57,7 +57,7 @@ function fcho() { printf "\n$msg\n" "$@" } -function build-toxcore() { +function build_toxcore() { echo "Starting Toxcore build and install" cd $TOXCORE_DIR echo "Now working in: ${PWD}" @@ -81,13 +81,13 @@ function build-toxcore() { fcho "Compiling toxcore." make > /dev/null || exit 1 fcho "Installing toxcore." - make install > /dev/null || exit 1 + sudo make install > /dev/null || exit 1 } function install() { fcho "==============================" - fcho "This script will install the nessicarry applications and libraries needed to compile qTox properly." - fcho "Note that this is not a 100 percent automated install it just helps simplfiy the process for less experianced or lazy users." + fcho "This script will install the necessary applications and libraries needed to compile qTox properly." + fcho "Note that this is not a 100 percent automated install it just helps simplify the process for less experienced or lazy users." if [[ $TRAVIS = true ]]; then #travis check echo "Oh... It's just Travis...." else @@ -109,22 +109,24 @@ function install() { fi brew install git ffmpeg qrencode autoconf check qt5 libvpx opus sqlcipher libsodium - fcho "Installing x-code Comand line tools ..." + fcho "Installing x-code Command line tools ..." xcode-select --install fcho "Starting git repo checks ..." cd $MAIN_DIR # just in case + # Toxcore if [[ -e $TOX_DIR/.git/index ]]; then # Check if this exists - fcho "Toxcore git repo already inplace !" + fcho "Toxcore git repo already in place !" cd $TOX_DIR git pull else fcho "Cloning Toxcore git ... " git clone https://github.com/irungentoo/toxcore.git fi + # qTox if [[ -e $QTOX_DIR/.git/index ]]; then # Check if this exists - fcho "qTox git repo already inplace !" + fcho "qTox git repo already in place !" cd $QTOX_DIR git pull else @@ -133,7 +135,7 @@ function install() { fi # filter_audio if [[ -e $FA_DIR/.git/index ]]; then # Check if this exists - fcho "Filter_Audio git repo already inplace !" + fcho "Filter_Audio git repo already in place !" cd $FA_DIR git pull else @@ -142,10 +144,11 @@ function install() { cd $FA_DIR fi fcho "Installing filter_audio." - make install PREFIX="${LIB_INSTALL_PREFIX}" - # toxcore + sudo make install PREFIX="${LIB_INSTALL_PREFIX}" + + # toxcore build if [[ $TRAVIS = true ]]; then #travis check - build-toxcore + build_toxcore else fcho "If all went well you should now have all the tools needed to compile qTox!" read -r -p "Would you like to install toxcore now? [y/N] " response @@ -158,7 +161,7 @@ function install() { fi # put required by qTox libs/headers in `libs/` cd "${QTOX_DIR}" - ./bootstrap-osx.sh + sudo ./bootstrap-osx.sh } function update() { @@ -184,7 +187,7 @@ function update() { read -r -p "Did qTox update from git? [y/N] " response if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then fcho "Starting OSX bootstrap ..." - ./bootstrap-osx.sh + sudo ./bootstrap-osx.sh else fcho "Moving on!" fi @@ -247,17 +250,19 @@ if [[ "$1" == "-ubd" ]]; then fi if [[ "$1" == "-h" ]]; then - echo "This script was created to help ease the process of compiling and creating a distribuable qTox package for OSX systems." - echo "The avilable commands are:" + echo "This script was created to help ease the process of compiling and creating a distributable qTox package for OSX systems." + echo "The available commands are:" echo "-h -- This help text." echo "-i -- A slightly automated process for getting an OSX machine ready to build Toxcore and qTox." echo "-u -- Check for updates and build Toxcore from git & update qTox from git." echo "-b -- Builds qTox in: ${BUILD_DIR}" - echo "-d -- Makes a distributeable qTox.app file in: ${DEPLOY_DIR}" + echo "-d -- Makes a distributable qTox.app file in: ${DEPLOY_DIR}" echo "-ubd -- Does -u, -b, and -d sequentially" fcho "Issues with Toxcore or qTox should be reported to their respective repos: https://github.com/irungentoo/toxcore | https://github.com/tux3/qTox" exit 0 fi -fcho "Oh dear! You seemed to of started this script improperly! Use -h to get avilable commands and information!" +fcho "Oh dear! You seemed to of started this script improperly! Use -h to get available commands and information!" +echo " " +say -v Kathy -r 255 "Oh dear! You seemed to of started this script improperly! Use -h to get available commands and information!" exit 0