@@ -2,61 +2,103 @@ FROM quay.io/pypa/manylinux2014_aarch64:latest
22
33ARG CCACHE_VERSION=3.7.9
44ARG FFMPEG_VERSION=4.4.1
5+ ARG FREETYPE_VERSION=2.12.1
6+ ARG LIBPNG_VERSION=1.6.37
57ARG NASM_VERSION=2.15.04
6- ARG OPENSSL_VERSION=1_1_1m
8+ ARG OPENSSL_VERSION=1_1_1o
79ARG QT_VERSION=5.15.0
810ARG YASM_VERSION=1.3.0
911
10- RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y
12+ ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
13+
14+ # epel-release need for aarch64 to get openblas packages
15+ RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \
16+ yum install openblas-devel -y && \
17+ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \
18+ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \
19+ # libpng will be built from source
20+ yum remove libpng -y
21+
22+ RUN mkdir ~/libpng_sources && \
23+ cd ~/libpng_sources && \
24+ curl -O -L https://download.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.gz && \
25+ tar -xf libpng-${LIBPNG_VERSION}.tar.gz && \
26+ cd libpng-${LIBPNG_VERSION} && \
27+ ./configure --prefix=/usr/local && \
28+ make && \
29+ make install && \
30+ cd .. && \
31+ rm -rf ~/libpng_sources
32+
33+ RUN mkdir ~/freetype_sources && \
34+ cd ~/freetype_sources && \
35+ curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \
36+ tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \
37+ cd freetype-${FREETYPE_VERSION} && \
38+ ./configure --prefix="$HOME/ffmpeg_build" --enable-freetype-config && \
39+ make && \
40+ make install && \
41+ cd .. && \
42+ rm -rf ~/freetype_sources
1143
1244RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \
1345 tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \
14- cd qt-everywhere* && \
46+ cd qt-everywhere-src-${QT_VERSION} && \
1547 export MAKEFLAGS=-j$(nproc) && \
1648 ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \
1749 make && \
1850 make install && \
1951 cd .. && \
20- rm -rf qt-everywhere-src-${QT_VERSION} && \
21- rm qt-everywhere-src-${QT_VERSION}.tar.xz
52+ rm -rf qt-everywhere*
2253
2354ENV QTDIR /opt/Qt${QT_VERSION}
2455ENV PATH "$QTDIR/bin:$PATH"
2556
26- RUN mkdir ~/ffmpeg_sources && \
27- cd ~/ffmpeg_sources && \
57+ RUN mkdir ~/openssl_sources && \
58+ cd ~/openssl_sources && \
2859 curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \
2960 tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \
3061 cd openssl-OpenSSL_${OPENSSL_VERSION} && \
3162 ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \
3263 make -j$(getconf _NPROCESSORS_ONLN) && \
3364 # skip installing documentation
3465 make install_sw && \
35- rm -rf ~/openssl_build
66+ cd .. && \
67+ rm -rf ~/openssl_build ~/openssl_sources
3668
37- RUN cd ~/ffmpeg_sources && \
69+ RUN mkdir ~/nasm_sources && \
70+ cd ~/nasm_sources && \
3871 curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \
3972 tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \
4073 ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
4174 make -j$(getconf _NPROCESSORS_ONLN) && \
42- make install
75+ make install && \
76+ cd .. && \
77+ rm -rf ~/nasm_sources
4378
44- RUN cd ~/ffmpeg_sources && \
79+ RUN mkdir ~/yasm_sources && \
80+ cd ~/yasm_sources && \
4581 curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \
4682 tar -xf yasm-${YASM_VERSION}.tar.gz && \
4783 cd yasm-${YASM_VERSION} && \
4884 ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
4985 make -j$(getconf _NPROCESSORS_ONLN) && \
50- make install
86+ make install && \
87+ cd .. && \
88+ rm -rf ~/yasm_sources
5189
52- RUN cd ~/ffmpeg_sources && \
53- git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
90+ RUN mkdir ~/libvpx_sources && \
91+ cd ~/libvpx_sources && \
92+ git clone --depth 1 https://github.com/webmproject/libvpx.git && \
5493 cd libvpx && \
5594 ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
5695 make -j$(getconf _NPROCESSORS_ONLN) && \
57- make install
96+ make install && \
97+ cd .. && \
98+ rm -rf ~/libvpx_sources
5899
59- RUN cd ~/ffmpeg_sources && \
100+ RUN mkdir ~/ffmpeg_sources && \
101+ cd ~/ffmpeg_sources && \
60102 curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
61103 tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \
62104 cd ffmpeg-${FFMPEG_VERSION} && \
@@ -66,14 +108,21 @@ RUN cd ~/ffmpeg_sources && \
66108 make install && \
67109 echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
68110 ldconfig && \
69- rm -rf ~/ffmpeg_sources
111+ rm -rf ~/ffmpeg_sources && \
112+ yum remove bzip2-devel -y
70113
71114RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \
72115 tar -xf ccache-${CCACHE_VERSION}.tar.gz && \
73116 cd ccache-${CCACHE_VERSION} && \
74117 linux32 ./configure && \
75118 make -j$(getconf _NPROCESSORS_ONLN) && \
76- make install
119+ make install && \
120+ cd .. && \
121+ rm -rf ccache-${CCACHE_VERSION}.tar.gz
122+
123+ # Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced
124+ RUN mkdir /io && \
125+ git config --global --add safe.directory /io
77126
78127ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig
79128ENV LDFLAGS -L/root/ffmpeg_build/lib
0 commit comments