-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
179 lines (157 loc) · 5.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
FROM quay.io/pypa/manylinux2014_x86_64
###############
# Build tools #
###############
# setup
RUN set -ex \
&& yum install wget git perl -y \
&& mkdir /build-tools
# pkg-config
RUN set -ex \
&& cd /build-tools \
&& PKG_CONFIG_VERSION="0.29.2" \
&& wget https://pkg-config.freedesktop.org/releases/pkg-config-${PKG_CONFIG_VERSION}.tar.gz \
&& tar xvf pkg-config-${PKG_CONFIG_VERSION}.tar.gz \
&& cd pkg-config-${PKG_CONFIG_VERSION} \
&& ./configure --with-internal-glib \
&& make -j4 \
&& make install \
&& pkg-config --version
# libressl
RUN set -ex \
&& cd /build-tools \
&& LIBRESSL_VERSION="3.3.3" \
&& wget https://github.com/libressl-portable/portable/archive/v${LIBRESSL_VERSION}.tar.gz \
&& tar xvf v${LIBRESSL_VERSION}.tar.gz \
&& cd portable-${LIBRESSL_VERSION} \
&& ./autogen.sh \
&& ./configure \
&& make -j4 \
&& make install
# cmake
RUN set -ex \
&& cd /build-tools \
&& CMAKE_VERSION="3.20.2" \
&& wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz \
&& tar xvf cmake-${CMAKE_VERSION}.tar.gz \
&& cd cmake-${CMAKE_VERSION} \
&& ./configure \
&& gmake -j4 \
&& make install \
&& cmake --version
# autoconf
RUN set -ex \
&& cd /build-tools \
&& AUTOCONF_VERSION="2.71" \
&& wget https://ftp.gnu.org/gnu/autoconf/autoconf-${AUTOCONF_VERSION}.tar.gz \
&& tar xvf autoconf-${AUTOCONF_VERSION}.tar.gz \
&& cd autoconf-${AUTOCONF_VERSION} \
&& ./configure \
&& make -j4 \
&& make install \
&& autoconf --version
# automake
RUN set -ex \
&& cd /build-tools \
&& AUTOMAKE_VERSION="1.16.3" \
&& wget https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.gz \
&& tar xvf automake-${AUTOMAKE_VERSION}.tar.gz \
&& cd automake-${AUTOMAKE_VERSION} \
&& ./configure \
&& make -j4 \
&& make install \
&& automake --version
# nasm
RUN set -ex \
&& cd /build-tools \
&& NASM_VERSION="2.15.05" \
&& wget https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz \
&& tar xvf nasm-${NASM_VERSION}.tar.gz \
&& cd nasm-${NASM_VERSION} \
&& ./configure \
&& make -j4 \
&& make install \
&& nasm --version
# cleanup
RUN set -ex \
&& cd / \
&& rm -rf /build-tools
################
# Dependencies #
################
# setup
RUN set -ex \
&& mkdir /build-deps
# x265
RUN set -ex \
&& cd /build-deps \
&& X265_VERSION="3.5" \
&& wget https://bitbucket.org/multicoreware/x265_git/downloads/x265_${X265_VERSION}.tar.gz \
&& tar xvf x265_${X265_VERSION}.tar.gz \
&& cd x265_${X265_VERSION} \
&& cmake -DCMAKE_INSTALL_PREFIX=/usr -G "Unix Makefiles" ./source \
&& make -j4 \
&& make install \
&& strip -s /usr/lib/libx265.so \
&& ldconfig
# libde265
RUN set -ex \
&& cd /build-deps \
&& LIBDE265_VERSION="1.0.8" \
&& wget https://github.com/strukturag/libde265/releases/download/v${LIBDE265_VERSION}/libde265-${LIBDE265_VERSION}.tar.gz \
&& tar xvf libde265-${LIBDE265_VERSION}.tar.gz \
&& cd libde265-${LIBDE265_VERSION} \
&& ./autogen.sh \
&& ./configure --prefix /usr \
&& make -j4 \
&& make install-strip \
&& ldconfig
# Rust
RUN set -ex \
&& curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN set -ex && source $HOME/.cargo/env \
&& cargo search --quiet --limit 1 a > /dev/null \
&& cargo install --force cbindgen
# libheif: step1 - rav1e
ENV LIBHEIF_VERSION 1.12.0
RUN set -ex \
&& cd /build-deps \
&& wget https://github.com/strukturag/libheif/releases/download/v${LIBHEIF_VERSION}/libheif-${LIBHEIF_VERSION}.tar.gz \
&& tar xvf libheif-${LIBHEIF_VERSION}.tar.gz \
&& cd libheif-${LIBHEIF_VERSION} \
&& source $HOME/.cargo/env \
&& mkdir -p third-party \
&& cd third-party \
&& wget https://raw.githubusercontent.com/strukturag/libheif/master/third-party/rav1e.cmd \
&& /bin/bash rav1e.cmd \
&& cp rav1e/dist/lib/pkgconfig/* ${PKG_CONFIG_PATH}
# libheif: step2 - dav1d
RUN yum install meson -y
RUN set -ex \
&& cd /build-deps/libheif-${LIBHEIF_VERSION}/third-party \
&& wget https://raw.githubusercontent.com/strukturag/libheif/master/third-party/dav1d.cmd \
&& /bin/bash dav1d.cmd \
&& cp dav1d/dist/lib64/pkgconfig/* ${PKG_CONFIG_PATH}
# libheif: step3 - libheif
RUN set -ex \
&& cd /build-deps/libheif-${LIBHEIF_VERSION} \
&& ./autogen.sh \
&& ./configure --prefix /usr \
&& make -j4 \
&& make install-strip \
&& ldconfig
##########################
# Build manylinux wheels #
##########################
# setup
ENV CARGO_TARGET_DIR /cargo_target
RUN mkdir /workdir "${CARGO_TARGET_DIR}"
RUN set -ex \
&& source $HOME/.cargo/env \
&& declare -a pythons=("cp36-cp36m" "cp37-cp37m" "cp38-cp38" "cp39-cp39") \
&& for PY in "${pythons[@]}"; do \
cd "/opt/python/${PY}/bin/" \
&& ./pip install --upgrade pip auditwheel twine setuptools setuptools-rust \
; \
done
ADD build.sh /