@@ -26,12 +26,10 @@ RUN apk add --no-cache \
26
26
fontconfig-dev fontconfig-static \
27
27
freetype freetype-dev freetype-static \
28
28
graphite2-static \
29
- glib-static \
30
29
tiff tiff-dev \
31
30
libjpeg-turbo libjpeg-turbo-dev \
32
31
libpng-dev libpng-static \
33
32
giflib giflib-dev \
34
- harfbuzz-dev harfbuzz-static \
35
33
fribidi-dev fribidi-static \
36
34
brotli-dev brotli-static \
37
35
soxr-dev soxr-static \
@@ -44,7 +42,12 @@ RUN apk add --no-cache \
44
42
snappy snappy-dev snappy-static \
45
43
xxd \
46
44
xz-dev xz-static \
45
+ python3 py3-packaging \
46
+ linux-headers \
47
47
curl
48
+
49
+ # linux-headers need by rtmpdump
50
+ # python3 py3-packaging needed by glib
48
51
49
52
# -O3 makes sure we compile with optimization. setting CFLAGS/CXXFLAGS seems to override
50
53
# default automake cflags.
@@ -78,6 +81,118 @@ RUN \
78
81
# extra libs stdc++ is for vmaf https://github.com/Netflix/vmaf/issues/788
79
82
RUN sed -i 's/-lvmaf /-lvmaf -lstdc++ /' /usr/local/lib/pkgconfig/libvmaf.pc
80
83
84
+ # own build as alpine glib links with libmount etc
85
+ # bump: glib /GLIB_VERSION=([\d.]+)/ https://gitlab.gnome.org/GNOME/glib.git|^2
86
+ # bump: glib after ./hashupxate Dockerfile GLIB $LATEST
87
+ # bump: glib link "NEWS" https://gitlab.gnome.org/GNOME/glib/-/blob/main/NEWS?ref_type=heads
88
+ ARG GLIB_VERSION=2.80.2
89
+ ARG GLIB_URL="https://download.gnome.org/sources/glib/2.80/glib-$GLIB_VERSION.tar.xz"
90
+ ARG GLIB_SHA256=b9cfb6f7a5bd5b31238fd5d56df226b2dda5ea37611475bf89f6a0f9400fe8bd
91
+ RUN \
92
+ wget -O glib.tar.xz "$GLIB_URL" && \
93
+ echo "$GLIB_SHA256 glib.tar.xz" | sha256sum --status -c - && \
94
+ tar xf glib.tar.xz && \
95
+ cd glib-* && \
96
+ mkdir -p _build && \
97
+ meson \
98
+ -Dbuildtype=release \
99
+ -Ddefault_library=static \
100
+ -Dlibmount=disabled \
101
+ build && \
102
+ meson compile -C build && \
103
+ meson install --no-rebuild -C build
104
+
105
+ # bump: harfbuzz /LIBHARFBUZZ_VERSION=([\d.]+)/ https://github.com/harfbuzz/harfbuzz.git|*
106
+ # bump: harfbuzz after ./hashupxate Dockerfile LIBHARFBUZZ $LATEST
107
+ # bump: harfbuzz link "NEWS" https://github.com/harfbuzz/harfbuzz/blob/main/NEWS
108
+ ARG LIBHARFBUZZ_VERSION=8.5.0
109
+ ARG LIBHARFBUZZ_URL="https://github.com/harfbuzz/harfbuzz/releases/download/$LIBHARFBUZZ_VERSION/harfbuzz-$LIBHARFBUZZ_VERSION.tar.xz"
110
+ ARG LIBHARFBUZZ_SHA256=77e4f7f98f3d86bf8788b53e6832fb96279956e1c3961988ea3d4b7ca41ddc27
111
+ RUN \
112
+ wget -O harfbuzz.tar.xz "$LIBHARFBUZZ_URL" && \
113
+ echo "$LIBHARFBUZZ_SHA256 harfbuzz.tar.xz" | sha256sum --status -c - && \
114
+ tar xf harfbuzz.tar.xz && \
115
+ cd harfbuzz-* && \
116
+ mkdir -p _build && \
117
+ meson \
118
+ -Dbuildtype=release \
119
+ -Ddefault_library=static \
120
+ build && \
121
+ meson compile -C build && \
122
+ meson install --no-rebuild -C build
123
+
124
+ # bump: cairo /CAIRO_VERSION=([\d.]+)/ https://gitlab.freedesktop.org/cairo/cairo.git|^1
125
+ # bump: cairo after ./hashupxate Dockerfile CAIRO $LATEST
126
+ # bump: cairo link "NEWS" https://gitlab.freedesktop.org/cairo/cairo/-/blob/master/NEWS?ref_type=heads
127
+ ARG CAIRO_VERSION=1.18.0
128
+ ARG CAIRO_URL="https://cairographics.org/releases/cairo-$CAIRO_VERSION.tar.xz"
129
+ ARG CAIRO_SHA256=243a0736b978a33dee29f9cca7521733b78a65b5418206fef7bd1c3d4cf10b64
130
+ RUN \
131
+ wget -O cairo.tar.xz "$CAIRO_URL" && \
132
+ echo "$CAIRO_SHA256 cairo.tar.xz" | sha256sum --status -c - && \
133
+ tar xf cairo.tar.xz && \
134
+ cd cairo-* && \
135
+ mkdir -p _build && \
136
+ meson \
137
+ -Dbuildtype=release \
138
+ -Ddefault_library=static \
139
+ -Dtests=disabled \
140
+ -Dquartz=disabled \
141
+ -Dxcb=disabled \
142
+ -Dxlib=disabled \
143
+ -Dxlib-xcb=disabled \
144
+ build && \
145
+ meson compile -C build && \
146
+ meson install --no-rebuild -C build
147
+
148
+ # TODO: there is weird "1.90" tag, skip it
149
+ # bump: pango /PANGO_VERSION=([\d.]+)/ https://github.com/GNOME/pango.git|/\d+\.\d+\.\d+/|*
150
+ # bump: pango after ./hashupxate Dockerfile PANGO $LATEST
151
+ # bump: pango link "NEWS" https://gitlab.gnome.org/GNOME/pango/-/blob/main/NEWS?ref_type=heads
152
+ ARG PANGO_VERSION=1.52.2
153
+ ARG PANGO_URL="https://download.gnome.org/sources/pango/1.52/pango-$PANGO_VERSION.tar.xz"
154
+ ARG PANGO_SHA256=d0076afe01082814b853deec99f9349ece5f2ce83908b8e58ff736b41f78a96b
155
+ # TODO: add -Dbuild-testsuite=false when in stable release
156
+ # TODO: -Ddefault_library=both currently to not fail building tests
157
+ RUN \
158
+ wget -O pango.tar.xz "$PANGO_URL" && \
159
+ echo "$PANGO_SHA256 pango.tar.xz" | sha256sum --status -c - && \
160
+ tar xf pango.tar.xz && \
161
+ cd pango-* && \
162
+ mkdir -p _build && \
163
+ meson \
164
+ -Dbuildtype=release \
165
+ -Ddefault_library=both \
166
+ -Dintrospection=disabled \
167
+ -Dgtk_doc=false \
168
+ build && \
169
+ meson compile -C build && \
170
+ meson install --no-rebuild -C build
171
+
172
+ # bump: librsvg /LIBRSVG_VERSION=([\d.]+)/ https://gitlab.gnome.org/GNOME/librsvg.git|^2
173
+ # bump: librsvg after ./hashupxate Dockerfile LIBRSVG $LATEST
174
+ # bump: librsvg link "NEWS" https://gitlab.gnome.org/GNOME/librsvg/-/blob/master/NEWS
175
+ ARG LIBRSVG_VERSION=2.58.91
176
+ ARG LIBRSVG_URL="https://download.gnome.org/sources/librsvg/2.58/librsvg-$LIBRSVG_VERSION.tar.xz"
177
+ ARG LIBRSVG_SHA256=65846ae57c11aba288bf3a6fe517f800f7e38e7fbc79b98c99a8177634ed29f7
178
+ RUN \
179
+ wget -O librsvg.tar.xz "$LIBRSVG_URL" && \
180
+ echo "$LIBRSVG_SHA256 librsvg.tar.xz" | sha256sum --status -c - && \
181
+ tar xf librsvg.tar.xz && \
182
+ cd librsvg-* && \
183
+ mkdir -p _build && \
184
+ meson setup _build \
185
+ -Dbuildtype=release \
186
+ -Ddefault_library=static \
187
+ -Ddocs=disabled \
188
+ -Dintrospection=disabled \
189
+ -Dpixbuf=disabled \
190
+ -Dpixbuf-loader=disabled \
191
+ -Dvala=disabled \
192
+ -Dtests=false && \
193
+ meson compile -C _build && \
194
+ meson install -C _build
195
+
81
196
# build after libvmaf
82
197
# bump: aom /AOM_VERSION=([\d.]+)/ git:https://aomedia.googlesource.com/aom|*
83
198
# bump: aom after ./hashupdate Dockerfile AOM $LATEST
@@ -151,7 +266,7 @@ RUN \
151
266
cd libbluray-* && \
152
267
sed -i 's/dec_init/libbluray_dec_init/' src/libbluray/disc/* && \
153
268
git clone https://code.videolan.org/videolan/libudfread.git contrib/libudfread && \
154
- (cd contrib/libudfread && git checkout $LIBUDFREAD_COMMIT) && \
269
+ (cd contrib/libudfread && git checkout --recurse-submodules $LIBUDFREAD_COMMIT) && \
155
270
autoreconf -fiv && \
156
271
./configure \
157
272
--with-pic \
@@ -212,7 +327,7 @@ ARG LIBGME_URL="https://github.com/libgme/game-music-emu.git"
212
327
ARG LIBGME_COMMIT=74449b553fef6528e1fd9d2dccc6413ded1d5e39
213
328
RUN \
214
329
git clone "$LIBGME_URL" && \
215
- cd game-music-emu && git checkout $LIBGME_COMMIT && \
330
+ cd game-music-emu && git checkout --recurse-submodules $LIBGME_COMMIT && \
216
331
mkdir build && cd build && \
217
332
cmake \
218
333
-G"Unix Makefiles" \
@@ -230,7 +345,7 @@ ARG LIBGSM_URL="https://github.com/timothytylee/libgsm.git"
230
345
ARG LIBGSM_COMMIT=98f1708fb5e06a0dfebd58a3b40d610823db9715
231
346
RUN \
232
347
git clone "$LIBGSM_URL" && \
233
- cd libgsm && git checkout $LIBGSM_COMMIT && \
348
+ cd libgsm && git checkout --recurse-submodules $LIBGSM_COMMIT && \
234
349
# Makefile is hard to use, hence use specific compile arguments and flags
235
350
# no need to build toast cli tool \
236
351
rm src/toast* && \
@@ -415,7 +530,8 @@ ARG LIBRTMP_URL="https://git.ffmpeg.org/rtmpdump.git"
415
530
ARG LIBRTMP_COMMIT=6f6bb1353fc84f4cc37138baa99f586750028a01
416
531
RUN \
417
532
git clone "$LIBRTMP_URL" && \
418
- cd rtmpdump && git checkout $LIBRTMP_COMMIT && \
533
+ cd rtmpdump && \
534
+ git checkout --recurse-submodules $LIBRTMP_COMMIT && \
419
535
make SYS=posix SHARED=off -j$(nproc) install
420
536
421
537
# bump: rubberband /RUBBERBAND_VERSION=([\d.]+)/ https://github.com/breakfastquay/rubberband.git|^2
@@ -600,7 +716,8 @@ ARG UAVS3D_COMMIT=1fd04917cff50fac72ae23e45f82ca6fd9130bd8
600
716
# Removes BIT_DEPTH 10 to be able to build on other platforms. 10 was overkill anyways.
601
717
RUN \
602
718
git clone "$UAVS3D_URL" && \
603
- cd uavs3d && git checkout $UAVS3D_COMMIT && \
719
+ cd uavs3d && \
720
+ git checkout --recurse-submodules $UAVS3D_COMMIT && \
604
721
mkdir build/linux && cd build/linux && \
605
722
cmake \
606
723
-G"Unix Makefiles" \
@@ -706,7 +823,7 @@ ARG X264_VERSION=31e19f92f00c7003fa115047ce50978bc98c3a0d
706
823
RUN \
707
824
git clone "$X264_URL" && \
708
825
cd x264 && \
709
- git checkout $X264_VERSION && \
826
+ git checkout --recurse-submodules $X264_VERSION && \
710
827
./configure --enable-pic --enable-static --disable-cli --disable-lavf --disable-swscale && \
711
828
make -j$(nproc) install
712
829
@@ -871,9 +988,15 @@ ARG FFMPEG_URL="https://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2"
871
988
ARG FFMPEG_SHA256=a24d9074bf5523a65aaa9e7bd02afe4109ce79d69bd77d104fed3dab4b934d7a
872
989
ARG ENABLE_FDKAAC=
873
990
# sed changes --toolchain=hardened -pie to -static-pie
874
- # extra ldflags stack-size=2097152 is to increase default stack size from 128KB (musl default) to something
991
+ #
992
+ # ldflags stack-size=2097152 is to increase default stack size from 128KB (musl default) to something
875
993
# more similar to glibc (2MB). This fixing segfault with libaom-av1 and libsvtav1 as they seems to pass
876
994
# large things on the stack.
995
+ #
996
+ # ldfalgs -Wl,--allow-multiple-definition is a workaround for linking with multiple rust staticlib to
997
+ # not cause collision in toolchain symbols
998
+ # TODO: could this hide real problems with other libraries?
999
+ # see https://github.com/rust-lang/rust/issues/104707
877
1000
RUN \
878
1001
wget $WGET_OPTS -O ffmpeg.tar.bz2 "$FFMPEG_URL" && \
879
1002
echo "$FFMPEG_SHA256 ffmpeg.tar.bz2" | sha256sum -c - && \
@@ -884,7 +1007,7 @@ RUN \
884
1007
./configure \
885
1008
--pkg-config-flags="--static" \
886
1009
--extra-cflags="-fopenmp" \
887
- --extra-ldflags="-fopenmp -Wl,-z,stack-size=2097152" \
1010
+ --extra-ldflags="-fopenmp -Wl,--allow-multiple-definition -Wl,- z,stack-size=2097152" \
888
1011
--toolchain=hardened \
889
1012
--disable-debug \
890
1013
--disable-shared \
@@ -918,6 +1041,7 @@ RUN \
918
1041
--enable-libopus \
919
1042
--enable-librabbitmq \
920
1043
--enable-librav1e \
1044
+ --enable-librsvg \
921
1045
--enable-librtmp \
922
1046
--enable-librubberband \
923
1047
--enable-libshine \
@@ -939,8 +1063,8 @@ RUN \
939
1063
--enable-libx264 \
940
1064
--enable-libx265 \
941
1065
--enable-libxavs2 \
942
- --enable-libxeve \
943
1066
--enable-libxevd \
1067
+ --enable-libxeve \
944
1068
--enable-libxml2 \
945
1069
--enable-libxvid \
946
1070
--enable-libzimg \
@@ -955,7 +1079,6 @@ RUN \
955
1079
FONTCONFIG_VERSION=$(pkg-config --modversion fontconfig) \
956
1080
FREETYPE_VERSION=$(pkg-config --modversion freetype2) \
957
1081
FRIBIDI_VERSION=$(pkg-config --modversion fribidi) \
958
- LIBHARFBUZZ_VERSION=$(pkg-config --modversion harfbuzz) \
959
1082
LIBSAMPLERATE_VERSION=$(pkg-config --modversion samplerate) \
960
1083
LIBVO_AMRWBENC_VERSION=$(pkg-config --modversion vo-amrwbenc) \
961
1084
LIBXML2_VERSION=$(pkg-config --modversion libxml-2.0) \
@@ -992,6 +1115,7 @@ RUN \
992
1115
libopus: env.OPUS_VERSION, \
993
1116
librabbitmq: env.LIBRABBITMQ_VERSION, \
994
1117
librav1e: env.RAV1E_VERSION, \
1118
+ librsvg: env.LIBRSVG_VERSION, \
995
1119
librtmp: env.LIBRTMP_COMMIT, \
996
1120
librubberband: env.RUBBERBAND_VERSION, \
997
1121
libsamplerate: env.LIBSAMPLERATE_VERSION, \
@@ -1014,8 +1138,8 @@ RUN \
1014
1138
libx264: env.X264_VERSION, \
1015
1139
libx265: env.X265_VERSION, \
1016
1140
libxavs2: env.XAVS2_VERSION, \
1017
- libxeve: env.XEVE_VERSION, \
1018
1141
libxevd: env.XEVD_VERSION, \
1142
+ libxeve: env.XEVE_VERSION, \
1019
1143
libxml2: env.LIBXML2_VERSION, \
1020
1144
libxvid: env.XVID_VERSION, \
1021
1145
libzimg: env.ZIMG_VERSION, \
@@ -1028,10 +1152,17 @@ RUN \
1028
1152
/checkelf /usr/local/bin/ffmpeg && \
1029
1153
/checkelf /usr/local/bin/ffprobe
1030
1154
1155
+ # some basic fonts that don't take up much space
1156
+ RUN apk add font-terminus font-inconsolata font-dejavu font-awesome
1157
+
1031
1158
FROM scratch AS final1
1032
1159
COPY --from=builder /versions.json /usr/local/bin/ffmpeg /usr/local/bin/ffprobe /
1033
1160
COPY --from=builder /usr/local/share/doc/ffmpeg/* /doc/
1034
1161
COPY --from=builder /etc/ssl/cert.pem /etc/ssl/cert.pem
1162
+ COPY --from=builder /etc/fonts/ /etc/fonts/
1163
+ COPY --from=builder /usr/share/fonts/ /usr/share/fonts/
1164
+ COPY --from=builder /usr/share/consolefonts/ /usr/share/consolefonts/
1165
+ COPY --from=builder /var/cache/fontconfig/ /var/cache/fontconfig/
1035
1166
1036
1167
# sanity tests
1037
1168
RUN ["/ffmpeg" , "-version" ]
@@ -1043,6 +1174,8 @@ RUN ["/ffmpeg", "-f", "lavfi", "-i", "testsrc", "-c:v", "libsvtav1", "-t", "100m
1043
1174
RUN ["/ffprobe" , "-i" , "https://github.com/favicon.ico" ]
1044
1175
# tls/https certs
1045
1176
RUN ["/ffprobe" , "-tls_verify" , "1" , "-ca_file" , "/etc/ssl/cert.pem" , "-i" , "https://github.com/favicon.ico" ]
1177
+ # svg
1178
+ RUN ["/ffprobe" , "-i" , "https://github.githubassets.com/favicons/favicon.svg" ]
1046
1179
1047
1180
# clamp all files into one layer
1048
1181
FROM scratch AS final2
0 commit comments