|
| 1 | +FROM quay.io/pypa/manylinux2014_ppc64le:latest |
| 2 | + |
| 3 | +RUN curl -O -L https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz && \ |
| 4 | + tar -xf qt-everywhere-opensource-src-4.8.7.tar.gz && \ |
| 5 | + cd qt-everywhere* && \ |
| 6 | + #configure does a bootstrap make under the hood |
| 7 | + #manylinux1 is too old to have `nproc` |
| 8 | + export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \ |
| 9 | + #OpenCV only links against QtCore, QtGui, QtTest |
| 10 | + ./configure -prefix /opt/Qt4.8.7 -release -opensource -confirm-license \ |
| 11 | + -no-sql-sqlite -no-qt3support -no-xmlpatterns -no-multimedia \ |
| 12 | + -no-webkit -no-script -no-declarative -no-dbus -make libs && \ |
| 13 | + make && \ |
| 14 | + make install && \ |
| 15 | + cd .. && \ |
| 16 | + rm -rf qt-everywhere-opensource-src-4.8.7 && \ |
| 17 | + rm qt-everywhere-opensource-src-4.8.7.tar.gz |
| 18 | + |
| 19 | +ENV QTDIR /opt/Qt4.8.7 |
| 20 | +ENV PATH "$QTDIR/bin:$PATH" |
| 21 | + |
| 22 | +RUN curl -O -L https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \ |
| 23 | + tar -xf cmake-3.9.0.tar.gz && \ |
| 24 | + cd cmake-3.9.0 && \ |
| 25 | + #manylinux1 provides curl-devel equivalent and libcurl statically linked |
| 26 | + # against the same newer OpenSSL as other source-built tools |
| 27 | + # (1.0.2s as of this writing) |
| 28 | + yum -y install zlib-devel && \ |
| 29 | + #configure does a bootstrap make under the hood |
| 30 | + export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \ |
| 31 | + ./configure --system-curl && \ |
| 32 | + make && \ |
| 33 | + make install && \ |
| 34 | + cd .. && \ |
| 35 | + rm -rf cmake-3.9.0* |
| 36 | + |
| 37 | +# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#GettheDependencies |
| 38 | +# manylinux provides the toolchain and git; we provide cmake |
| 39 | +RUN yum install freetype-devel bzip2-devel zlib-devel -y && \ |
| 40 | + mkdir ~/ffmpeg_sources |
| 41 | + |
| 42 | +# Newer openssl configure requires newer perl |
| 43 | +RUN curl -O -L https://www.cpan.org/src/5.0/perl-5.20.1.tar.gz && \ |
| 44 | + tar -xf perl-5.20.1.tar.gz && \ |
| 45 | + cd perl-5.20.1 && \ |
| 46 | + ./Configure -des -Dprefix="$HOME/openssl_build" && \ |
| 47 | + #perl build scripts do much redundant work |
| 48 | + # if running "make install" separately |
| 49 | + make install -j$(getconf _NPROCESSORS_ONLN) && \ |
| 50 | + cd .. && \ |
| 51 | + rm -rf perl-5.20.1* |
| 52 | + |
| 53 | +RUN cd ~/ffmpeg_sources && \ |
| 54 | + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \ |
| 55 | + tar -xf OpenSSL_1_1_1c.tar.gz && \ |
| 56 | + cd openssl-OpenSSL_1_1_1c && \ |
| 57 | + PERL="$HOME/openssl_build/bin/perl" ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \ |
| 58 | + make -j$(getconf _NPROCESSORS_ONLN) && \ |
| 59 | + #skip installing documentation |
| 60 | + make install_sw && \ |
| 61 | + rm -rf ~/openssl_build |
| 62 | + |
| 63 | +RUN cd ~/ffmpeg_sources && \ |
| 64 | + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \ |
| 65 | + tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \ |
| 66 | + ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ |
| 67 | + make -j$(getconf _NPROCESSORS_ONLN) && \ |
| 68 | + make install |
| 69 | + |
| 70 | +RUN cd ~/ffmpeg_sources && \ |
| 71 | + curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ |
| 72 | + tar -xf yasm-1.3.0.tar.gz && \ |
| 73 | + cd yasm-1.3.0 && \ |
| 74 | + ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ |
| 75 | + make -j$(getconf _NPROCESSORS_ONLN) && \ |
| 76 | + make install |
| 77 | + |
| 78 | +RUN cd ~/ffmpeg_sources && \ |
| 79 | + git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ |
| 80 | + cd libvpx && \ |
| 81 | + ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ |
| 82 | + make -j$(getconf _NPROCESSORS_ONLN) && \ |
| 83 | + make install |
| 84 | + |
| 85 | +RUN cd ~/ffmpeg_sources && \ |
| 86 | + curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ |
| 87 | + tar -xf ffmpeg-snapshot.tar.bz2 && \ |
| 88 | + cd ffmpeg && \ |
| 89 | + PATH=~/bin:$PATH && \ |
| 90 | + 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" && \ |
| 91 | + make -j$(getconf _NPROCESSORS_ONLN) && \ |
| 92 | + make install && \ |
| 93 | + echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ |
| 94 | + ldconfig && \ |
| 95 | + rm -rf ~/ffmpeg_sources |
| 96 | + |
| 97 | +ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig |
| 98 | +ENV LDFLAGS -L/root/ffmpeg_build/lib |
| 99 | + |
| 100 | +RUN curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/videodev2.h && \ |
| 101 | + curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \ |
| 102 | + curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \ |
| 103 | + curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \ |
| 104 | + mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux |
| 105 | + |
| 106 | +ENV PATH "$HOME/bin:$PATH" |
0 commit comments