Skip to content

Commit 3d074be

Browse files
committed
initial manylinux2014 changes
1 parent 3575544 commit 3d074be

File tree

6 files changed

+110
-17
lines changed

6 files changed

+110
-17
lines changed
File renamed without changes.
File renamed without changes.

docker/manylinux2014/Dockerfile_i686

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM quay.io/pypa/manylinux2014_i686:latest
2+
3+
RUN yum install freetype-devel bzip2-devel curl-devel qt5-qtbase-devel -y
4+
5+
RUN mkdir ~/ffmpeg_sources && \
6+
cd ~/ffmpeg_sources && \
7+
curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \
8+
tar -xf OpenSSL_1_1_1c.tar.gz && \
9+
cd openssl-OpenSSL_1_1_1c && \
10+
# in i686, ./config detects x64 in i686 container without linux32
11+
# when run from "docker build"
12+
linux32 ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \
13+
make -j$(getconf _NPROCESSORS_ONLN) && \
14+
#skip installing documentation
15+
make install_sw && \
16+
rm -rf ~/openssl_build
17+
18+
RUN cd ~/ffmpeg_sources && \
19+
curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \
20+
tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \
21+
linux32 ./configure && \
22+
make -j$(getconf _NPROCESSORS_ONLN) && \
23+
make install
24+
25+
RUN cd ~/ffmpeg_sources && \
26+
curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \
27+
tar -xf yasm-1.3.0.tar.gz && \
28+
cd yasm-1.3.0 && \
29+
linux32 ./configure && \
30+
make -j$(getconf _NPROCESSORS_ONLN) && \
31+
make install
32+
33+
RUN cd ~/ffmpeg_sources && \
34+
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
35+
cd libvpx && \
36+
linux32 ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
37+
make -j$(getconf _NPROCESSORS_ONLN) && \
38+
make install
39+
40+
RUN cd ~/ffmpeg_sources && \
41+
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
42+
tar -xf ffmpeg-snapshot.tar.bz2 && \
43+
cd ffmpeg && \
44+
PATH=~/bin:$PATH && \
45+
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" linux32 ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \
46+
make -j$(getconf _NPROCESSORS_ONLN) && \
47+
make install && \
48+
echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
49+
ldconfig && \
50+
rm -rf ~/ffmpeg_sources
51+
52+
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig
53+
ENV LDFLAGS -L/root/ffmpeg_build/lib
54+
ENV PATH "$HOME/bin:$PATH"
+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
FROM quay.io/pypa/manylinux2014_x86_64:latest
2+
3+
RUN yum install freetype-devel bzip2-devel curl-devel qt5-qtbase-devel -y
4+
5+
RUN mkdir ~/ffmpeg_sources && \
6+
cd ~/ffmpeg_sources && \
7+
curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \
8+
tar -xf OpenSSL_1_1_1c.tar.gz && \
9+
cd openssl-OpenSSL_1_1_1c && \
10+
./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \
11+
make -j$(getconf _NPROCESSORS_ONLN) && \
12+
# skip installing documentation
13+
make install_sw && \
14+
rm -rf ~/openssl_build
15+
16+
RUN cd ~/ffmpeg_sources && \
17+
curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \
18+
tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \
19+
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
20+
make -j$(getconf _NPROCESSORS_ONLN) && \
21+
make install
22+
23+
RUN cd ~/ffmpeg_sources && \
24+
curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \
25+
tar -xf yasm-1.3.0.tar.gz && \
26+
cd yasm-1.3.0 && \
27+
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
28+
make -j$(getconf _NPROCESSORS_ONLN) && \
29+
make install
30+
31+
RUN cd ~/ffmpeg_sources && \
32+
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
33+
cd libvpx && \
34+
./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
35+
make -j$(getconf _NPROCESSORS_ONLN) && \
36+
make install
37+
38+
RUN cd ~/ffmpeg_sources && \
39+
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
40+
tar -xf ffmpeg-snapshot.tar.bz2 && \
41+
cd ffmpeg && \
42+
PATH=~/bin:$PATH && \
43+
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \
44+
make -j$(getconf _NPROCESSORS_ONLN) && \
45+
make install && \
46+
echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
47+
ldconfig && \
48+
rm -rf ~/ffmpeg_sources
49+
50+
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig
51+
ENV LDFLAGS -L/root/ffmpeg_build/lib
52+
ENV PATH "$HOME/bin:$PATH"

setup.py

+3-16
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def main():
3333

3434
numpy_version = get_or_install("numpy", minimum_supported_numpy)
3535
get_or_install("scikit-build")
36+
get_or_install("cmake")
3637
import skbuild
3738

3839
if os.path.exists('.git'):
@@ -125,11 +126,10 @@ def main():
125126
] + (["-DOPENCV_EXTRA_MODULES_PATH=" + os.path.abspath("opencv_contrib/modules")] if build_contrib else [])
126127

127128
# OS-specific components
128-
if sys.platform.startswith('linux') and not build_headless:
129-
cmake_args.append("-DWITH_QT=4")
129+
if sys.platform.startswith('linux') or sys.platform == 'darwin' and not build_headless:
130+
cmake_args.append("-DWITH_QT=5")
130131

131132
if sys.platform == 'darwin' and not build_headless:
132-
cmake_args.append("-DWITH_QT=5")
133133
rearrange_cmake_output_data['cv2.qt.plugins.platforms'] = [(r'lib/qt/plugins/platforms/libqcocoa\.dylib')]
134134

135135
if build_headless:
@@ -144,22 +144,9 @@ def main():
144144

145145
# Fixes for macOS builds
146146
if sys.platform == 'darwin':
147-
cmake_args.append("-DWITH_LAPACK=OFF") # Some OSX LAPACK fns are incompatible, see
148-
# https://github.com/skvark/opencv-python/issues/21
149-
cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++")
150147
cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9")
151148
subprocess.check_call("patch -p1 < patches/patchQtPlugins", shell=True)
152149

153-
if sys.platform.startswith('linux'):
154-
cmake_args.append("-DWITH_IPP=OFF") # tests fail with IPP compiled with
155-
# devtoolset-2 GCC 4.8.2 or vanilla GCC 4.9.4
156-
# see https://github.com/skvark/opencv-python/issues/138
157-
if sys.platform.startswith('linux') and not x64:
158-
cmake_args.append("-DCMAKE_CXX_FLAGS=-U__STRICT_ANSI__")
159-
# patch openEXR when building on i386, see: https://github.com/openexr/openexr/issues/128
160-
subprocess.check_call("patch -p0 < patches/patchOpenEXR", shell=True)
161-
162-
163150
if 'CMAKE_ARGS' in os.environ:
164151
import shlex
165152
cmake_args.extend(shlex.split(os.environ['CMAKE_ARGS']))

travis_multibuild_customize.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
44
set -x
55
REPO_DIR=$(dirname "${BASH_SOURCE[0]}")
6-
DOCKER_IMAGE='quay.io/skvark/manylinux1_$plat'
6+
DOCKER_IMAGE='quay.io/skvark/manylinux2014_$plat'

0 commit comments

Comments
 (0)