1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

chore: Fix Mac OS X build.

- Add /usr/local to the search paths for includes and libs.
- Build toxcore before updating homebrew. Updating homebrew somehow breaks the
  toxcore build.
This commit is contained in:
iphydf 2016-07-29 18:57:42 +01:00 committed by Zetok Zalbavar
parent fca278f334
commit 07ac196326
No known key found for this signature in database
GPG Key ID: C953D3880212068A
5 changed files with 55 additions and 39 deletions

2
.gitignore vendored
View File

@ -13,3 +13,5 @@ build-*-Profile
build-*-Debug build-*-Debug
.DS_Store .DS_Store
doc/html/* doc/html/*
/.qmake.stash
/qtox.app

View File

@ -16,5 +16,6 @@ then
bash ./osx/qTox-Mac-Deployer-ULTIMATE.sh -i bash ./osx/qTox-Mac-Deployer-ULTIMATE.sh -i
bash ./osx/qTox-Mac-Deployer-ULTIMATE.sh -b bash ./osx/qTox-Mac-Deployer-ULTIMATE.sh -b
bash ./osx/qTox-Mac-Deployer-ULTIMATE.sh -d bash ./osx/qTox-Mac-Deployer-ULTIMATE.sh -d
bash ./osx/qTox-Mac-Deployer-ULTIMATE.sh -dmg # Disabled due to error: hdiutil: create failed - Resource busy
#bash ./osx/qTox-Mac-Deployer-ULTIMATE.sh -dmg
fi fi

View File

@ -21,6 +21,8 @@
# Use: ./qTox-Mac-Deployer-ULTIMATE.sh -h # Use: ./qTox-Mac-Deployer-ULTIMATE.sh -h
set -e
# Your home DIR really (Most of this happens in it) {DONT USE: ~ } # Your home DIR really (Most of this happens in it) {DONT USE: ~ }
SUBGIT="" #Change this to define a 'sub' git folder e.g. "-Patch" SUBGIT="" #Change this to define a 'sub' git folder e.g. "-Patch"
#Applys to $QTOX_DIR, $BUILD_DIR, and $DEPLOY_DIR folders for organization puropses #Applys to $QTOX_DIR, $BUILD_DIR, and $DEPLOY_DIR folders for organization puropses
@ -67,7 +69,9 @@ function build_toxcore() {
local LS_VER=($(ls ${LS_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p')) local LS_VER=($(ls ${LS_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p'))
local LS_DIR_VER="${LS_DIR}/${LS_VER[1]}" local LS_DIR_VER="${LS_DIR}/${LS_VER[1]}"
if [[ $TRAVIS != true ]]; then
sleep 3 sleep 3
fi
autoreconf -if autoreconf -if
@ -91,34 +95,29 @@ function install() {
read -n1 -rsp $'Press any key to continue or Ctrl+C to exit...\n' read -n1 -rsp $'Press any key to continue or Ctrl+C to exit...\n'
fi fi
#fcho "Installing x-code Command line tools ..."
#xcode-select --install
if [[ -e /usr/local/bin/brew ]]; then if [[ -e /usr/local/bin/brew ]]; then
fcho "Homebrew already installed!" fcho "Homebrew already installed!"
else else
fcho "Installing homebrew ..." fcho "Installing homebrew ..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi fi
if [[ $TRAVIS != true ]]; then
fcho "Updating brew formulas ..." fcho "Updating brew formulas ..."
if [[ $TRAVIS = true ]]; then
brew update > /dev/null
else
brew update brew update
fi fi
fcho "Getting home brew formulas ..." fcho "Getting home brew formulas ..."
sleep 3
if [[ $TRAVIS != true ]]; then #travis check if [[ $TRAVIS != true ]]; then #travis check
brew install wget libtool automake sleep 3
brew install git wget libtool autoconf automake
fi fi
brew install git ffmpeg qrencode autoconf check qt5 libvpx opus sqlcipher libsodium brew install check libvpx opus libsodium
QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p'))
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"
fcho "Installing x-code Command line tools ..."
xcode-select --install
fcho "Starting git repo checks ..." fcho "Starting git repo checks ..."
cd $MAIN_DIR # just in case #cd $MAIN_DIR # just in case
# Toxcore # Toxcore
if [[ -e $TOX_DIR/.git/index ]]; then # Check if this exists if [[ -e $TOX_DIR/.git/index ]]; then # Check if this exists
fcho "Toxcore git repo already in place !" fcho "Toxcore git repo already in place !"
@ -126,7 +125,7 @@ function install() {
git pull git pull
else else
fcho "Cloning Toxcore git ... " fcho "Cloning Toxcore git ... "
git clone https://github.com/irungentoo/toxcore.git git clone --depth=1 https://github.com/irungentoo/toxcore
fi fi
# qTox # qTox
if [[ $TRAVIS = true ]]; then #travis check if [[ $TRAVIS = true ]]; then #travis check
@ -150,11 +149,20 @@ function install() {
read -r -p "Would you like to install toxcore now? [y/N] " response read -r -p "Would you like to install toxcore now? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
build_toxcore build_toxcore
else else
fcho "You can simply use the -u command and say [Yes/n] when prompted" fcho "You can simply use the -u command and say [Yes/n] when prompted"
fi fi
fi fi
if [[ $TRAVIS = true ]]; then
fcho "Updating brew formulas ..."
brew update > /dev/null
fi
brew install ffmpeg qrencode qt5 sqlcipher
QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p'))
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"
# put required by qTox libs/headers in `libs/` # put required by qTox libs/headers in `libs/`
cd "${QTOX_DIR}" cd "${QTOX_DIR}"
sudo ./bootstrap-osx.sh sudo ./bootstrap-osx.sh
@ -192,8 +200,8 @@ function update() {
function build() { function build() {
fcho "------------------------------" fcho "------------------------------"
fcho "Starting build process ..." fcho "Starting build process ..."
rm -r $BUILD_DIR rm -rf $BUILD_DIR
rm -r $DEPLOY_DIR rm -rf $DEPLOY_DIR
mkdir $BUILD_DIR mkdir $BUILD_DIR
cd $BUILD_DIR cd $BUILD_DIR
fcho "Now working in ${PWD}" fcho "Now working in ${PWD}"

View File

@ -234,6 +234,11 @@ macx {
src/platform/camera/avfoundation.mm src/platform/camera/avfoundation.mm
} }
macx {
INCLUDEPATH += /usr/local/include
LIBPATH += /usr/local/lib
}
RESOURCES += res.qrc \ RESOURCES += res.qrc \
smileys/smileys.qrc smileys/smileys.qrc

View File

@ -18,7 +18,7 @@
# Script for verifying conformance to commit message format of commits in commit # Script for verifying conformance to commit message format of commits in commit
# range supplied. # range supplied.
# #
# Scrpt fails (non-zero exit status) if commit messages don't conform. # Script fails (non-zero exit status) if commit messages don't conform.
# usage: # usage:
# ./$script $commit_range # ./$script $commit_range
@ -31,7 +31,7 @@ echo "" # ← formatting
# Conform, /OR ELSE/. # Conform, /OR ELSE/.
if git log --format=format:'%s' "$ARG" | \ if git log --format=format:'%s' "$ARG" | \
grep -v -E '^((feat|fix|docs|style|refactor|perf|revert|test|chore)(\(.+\))?:.{1,68})|(Merge pull request #[[:digit:]]{4,10})$' grep -v -E '^((feat|fix|docs|style|refactor|perf|revert|test|chore)(\(.+\))?:.{1,68})|(Merge pull request #[[:digit:]]{1,10})$'
then then
echo "" echo ""
echo "Above ↑ commits don't conform to commit message format:" echo "Above ↑ commits don't conform to commit message format:"