forked from opencv/opencv-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.sh
82 lines (67 loc) · 1.94 KB
/
config.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
#Customize multibuild logic that is run after entering docker.
#Sourced by docker_build_wrap.sh and docker_test_wrap.sh .
#Runs in Docker, so only the vars passed to `docker run' exist.
#See multibuild/README.rst
echo "=== Loading config.sh === "
# To see build progress
function build_wheel {
build_bdist_wheel $@
}
function bdist_wheel_cmd {
# copied from multibuild's common_utils.sh
# add osx deployment target so it doesnt default to 10.6
local abs_wheelhouse=$1
python setup.py bdist_wheel $BDIST_PARAMS
cp dist/*.whl $abs_wheelhouse
}
if [ -n "$IS_OSX" ]; then
echo " > OSX environment "
else
echo " > Linux environment "
fi
function pre_build {
echo "Starting pre-build"
set -e
if [ -n "$IS_OSX" ]; then
echo "Running for OSX"
brew update
echo 'Installing QT4'
brew tap | grep -qxF cartr/qt4 || brew tap -v cartr/qt4
brew tap --list-pinned | grep -qxF cartr/qt4 || brew tap-pin -v cartr/qt4
brew list --versions qt@4 || brew install -v qt@4
echo '-----------------'
echo '-----------------'
echo 'Installing FFmpeg'
# brew install does produce output regularly on a regular MacOS,
# but Travis doesn't see it for some reason
brew list --versions ffmpeg || \
travis_wait brew install -v ffmpeg --without-x264 --without-xvid --without-gpl
brew info ffmpeg
echo '-----------------'
else
echo "Running for linux"
fi
qmake -query
}
function run_tests {
# Runs tests on installed distribution from an empty directory
echo "Run tests..."
echo $PWD
if [ -n "$IS_OSX" ]; then
echo "Running for OS X"
cd ../tests/
else
echo "Running for linux"
cd /io/tests/
fi
test_wheels
}
function test_wheels {
PYTHON=python$PYTHON_VERSION
echo "Starting tests..."
#Test package
$PYTHON -m unittest test
}
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
set -x