From f89d7c2f673ffe85e1d0c6d29e2bcab9cc64b9f2 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 4 May 2016 12:41:49 +0800 Subject: [PATCH 1/4] Suppress warning on OSX builds --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 50c5ffccd..3a33b89b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -131,7 +131,7 @@ install: script: - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan - cd "$TRAVIS_BUILD_DIR" && ./bootstrap.sh && ./configure $qbtconf - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs/' src/Makefile ; fi + - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs -Wno-inconsistent-missing-override/' src/Makefile ; fi - make && make install after_success: From 926cbb18ead9bdd607d96e1d66c53460b5e85e91 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 4 May 2016 02:14:31 +0800 Subject: [PATCH 2/4] Re-enable cache for linux builds Enable cache for OSX builds --- .travis.yml | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3a33b89b8..6057eaf67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,10 +30,7 @@ notifications: # container-based builds #sudo: false -# TODO: osx builder does not enable cache yet, see: https://github.com/travis-ci/travis-ci/issues/4011 -#cache: - #directories: - #- $HOME/.ccache +cache: ccache # opt-in Ubuntu Trusty sudo: required @@ -80,12 +77,6 @@ before_install: - if [ "$gui" = false ]; then qbtconf="$qbtconf --disable-gui" ; fi - | if [ "$TRAVIS_OS_NAME" = "linux" ]; then - # ccache - #if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then - #dpkg-query -L ccache && export PATH="/usr/lib/ccache/:$PATH" && export use_ccache=true ; - #ccache -V && ccache --show-stats && ccache --zero-stats ; - #fi ; - # setup virtual display for after_success target if [ "$gui" = true ]; then export "DISPLAY=:99.0" && /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 ; fi ; fi @@ -117,21 +108,38 @@ install: # Qt if [ "$qt" = 4 ]; then sudo apt-get -qq install qt4-default libqt4-dev ; fi ; if [ "$qt" = 5 ]; then sudo apt-get -qq install qt5-default qtbase5-dev qttools5-dev-tools ; fi ; + + # ccache + if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then + dpkg-query -L ccache && export use_ccache=true ; + ccache -V && ccache --show-stats && ccache --zero-stats ; + fi ; fi - | if [ "$TRAVIS_OS_NAME" = "osx" ]; then # dependencies - brew update > /dev/null && brew install colormake libtorrent-rasterbar ; + brew update > /dev/null && brew install colormake ccache libtorrent-rasterbar ; # Qt if [ "$qt" = 4 ]; then brew install qt && ln -s /usr/local/Cellar/qt/4.8.7_2/plugins /usr/local ; fi ; if [ "$qt" = 5 ]; then brew install qt5 && brew link --force qt5 && ln -s /usr/local/Cellar/qt5/5.6.0/plugins /usr/local ; fi ; + + # ccache + if [ "$TRAVIS_BRANCH" != "$coverity_branch" ]; then + export PATH="/usr/local/opt/ccache/libexec:$PATH" && export use_ccache=true ; + ccache -V && ccache --show-stats && ccache --zero-stats ; + fi ; fi script: - if [ "$TRAVIS_BRANCH" = "$coverity_branch" ]; then exit ; fi # skip usual build when running coverity scan - cd "$TRAVIS_BUILD_DIR" && ./bootstrap.sh && ./configure $qbtconf - - if [ "$TRAVIS_OS_NAME" = "osx" ]; then sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs -Wno-inconsistent-missing-override/' src/Makefile ; fi + - | + if [ "$TRAVIS_OS_NAME" = "osx" ]; then + sed -i "" -e "s/^\(CC.*&&\).*$/\1 $CC/" src/Makefile ; # workaround for Qt & ccache: https://bugreports.qt.io/browse/QTBUG-31034 + sed -i "" -e "s/^\(CXX.*&&\).*$/\1 $CXX/" src/Makefile ; + sed -i "" -e 's/^\(CXXFLAGS.*\)$/\1 -Wno-unused-local-typedefs -Wno-inconsistent-missing-override/' src/Makefile ; + fi - make && make install after_success: From f4f4e31a7ad4f96e50fd61fc495f3dd7d0e846d7 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Wed, 4 May 2016 13:45:28 +0800 Subject: [PATCH 3/4] Use POSIX shell --- bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 4b05c83f8..f005e2ec8 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh aclocal -I m4 autoconf From 71143d14179495352d2cc7ad16b23a9c8d0654b1 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 8 May 2016 16:39:47 +0800 Subject: [PATCH 4/4] Use qmake built-in test function `files` to locate translation files --- src/src.pro | 49 +------------------------------------------------ 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/src/src.pro b/src/src.pro index 40ac30e2d..f9cabe5e2 100644 --- a/src/src.pro +++ b/src/src.pro @@ -36,8 +36,6 @@ nowebui: DEFINES += DISABLE_WEBUI strace_win: DEFINES += STACKTRACE_WIN QT += network xml -# Vars -LANG_PATH = lang CONFIG(debug, debug|release): message(Project is built in DEBUG mode.) CONFIG(release, debug|release): message(Project is built in RELEASE mode.) @@ -72,51 +70,6 @@ RESOURCES += \ searchengine.qrc # Translations -TRANSLATIONS = \ - $$LANG_PATH/qbittorrent_fr.ts \ - $$LANG_PATH/qbittorrent_zh.ts \ - $$LANG_PATH/qbittorrent_zh_TW.ts \ - $$LANG_PATH/qbittorrent_zh_HK.ts \ - $$LANG_PATH/qbittorrent_en.ts \ - $$LANG_PATH/qbittorrent_en_AU.ts \ - $$LANG_PATH/qbittorrent_en_GB.ts \ - $$LANG_PATH/qbittorrent_ca.ts \ - $$LANG_PATH/qbittorrent_es.ts \ - $$LANG_PATH/qbittorrent_eo.ts \ - $$LANG_PATH/qbittorrent_pl.ts \ - $$LANG_PATH/qbittorrent_ko.ts \ - $$LANG_PATH/qbittorrent_de.ts \ - $$LANG_PATH/qbittorrent_nl.ts \ - $$LANG_PATH/qbittorrent_tr.ts \ - $$LANG_PATH/qbittorrent_sv.ts \ - $$LANG_PATH/qbittorrent_el.ts \ - $$LANG_PATH/qbittorrent_ru.ts \ - $$LANG_PATH/qbittorrent_uk.ts \ - $$LANG_PATH/qbittorrent_bg.ts \ - $$LANG_PATH/qbittorrent_id.ts \ - $$LANG_PATH/qbittorrent_it.ts \ - $$LANG_PATH/qbittorrent_sk.ts \ - $$LANG_PATH/qbittorrent_sl.ts \ - $$LANG_PATH/qbittorrent_ro.ts \ - $$LANG_PATH/qbittorrent_pt_PT.ts \ - $$LANG_PATH/qbittorrent_nb.ts \ - $$LANG_PATH/qbittorrent_fi.ts \ - $$LANG_PATH/qbittorrent_da.ts \ - $$LANG_PATH/qbittorrent_ja.ts \ - $$LANG_PATH/qbittorrent_hu.ts \ - $$LANG_PATH/qbittorrent_pt_BR.ts \ - $$LANG_PATH/qbittorrent_cs.ts \ - $$LANG_PATH/qbittorrent_sr.ts \ - $$LANG_PATH/qbittorrent_ar.ts \ - $$LANG_PATH/qbittorrent_hr.ts \ - $$LANG_PATH/qbittorrent_gl.ts \ - $$LANG_PATH/qbittorrent_hy.ts \ - $$LANG_PATH/qbittorrent_lt.ts \ - $$LANG_PATH/qbittorrent_ka.ts \ - $$LANG_PATH/qbittorrent_be.ts \ - $$LANG_PATH/qbittorrent_eu.ts \ - $$LANG_PATH/qbittorrent_he.ts \ - $$LANG_PATH/qbittorrent_vi.ts \ - $$LANG_PATH/qbittorrent_hi_IN.ts +TRANSLATIONS += $$files(lang/qbittorrent_*.ts) DESTDIR = .