From 8b133bac430cc733361915c2aa89e3d1560a9bb0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 26 Jun 2016 07:48:16 +0530 Subject: [PATCH] Enable travis for OS X as well --- .travis.yml | 20 ++++++++++++++------ setup.py | 2 +- setup/installer/osx/build-scripts/export-sw | 7 +++++++ 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100755 setup/installer/osx/build-scripts/export-sw diff --git a/.travis.yml b/.travis.yml index ff276e0858..55824dfa2e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,3 @@ -sudo: false language: node_js nodejs: - 6 @@ -7,12 +6,21 @@ cache: - node_modules - .build-cache -env: - - SW=$HOME/sw PATH=$SW/bin:$PATH CFLAGS=-I$SW/include LDFLAGS=-L$SW/lib LD_LIBRARY_PATH=$SW/qt/lib:$SW/lib PKG_CONFIG_PATH=$SW/lib/pkgconfig QMAKE=$SW/qt/bin/qmake QT_PLUGIN_PATH=$SW/qt/plugins +matrix: + include: + - os: linux + sudo: false + env: + - SW=$HOME/sw PATH=$SW/bin:$PATH CFLAGS=-I$SW/include LDFLAGS=-L$SW/lib LD_LIBRARY_PATH=$SW/qt/lib:$SW/lib PKG_CONFIG_PATH=$SW/lib/pkgconfig QMAKE=$SW/qt/bin/qmake QT_PLUGIN_PATH=$SW/qt/plugins + - os: osx + env: + # On OS X the frameworks/dylibs contain hard coded paths, so we have to re-create the paths in the VM exactly + - SWBASE=/Users/kovid SW=$SWBASE/sw PATH=$SW/bin:$SW/qt/bin:$SW/python/Python.framework/Versions/2.7/bin:$PWD/node_modules/.bin:$PATH CFLAGS=-I$SW/include LDFLAGS=-L$SW/lib QMAKE=$SW/qt/bin/qmake QT_PLUGIN_PATH=$SW/qt/plugins MACOSX_DEPLOYMENT_TARGET=10.7 before_install: - - curl https://download.calibre-ebook.com/travis/sw-linux.tar.xz | tar xJ -C $HOME - - npm install rapydscript-ng && ln -s `pwd`/rapydscript-ng/bin/rapydscript $SW/bin/rapydscript - - rapydscript --version + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then curl https://download.calibre-ebook.com/travis/sw-linux.tar.xz | tar xJ -C $HOME; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then sudo mkdir -p $SWBASE && sudo chown $USER $SWBASE; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl https://download.calibre-ebook.com/travis/sw-osx.tar.bz2 | tar xj -C $SWBASE; fi + - npm install --no-optional rapydscript-ng && echo $PATH && which rapydscript && rapydscript --version - python setup.py bootstrap --ephemeral script: python setup.py test diff --git a/setup.py b/setup.py index 68d96d87e7..0ea37864bd 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def check_version_info(): vi = sys.version_info if vi[0] == 2 and vi[1:3] >= (7, 9): return None - raise SystemExit('calibre requires python >= 2.7.9 and < 3') + raise SystemExit('calibre requires python >= 2.7.9 and < 3. Current python version: %s' % vi) check_version_info() sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) diff --git a/setup/installer/osx/build-scripts/export-sw b/setup/installer/osx/build-scripts/export-sw new file mode 100755 index 0000000000..86e79e6cdf --- /dev/null +++ b/setup/installer/osx/build-scripts/export-sw @@ -0,0 +1,7 @@ +#!/bin/sh +cd $HOME +rm sw-osx*; +echo "[Paths]\nPrefix = .." > ~/sw/qt/bin/qt.conf && cat ~/sw/qt/bin/qt.conf +echo "[Paths]\nPrefix = ../qt" > ~/sw/bin/qt.conf && cat ~/sw/bin/qt.conf +tar cf sw-osx.tar --exclude sw/build --exclude sw/sources --exclude sw/man --exclude '*.pyc' --exclude '*.pyo' --exclude 'sw/share/doc' --exclude sw/share/gtk-doc --exclude sw/share/man --exclude sw/share/info sw && bzip2 --best sw-osx.tar +rm ~/sw/qt/bin/qt.conf ~/sw/bin/qt.conf