Skip to content

Commit d7d135d

Browse files
committed
Add Qt 4.8.7 for GUI support to Linux and macOS builds
1 parent 3140bce commit d7d135d

10 files changed

+50
-70
lines changed

Diff for: .gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
url = https://github.com/Itseez/opencv.git
44
[submodule "multibuild"]
55
path = multibuild
6-
url = https://github.com/matthew-brett/multibuild.git
6+
url = https://github.com/skvark/multibuild.git
77
[submodule "opencv_contrib"]
88
path = opencv_contrib
99
url = https://github.com/opencv/opencv_contrib.git

Diff for: .travis.yml

+10-20
Original file line numberDiff line numberDiff line change
@@ -84,60 +84,50 @@ matrix:
8484
- os: linux
8585
env:
8686
- MB_PYTHON_VERSION=2.7
87-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
8887
- ENABLE_CONTRIB=0
8988
- os: linux
9089
env:
9190
- MB_PYTHON_VERSION=2.7
92-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
9391
- UNICODE_WIDTH=16
9492
- ENABLE_CONTRIB=0
9593
- os: linux
9694
env:
9795
- MB_PYTHON_VERSION=2.7
98-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
9996
- PLAT=i686
10097
- ENABLE_CONTRIB=0
10198
- os: linux
10299
env:
103100
- MB_PYTHON_VERSION=2.7
104-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
105101
- PLAT=i686
106102
- UNICODE_WIDTH=16
107103
- ENABLE_CONTRIB=0
108104
- os: linux
109105
env:
110106
- MB_PYTHON_VERSION=3.4
111-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
112107
- ENABLE_CONTRIB=0
113108
- os: linux
114109
env:
115110
- MB_PYTHON_VERSION=3.4
116-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
117111
- PLAT=i686
118112
- ENABLE_CONTRIB=0
119113
- os: linux
120114
env:
121115
- MB_PYTHON_VERSION=3.5
122-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
123116
- ENABLE_CONTRIB=0
124117
- os: linux
125118
env:
126119
- MB_PYTHON_VERSION=3.5
127-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
128120
- PLAT=i686
129121
- ENABLE_CONTRIB=0
130122
- os: linux
131123
env:
132124
- MB_PYTHON_VERSION=3.6
133-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
134125
- ENABLE_CONTRIB=0
135126
- BUILD_DEPENDS=numpy==1.11.3
136127
- TEST_DEPENDS=numpy==1.11.3
137128
- os: linux
138129
env:
139130
- MB_PYTHON_VERSION=3.6
140-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
141131
- PLAT=i686
142132
- ENABLE_CONTRIB=0
143133
- BUILD_DEPENDS=numpy==1.11.3
@@ -147,61 +137,61 @@ matrix:
147137
- os: linux
148138
env:
149139
- MB_PYTHON_VERSION=2.7
150-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
140+
151141
- ENABLE_CONTRIB=1
152142
- os: linux
153143
env:
154144
- MB_PYTHON_VERSION=2.7
155-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
145+
156146
- UNICODE_WIDTH=16
157147
- ENABLE_CONTRIB=1
158148
- os: linux
159149
env:
160150
- MB_PYTHON_VERSION=2.7
161-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
151+
162152
- PLAT=i686
163153
- ENABLE_CONTRIB=1
164154
- os: linux
165155
env:
166156
- MB_PYTHON_VERSION=2.7
167-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
157+
168158
- PLAT=i686
169159
- UNICODE_WIDTH=16
170160
- ENABLE_CONTRIB=1
171161
- os: linux
172162
env:
173163
- MB_PYTHON_VERSION=3.4
174-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
164+
175165
- ENABLE_CONTRIB=1
176166
- os: linux
177167
env:
178168
- MB_PYTHON_VERSION=3.4
179-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
169+
180170
- PLAT=i686
181171
- ENABLE_CONTRIB=1
182172
- os: linux
183173
env:
184174
- MB_PYTHON_VERSION=3.5
185-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
175+
186176
- ENABLE_CONTRIB=1
187177
- os: linux
188178
env:
189179
- MB_PYTHON_VERSION=3.5
190-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
180+
191181
- PLAT=i686
192182
- ENABLE_CONTRIB=1
193183
- os: linux
194184
env:
195185
- MB_PYTHON_VERSION=3.6
196-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
186+
197187
- BUILD_DEPENDS=numpy==1.11.3
198188
- TEST_DEPENDS=numpy==1.11.3
199189
- ENABLE_CONTRIB=1
200190

201191
- os: linux
202192
env:
203193
- MB_PYTHON_VERSION=3.6
204-
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
194+
205195
- PLAT=i686
206196
- BUILD_DEPENDS=numpy==1.11.3
207197
- TEST_DEPENDS=numpy==1.11.3

Diff for: LICENSE-3RD-PARTY.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ or tort (including negligence or otherwise) arising in any way out of
4444
the use of this software, even if advised of the possibility of such damage.
4545

4646
------------------------------------------------------------------------------
47-
FFmpeg is redistributed within opencv-python package.
48-
This license applies to FFmpeg binary in the directory cv2/.
47+
FFmpeg is redistributed within opencv-python Windows packages.
48+
Qt 4.8.7 is redistributed within opencv-python Linux and macOS packages
49+
This license applies to FFmpeg and Qt binaries in the directory cv2/.
4950

5051
GNU LESSER GENERAL PUBLIC LICENSE
5152
Version 2.1, February 1999

Diff for: LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016 Olli-Pekka Heinisuo, Carlos Martinez
3+
Copyright (c) 2016-2017 Olli-Pekka Heinisuo and contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: README.rst

+7-13
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ If you need only OpenCV Python bindings, no separate OpenCV installation is requ
1313

1414
**IMPORTANT NOTE**
1515

16-
MacOS and Linux wheels have currently some limitations:
17-
18-
- video related functionality is not supported (not compiled with FFmpeg)
19-
- for example ``cv2.imshow()`` will not work (not compiled with GTK+ 2.x or Carbon support)
16+
MacOS and Linux packages do not support video related functionality (not compiled with FFmpeg).
2017

2118
Installation and Usage
2219
----------------------
@@ -70,10 +67,6 @@ A: OpenCV video I/O depends heavily on FFmpeg. Manylinux and macOS OpenCV binari
7067
The purpose of these packages is to provide as easy as possible installation experience for OpenCV Python bindings and they should work directly out-of-the-box.
7168
Adding FFmpeg as an additional dependency without a "universal" FFmpeg build (e.g. LGPL licensed build like in the Windows wheels) the goal is considerably harder to achieve. This might change in the future.
7269

73-
**Q: Why I can't open GUI windows (``cv2.imshow()``) on GNU/Linux distribution X or on macOS?**
74-
75-
A: Like above, OpenCV was not compiled against GTK or Carbon. Support for these might be added in the future.
76-
7770
Documentation for opencv-python
7871
-------------------------------
7972

@@ -127,11 +120,10 @@ Currently the ``find_version.py`` file parses OpenCV version information
127120
from the OpenCV sources. OpenCV depends on numpy, so ``setup.py`` checks
128121
the minimum required numpy version also with the help of pip.
129122

130-
The ``cv2.pyd`` file is normally copied to site-packages.
131-
To avoid polluting the root folder the ``__init__.py`` file in cv2 folder
132-
handles the import logic correctly by importing the actual ``.pyd`` module
133-
and replacing the imported cv2 package in ``sys.modudes`` with the
134-
cv2 module to retain backward compatibility.
123+
The ``cv2.pyd/.so`` file is normally copied to site-packages.
124+
To avoid polluting the root folder this package wraps
125+
the statically built binary into cv2 package and ``__init__.py``
126+
file in the package handles the import logic correctly.
135127

136128
Since both ``opencv-python`` and ``opencv-contrib-python`` use the same namespace explained above,
137129
it is highly recommended to uninstall the other package before switching from example from
@@ -149,6 +141,8 @@ License <https://github.com/opencv/opencv/blob/master/LICENSE>`__
149141

150142
Windows wheels ship with `FFmpeg <http://ffmpeg.org>`__ licensed under the `LGPLv2.1 <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>`__.
151143

144+
Linux and MacOS wheels ship with `Qt 4.8.7 <http://doc.qt.io/qt-4.8/lgpl.html>`__ licensed under the `LGPLv2.1 <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>`__.
145+
152146
Versioning
153147
----------
154148

Diff for: README_CONTRIB.rst

+7-13
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ If you need only OpenCV Python bindings, no separate OpenCV installation is requ
1414

1515
**IMPORTANT NOTE**
1616

17-
MacOS and Linux wheels have currently some limitations:
18-
19-
- video related functionality is not supported (not compiled with FFmpeg)
20-
- for example ``cv2.imshow()`` will not work (not compiled with GTK+ 2.x or Carbon support)
17+
MacOS and Linux wheels do not support video related functionality (not compiled with FFmpeg).
2118

2219
Installation and Usage
2320
----------------------
@@ -66,10 +63,6 @@ A: OpenCV video I/O depends heavily on FFmpeg. Manylinux and macOS OpenCV binari
6663
The purpose of these packages is to provide as easy as possible installation experience for OpenCV Python bindings and they should work directly out-of-the-box.
6764
Adding FFmpeg as an additional dependency without a "universal" FFmpeg build (e.g. LGPL licensed build like in the Windows wheels) the goal is considerably harder to achieve. This might change in the future.
6865

69-
**Q: Why I can't open GUI windows (``cv2.imshow()``) on GNU/Linux distribution X or on macOS?**
70-
71-
A: Like above, OpenCV was not compiled against GTK or Carbon. Support for these might be added in the future.
72-
7366
Documentation for opencv-python
7467
-------------------------------
7568

@@ -123,11 +116,10 @@ Currently the ``find_version.py`` file parses OpenCV version information
123116
from the OpenCV sources. OpenCV depends on numpy, so ``setup.py`` checks
124117
the minimum required numpy version also with the help of pip.
125118

126-
The ``cv2.pyd/so`` file is normally copied to site-packages.
127-
To avoid polluting the root folder the ``__init__.py`` file in cv2 folder
128-
handles the import logic correctly by importing the actual ``.pyd./.so`` module
129-
and replacing the imported cv2 package in ``sys.modudes`` with the
130-
cv2 module to retain backward compatibility.
119+
The ``cv2.pyd/.so`` file is normally copied to site-packages.
120+
To avoid polluting the root folder this package wraps
121+
the statically built binary into cv2 package and ``__init__.py``
122+
file in the package handles the import logic correctly.
131123

132124
Since both ``opencv-python`` and ``opencv-python-contrib`` use the same namespace explained above,
133125
it is highly recommended to uninstall the other package before switching from example from
@@ -145,6 +137,8 @@ License <https://github.com/opencv/opencv/blob/master/LICENSE>`__
145137

146138
Windows wheels ship with `FFmpeg <http://ffmpeg.org>`__ licensed under the `LGPLv2.1 <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>`__.
147139

140+
Linux and MacOS wheels ship with `Qt 4.8.7 <http://doc.qt.io/qt-4.8/lgpl.html>`__ licensed under the `LGPLv2.1 <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>`__.
141+
148142
Versioning
149143
----------
150144

Diff for: config.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function run_tests {
4343
else
4444
echo "Running for linux"
4545
apt-get update
46-
apt-get -y install --fix-missing libglib2.0-0
46+
apt-get -y install --fix-missing libglib2.0-0 libsm6
4747
cd /io/tests/
4848
source /io/travis/test-wheels.sh
4949
fi

Diff for: multibuild

Diff for: travis/build-wheels-osx.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ echo 'PIP and brew installs'
1010

1111
pip install "$BUILD_DEPENDS"
1212

13+
brew tap cartr/qt4
14+
brew tap-pin cartr/qt4
15+
brew install qt@4
16+
17+
qmake -query
18+
1319
cd opencv
1420

1521
echo "Apply patch"
@@ -38,7 +44,7 @@ cd build
3844
if [[ $PYTHON_VERSION == 2* ]] && [[ $ENABLE_CONTRIB == 0 ]]; then
3945
echo 'Config for Py2'
4046
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_TOOLCHAIN_FILE=../../travis/toolchain_macos.cmake \
41-
-D BUILD_opencv_python3=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF \
47+
-D BUILD_opencv_python3=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF -D WITH_QT=4 \
4248
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
4349
-D BUILD_EXAMPLES=OFF \
4450
-D PYTHON2INTERP_FOUND=ON -DPYTHON2LIBS_FOUND=ON \
@@ -55,7 +61,7 @@ fi
5561
if [[ $PYTHON_VERSION == 3* ]] && [[ $ENABLE_CONTRIB == 0 ]]; then
5662
echo 'Config for Py3'
5763
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_TOOLCHAIN_FILE=../../travis/toolchain_macos.cmake \
58-
-D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF \
64+
-D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF -D WITH_QT=4 \
5965
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
6066
-D BUILD_EXAMPLES=OFF \
6167
-D PYTHON3INTERP_FOUND=ON -DPYTHON3LIBS_FOUND=ON \
@@ -72,7 +78,7 @@ fi
7278
if [[ $PYTHON_VERSION == 2* ]] && [[ $ENABLE_CONTRIB == 1 ]]; then
7379
echo 'Config for Py2'
7480
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_TOOLCHAIN_FILE=../../travis/toolchain_macos.cmake -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
75-
-D BUILD_opencv_python3=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF \
81+
-D BUILD_opencv_python3=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF -D WITH_QT=4 \
7682
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
7783
-D BUILD_EXAMPLES=OFF \
7884
-D PYTHON2INTERP_FOUND=ON -DPYTHON2LIBS_FOUND=ON \
@@ -89,7 +95,7 @@ fi
8995
if [[ $PYTHON_VERSION == 3* ]] && [[ $ENABLE_CONTRIB == 1 ]]; then
9096
echo 'Config for Py3'
9197
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_TOOLCHAIN_FILE=../../travis/toolchain_macos.cmake -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
92-
-D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF \
98+
-D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF -D WITH_QT=4 \
9399
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
94100
-D BUILD_EXAMPLES=OFF \
95101
-D PYTHON3INTERP_FOUND=ON -DPYTHON3LIBS_FOUND=ON \

Diff for: travis/build-wheels.sh

+9-14
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,6 @@ ENABLE_CONTRIB=$(<contrib.enabled)
99

1010
pip install "$BUILD_DEPENDS"
1111

12-
echo 'Install cmake 3.9.0'
13-
14-
wget --no-check-certificate https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz
15-
tar -zxf cmake-3.9.0.tar.gz
16-
cd cmake-3.9.0
17-
yum -y install curl-devel zlib-devel # need to build against system curl to get https support
18-
./bootstrap --system-curl
19-
make && make install
20-
cd ..
21-
2212
echo "Detect Python paths for OpenCV"
2313

2414
PYTHON_VERSION_STRING=$(python -c "from platform import python_version; print(python_version())")
@@ -38,10 +28,15 @@ echo 'Begin build'
3828
cd opencv
3929
mkdir build
4030

31+
export QTDIR=/opt/Qt4.8.7
32+
export PATH=$QTDIR/bin:$PATH
33+
34+
qmake -query
35+
4136
if [[ $PYTHON_VERSION == 2* ]] && [[ $ENABLE_CONTRIB == 0 ]]; then
4237
echo 'Config for Py2'
4338
cmake -H"." -B"build" -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python3=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF \
44-
-DWITH_IPP=OFF -DBUILD_DOCS=OFF \
39+
-DWITH_IPP=OFF -DBUILD_DOCS=OFF -DWITH_QT=4 \
4540
-DINSTALL_C_EXAMPLES=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF \
4641
-DBUILD_EXAMPLES=OFF \
4742
-DPYTHON2INTERP_FOUND=ON -DPYTHON2LIBS_FOUND=ON \
@@ -57,7 +52,7 @@ fi
5752
if [[ $PYTHON_VERSION == 3* ]] && [[ $ENABLE_CONTRIB == 0 ]]; then
5853
echo 'Config for Py3'
5954
cmake -H"." -B"build" -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python2=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF \
60-
-DWITH_IPP=OFF -DBUILD_DOCS=OFF \
55+
-DWITH_IPP=OFF -DBUILD_DOCS=OFF -DWITH_QT=4 \
6156
-DINSTALL_C_EXAMPLES=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF \
6257
-DBUILD_EXAMPLES=OFF \
6358
-DPYTHON3INTERP_FOUND=ON -DPYTHON3LIBS_FOUND=ON \
@@ -73,7 +68,7 @@ fi
7368
if [[ $PYTHON_VERSION == 2* ]] && [[ $ENABLE_CONTRIB == 1 ]]; then
7469
echo 'Config for Py2'
7570
cmake -H"." -B"build" -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python3=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF \
76-
-DWITH_IPP=OFF -DBUILD_DOCS=OFF \
71+
-DWITH_IPP=OFF -DBUILD_DOCS=OFF -DWITH_QT=4 \
7772
-DINSTALL_C_EXAMPLES=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF \
7873
-DBUILD_EXAMPLES=OFF \
7974
-DPYTHON2INTERP_FOUND=ON -DPYTHON2LIBS_FOUND=ON \
@@ -89,7 +84,7 @@ fi
8984
if [[ $PYTHON_VERSION == 3* ]] && [[ $ENABLE_CONTRIB == 1 ]]; then
9085
echo 'Config for Py3'
9186
cmake -H"." -B"build" -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python2=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF \
92-
-DWITH_IPP=OFF -DBUILD_DOCS=OFF \
87+
-DWITH_IPP=OFF -DBUILD_DOCS=OFF -DWITH_QT=4 \
9388
-DINSTALL_C_EXAMPLES=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF \
9489
-DBUILD_EXAMPLES=OFF \
9590
-DPYTHON3INTERP_FOUND=ON -DPYTHON3LIBS_FOUND=ON \

0 commit comments

Comments
 (0)