mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Move all env vars into ci script
This commit is contained in:
parent
09ddb332d9
commit
6c42d36b18
@ -10,12 +10,7 @@ matrix:
|
|||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
sudo: false
|
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
|
- 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
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- python setup/unix-ci.py install
|
- python setup/unix-ci.py install
|
||||||
|
@ -15,6 +15,30 @@ _plat = sys.platform.lower()
|
|||||||
isosx = 'darwin' in _plat
|
isosx = 'darwin' in _plat
|
||||||
|
|
||||||
|
|
||||||
|
def setenv(key, val):
|
||||||
|
os.environ[key] = os.path.expandvars(val)
|
||||||
|
|
||||||
|
|
||||||
|
if isosx:
|
||||||
|
# On OS X the frameworks/dylibs contain hard coded paths, so we have to re-create the paths in the VM exactly
|
||||||
|
setenv('SWBASE', '/Users/kovid')
|
||||||
|
setenv('SW', '$SWBASE/sw')
|
||||||
|
setenv('PATH', '$SW/bin:$SW/qt/bin:$SW/python/Python.framework/Versions/2.7/bin:$PWD/node_modules/.bin:$PATH')
|
||||||
|
setenv('CFLAGS', '-I$SW/include')
|
||||||
|
setenv('LDFLAGS', '-L$SW/lib')
|
||||||
|
setenv('QMAKE', '$SW/qt/bin/qmake')
|
||||||
|
setenv('QT_PLUGIN_PATH', '$SW/qt/plugins')
|
||||||
|
else:
|
||||||
|
setenv('SW', '$HOME/sw')
|
||||||
|
setenv('PATH', '$SW/bin:$PATH')
|
||||||
|
setenv('CFLAGS', '-I$SW/include')
|
||||||
|
setenv('LDFLAGS', '-L$SW/lib')
|
||||||
|
setenv('LD_LIBRARY_PATH', '$SW/qt/lib:$SW/lib')
|
||||||
|
setenv('PKG_CONFIG_PATH', '$SW/lib/pkgconfig')
|
||||||
|
setenv('QMAKE', '$SW/qt/bin/qmake')
|
||||||
|
setenv('QT_PLUGIN_PATH', '$SW/qt/plugins')
|
||||||
|
|
||||||
|
|
||||||
def run(*args):
|
def run(*args):
|
||||||
if len(args) == 1:
|
if len(args) == 1:
|
||||||
args = shlex.split(args[0])
|
args = shlex.split(args[0])
|
||||||
@ -49,9 +73,15 @@ def main():
|
|||||||
if isosx:
|
if isosx:
|
||||||
os.makedirs(os.environ['SWBASE'])
|
os.makedirs(os.environ['SWBASE'])
|
||||||
run('sudo', 'chown', os.environ['USER'], os.environ['SWBASE'])
|
run('sudo', 'chown', os.environ['USER'], os.environ['SWBASE'])
|
||||||
download_and_decompress('https://download.calibre-ebook.com/travis/sw-osx.tar.bz2', os.environ['SWBASE'])
|
download_and_decompress(
|
||||||
|
'https://download.calibre-ebook.com/travis/sw-osx.tar.bz2',
|
||||||
|
os.environ['SWBASE']
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
download_and_decompress('https://download.calibre-ebook.com/travis/sw-linux.tar.xz', os.path.expanduser('~'))
|
download_and_decompress(
|
||||||
|
'https://download.calibre-ebook.com/travis/sw-linux.tar.xz',
|
||||||
|
os.path.expanduser('~')
|
||||||
|
)
|
||||||
|
|
||||||
run('npm install --no-optional rapydscript-ng')
|
run('npm install --no-optional rapydscript-ng')
|
||||||
print(os.environ['PATH'])
|
print(os.environ['PATH'])
|
||||||
@ -61,7 +91,8 @@ def main():
|
|||||||
run(python, 'setup.py', 'bootstrap', '--ephemeral')
|
run(python, 'setup.py', 'bootstrap', '--ephemeral')
|
||||||
elif action == 'test':
|
elif action == 'test':
|
||||||
if isosx:
|
if isosx:
|
||||||
os.environ['SSL_CERT_FILE'] = os.path.abspath('resources/mozilla-ca-certs.pem')
|
os.environ['SSL_CERT_FILE'
|
||||||
|
] = os.path.abspath('resources/mozilla-ca-certs.pem')
|
||||||
run(python, 'setup.py', 'test')
|
run(python, 'setup.py', 'test')
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user