提交 d7d135dc 编写于 作者: O Olli-Pekka Heinisuo

Add Qt 4.8.7 for GUI support to Linux and macOS builds

上级 3140bce9
......@@ -3,7 +3,7 @@
url = https://github.com/Itseez/opencv.git
[submodule "multibuild"]
path = multibuild
url = https://github.com/matthew-brett/multibuild.git
url = https://github.com/skvark/multibuild.git
[submodule "opencv_contrib"]
path = opencv_contrib
url = https://github.com/opencv/opencv_contrib.git
......@@ -84,60 +84,50 @@ matrix:
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- ENABLE_CONTRIB=0
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- UNICODE_WIDTH=16
- ENABLE_CONTRIB=0
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- ENABLE_CONTRIB=0
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- UNICODE_WIDTH=16
- ENABLE_CONTRIB=0
- os: linux
env:
- MB_PYTHON_VERSION=3.4
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- ENABLE_CONTRIB=0
- os: linux
env:
- MB_PYTHON_VERSION=3.4
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- ENABLE_CONTRIB=0
- os: linux
env:
- MB_PYTHON_VERSION=3.5
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- ENABLE_CONTRIB=0
- os: linux
env:
- MB_PYTHON_VERSION=3.5
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- ENABLE_CONTRIB=0
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- ENABLE_CONTRIB=0
- BUILD_DEPENDS=numpy==1.11.3
- TEST_DEPENDS=numpy==1.11.3
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- ENABLE_CONTRIB=0
- BUILD_DEPENDS=numpy==1.11.3
......@@ -147,53 +137,53 @@ matrix:
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- ENABLE_CONTRIB=1
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- UNICODE_WIDTH=16
- ENABLE_CONTRIB=1
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- ENABLE_CONTRIB=1
- os: linux
env:
- MB_PYTHON_VERSION=2.7
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- UNICODE_WIDTH=16
- ENABLE_CONTRIB=1
- os: linux
env:
- MB_PYTHON_VERSION=3.4
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- ENABLE_CONTRIB=1
- os: linux
env:
- MB_PYTHON_VERSION=3.4
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- ENABLE_CONTRIB=1
- os: linux
env:
- MB_PYTHON_VERSION=3.5
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- ENABLE_CONTRIB=1
- os: linux
env:
- MB_PYTHON_VERSION=3.5
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- ENABLE_CONTRIB=1
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- DOCKER_IMAGE=quay.io/pypa/manylinux1_x86_64
- BUILD_DEPENDS=numpy==1.11.3
- TEST_DEPENDS=numpy==1.11.3
- ENABLE_CONTRIB=1
......@@ -201,7 +191,7 @@ matrix:
- os: linux
env:
- MB_PYTHON_VERSION=3.6
- DOCKER_IMAGE=quay.io/pypa/manylinux1_i686
- PLAT=i686
- BUILD_DEPENDS=numpy==1.11.3
- TEST_DEPENDS=numpy==1.11.3
......
......@@ -44,8 +44,9 @@ or tort (including negligence or otherwise) arising in any way out of
the use of this software, even if advised of the possibility of such damage.
------------------------------------------------------------------------------
FFmpeg is redistributed within opencv-python package.
This license applies to FFmpeg binary in the directory cv2/.
FFmpeg is redistributed within opencv-python Windows packages.
Qt 4.8.7 is redistributed within opencv-python Linux and macOS packages
This license applies to FFmpeg and Qt binaries in the directory cv2/.
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
......
MIT License
Copyright (c) 2016 Olli-Pekka Heinisuo, Carlos Martinez
Copyright (c) 2016-2017 Olli-Pekka Heinisuo and contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -13,10 +13,7 @@ If you need only OpenCV Python bindings, no separate OpenCV installation is requ
**IMPORTANT NOTE**
MacOS and Linux wheels have currently some limitations:
- video related functionality is not supported (not compiled with FFmpeg)
- for example ``cv2.imshow()`` will not work (not compiled with GTK+ 2.x or Carbon support)
MacOS and Linux packages do not support video related functionality (not compiled with FFmpeg).
Installation and Usage
----------------------
......@@ -70,10 +67,6 @@ A: OpenCV video I/O depends heavily on FFmpeg. Manylinux and macOS OpenCV binari
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.
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.
**Q: Why I can't open GUI windows (``cv2.imshow()``) on GNU/Linux distribution X or on macOS?**
A: Like above, OpenCV was not compiled against GTK or Carbon. Support for these might be added in the future.
Documentation for opencv-python
-------------------------------
......@@ -127,11 +120,10 @@ Currently the ``find_version.py`` file parses OpenCV version information
from the OpenCV sources. OpenCV depends on numpy, so ``setup.py`` checks
the minimum required numpy version also with the help of pip.
The ``cv2.pyd`` file is normally copied to site-packages.
To avoid polluting the root folder the ``__init__.py`` file in cv2 folder
handles the import logic correctly by importing the actual ``.pyd`` module
and replacing the imported cv2 package in ``sys.modudes`` with the
cv2 module to retain backward compatibility.
The ``cv2.pyd/.so`` file is normally copied to site-packages.
To avoid polluting the root folder this package wraps
the statically built binary into cv2 package and ``__init__.py``
file in the package handles the import logic correctly.
Since both ``opencv-python`` and ``opencv-contrib-python`` use the same namespace explained above,
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>`__
Windows wheels ship with `FFmpeg <http://ffmpeg.org>`__ licensed under the `LGPLv2.1 <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>`__.
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>`__.
Versioning
----------
......
......@@ -14,10 +14,7 @@ If you need only OpenCV Python bindings, no separate OpenCV installation is requ
**IMPORTANT NOTE**
MacOS and Linux wheels have currently some limitations:
- video related functionality is not supported (not compiled with FFmpeg)
- for example ``cv2.imshow()`` will not work (not compiled with GTK+ 2.x or Carbon support)
MacOS and Linux wheels do not support video related functionality (not compiled with FFmpeg).
Installation and Usage
----------------------
......@@ -66,10 +63,6 @@ A: OpenCV video I/O depends heavily on FFmpeg. Manylinux and macOS OpenCV binari
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.
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.
**Q: Why I can't open GUI windows (``cv2.imshow()``) on GNU/Linux distribution X or on macOS?**
A: Like above, OpenCV was not compiled against GTK or Carbon. Support for these might be added in the future.
Documentation for opencv-python
-------------------------------
......@@ -123,11 +116,10 @@ Currently the ``find_version.py`` file parses OpenCV version information
from the OpenCV sources. OpenCV depends on numpy, so ``setup.py`` checks
the minimum required numpy version also with the help of pip.
The ``cv2.pyd/so`` file is normally copied to site-packages.
To avoid polluting the root folder the ``__init__.py`` file in cv2 folder
handles the import logic correctly by importing the actual ``.pyd./.so`` module
and replacing the imported cv2 package in ``sys.modudes`` with the
cv2 module to retain backward compatibility.
The ``cv2.pyd/.so`` file is normally copied to site-packages.
To avoid polluting the root folder this package wraps
the statically built binary into cv2 package and ``__init__.py``
file in the package handles the import logic correctly.
Since both ``opencv-python`` and ``opencv-python-contrib`` use the same namespace explained above,
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>`__
Windows wheels ship with `FFmpeg <http://ffmpeg.org>`__ licensed under the `LGPLv2.1 <http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html>`__.
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>`__.
Versioning
----------
......
......@@ -43,7 +43,7 @@ function run_tests {
else
echo "Running for linux"
apt-get update
apt-get -y install --fix-missing libglib2.0-0
apt-get -y install --fix-missing libglib2.0-0 libsm6
cd /io/tests/
source /io/travis/test-wheels.sh
fi
......
Subproject commit 413205af2f6ee6976ac5f94da3e3aa012be91762
Subproject commit ad0ab85c3d3e3ec352c2c9bac973bd96da265c85
......@@ -10,6 +10,12 @@ echo 'PIP and brew installs'
pip install "$BUILD_DEPENDS"
brew tap cartr/qt4
brew tap-pin cartr/qt4
brew install qt@4
qmake -query
cd opencv
echo "Apply patch"
......@@ -38,7 +44,7 @@ cd build
if [[ $PYTHON_VERSION == 2* ]] && [[ $ENABLE_CONTRIB == 0 ]]; then
echo 'Config for Py2'
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_TOOLCHAIN_FILE=../../travis/toolchain_macos.cmake \
-D BUILD_opencv_python3=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF \
-D BUILD_opencv_python3=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF -D WITH_QT=4 \
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
-D BUILD_EXAMPLES=OFF \
-D PYTHON2INTERP_FOUND=ON -DPYTHON2LIBS_FOUND=ON \
......@@ -55,7 +61,7 @@ fi
if [[ $PYTHON_VERSION == 3* ]] && [[ $ENABLE_CONTRIB == 0 ]]; then
echo 'Config for Py3'
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_TOOLCHAIN_FILE=../../travis/toolchain_macos.cmake \
-D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF \
-D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF -D WITH_QT=4 \
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
-D BUILD_EXAMPLES=OFF \
-D PYTHON3INTERP_FOUND=ON -DPYTHON3LIBS_FOUND=ON \
......@@ -72,7 +78,7 @@ fi
if [[ $PYTHON_VERSION == 2* ]] && [[ $ENABLE_CONTRIB == 1 ]]; then
echo 'Config for Py2'
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 \
-D BUILD_opencv_python3=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF \
-D BUILD_opencv_python3=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF -D WITH_QT=4 \
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
-D BUILD_EXAMPLES=OFF \
-D PYTHON2INTERP_FOUND=ON -DPYTHON2LIBS_FOUND=ON \
......@@ -89,7 +95,7 @@ fi
if [[ $PYTHON_VERSION == 3* ]] && [[ $ENABLE_CONTRIB == 1 ]]; then
echo 'Config for Py3'
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 \
-D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF \
-D BUILD_opencv_python2=OFF -D BUILD_opencv_java=OFF -D BUILD_SHARED_LIBS=OFF -D WITH_LAPACK=OFF -D WITH_QT=4 \
-D INSTALL_C_EXAMPLES=OFF -D INSTALL_PYTHON_EXAMPLES=OFF -D BUILD_TESTS=OFF -D BUILD_PERF_TESTS=OFF \
-D BUILD_EXAMPLES=OFF \
-D PYTHON3INTERP_FOUND=ON -DPYTHON3LIBS_FOUND=ON \
......
......@@ -9,16 +9,6 @@ ENABLE_CONTRIB=$(<contrib.enabled)
pip install "$BUILD_DEPENDS"
echo 'Install cmake 3.9.0'
wget --no-check-certificate https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz
tar -zxf cmake-3.9.0.tar.gz
cd cmake-3.9.0
yum -y install curl-devel zlib-devel # need to build against system curl to get https support
./bootstrap --system-curl
make && make install
cd ..
echo "Detect Python paths for OpenCV"
PYTHON_VERSION_STRING=$(python -c "from platform import python_version; print(python_version())")
......@@ -38,10 +28,15 @@ echo 'Begin build'
cd opencv
mkdir build
export QTDIR=/opt/Qt4.8.7
export PATH=$QTDIR/bin:$PATH
qmake -query
if [[ $PYTHON_VERSION == 2* ]] && [[ $ENABLE_CONTRIB == 0 ]]; then
echo 'Config for Py2'
cmake -H"." -B"build" -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python3=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF \
-DWITH_IPP=OFF -DBUILD_DOCS=OFF \
-DWITH_IPP=OFF -DBUILD_DOCS=OFF -DWITH_QT=4 \
-DINSTALL_C_EXAMPLES=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
-DPYTHON2INTERP_FOUND=ON -DPYTHON2LIBS_FOUND=ON \
......@@ -57,7 +52,7 @@ fi
if [[ $PYTHON_VERSION == 3* ]] && [[ $ENABLE_CONTRIB == 0 ]]; then
echo 'Config for Py3'
cmake -H"." -B"build" -DCMAKE_BUILD_TYPE=Release -DBUILD_opencv_python2=OFF -DBUILD_opencv_java=OFF -DBUILD_SHARED_LIBS=OFF \
-DWITH_IPP=OFF -DBUILD_DOCS=OFF \
-DWITH_IPP=OFF -DBUILD_DOCS=OFF -DWITH_QT=4 \
-DINSTALL_C_EXAMPLES=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
-DPYTHON3INTERP_FOUND=ON -DPYTHON3LIBS_FOUND=ON \
......@@ -73,7 +68,7 @@ fi
if [[ $PYTHON_VERSION == 2* ]] && [[ $ENABLE_CONTRIB == 1 ]]; then
echo 'Config for Py2'
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 \
-DWITH_IPP=OFF -DBUILD_DOCS=OFF \
-DWITH_IPP=OFF -DBUILD_DOCS=OFF -DWITH_QT=4 \
-DINSTALL_C_EXAMPLES=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
-DPYTHON2INTERP_FOUND=ON -DPYTHON2LIBS_FOUND=ON \
......@@ -89,7 +84,7 @@ fi
if [[ $PYTHON_VERSION == 3* ]] && [[ $ENABLE_CONTRIB == 1 ]]; then
echo 'Config for Py3'
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 \
-DWITH_IPP=OFF -DBUILD_DOCS=OFF \
-DWITH_IPP=OFF -DBUILD_DOCS=OFF -DWITH_QT=4 \
-DINSTALL_C_EXAMPLES=OFF -DINSTALL_PYTHON_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF \
-DBUILD_EXAMPLES=OFF \
-DPYTHON3INTERP_FOUND=ON -DPYTHON3LIBS_FOUND=ON \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册