From eb059148da5680cadc23f5b5ee1ab918db873329 Mon Sep 17 00:00:00 2001 From: "Leroy.H.Y" Date: Sun, 23 Jun 2019 23:39:18 -0700 Subject: [PATCH] Travis-CI Patch for MacOS Build (#9) Former-commit-id: 90e2ab14c28adae8fec18e3f474caa1175c18064 --- .travis.yml | 25 +++++++++++++++++-------- Hv2ray.pro | 11 +++++++++++ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index a38f77df..f2b2dcce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,25 @@ language: cpp -dist: xenial -compiler: g++ -sudo: required + +matrix: + include: + - os: linux + dist: xenial + sudo: required + env: BADGE=linux + - os: osx + env: BADGE=osx before_install: - - sudo apt-get update + - if [ "$BADGE" = "linux" ]; then sudo apt-get update; fi install: - - sudo apt-get install qtchooser qt5-default - - sudo apt-get install qt5-qmake - - sudo apt-get install qtdeclarative5-dev python3-dev python-dev libpython3-dev qttools5-dev-tools - + - if [ "$BADGE" = "linux" ]; then sudo apt-get install qtchooser qt5-default qt5-qmake qtdeclarative5-dev python3-dev python-dev libpython3-dev qttools5-dev-tools; fi + - if [ "$BADGE" = "osx" ]; then brew install cppcheck https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/qt.rb; fi + - if [ "$BADGE" = "osx" ]; then brew link --force qt; fi + +before_script: + - if [ "$BADGE" = "osx" ]; then export PATH="/usr/local/opt/qt/bin:$PATH"; fi + script: - lrelease ./Hv2ray.pro - mkdir build && cd ./build diff --git a/Hv2ray.pro b/Hv2ray.pro index a6fde42b..92b630e3 100644 --- a/Hv2ray.pro +++ b/Hv2ray.pro @@ -113,6 +113,17 @@ macx { } } +macx { + PYTHON_ROOT=/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions + exists( "$$PYTHON_ROOT/3.6/include/python3.6m/Python.h" ) { + equals(WITH_PYTHON, "no") { + message("Will build with python lib version 3.6.5_1.") + INCLUDEPATH += $$PYTHON_ROOT/3.6/include/python3.6m/ + LIBS += -L$$PYTHON_ROOT/3.6/lib/python3.6/config-3.6m-darwin/ -lpython3.6m + WITH_PYTHON = yes + } + } +} unix: equals(WITH_PYTHON, "no") { error("No python libs found, did you install python3 dev package?") }