Repository navigation
Expand file tree
/
Copy pathffmpeg-mini.sh
More file actions
57 lines (48 loc) · 1.98 KB
/
Copy pathffmpeg-mini.sh
File metadata and controls
57 lines (48 loc) · 1.98 KB
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
#!/bin/sh
set -e
sed -i -e 's|-O2|-Os|' /etc/makepkg.conf
get-pkgbuild
cd "$BUILD_DIR"
# debloat package, remove x265 support and AV1 encoding support
# remove a lot of image formats support and other stuff like opencore
# a lot of these changes make ffmpeg more similar to what void and alpine do
# so they should not cause issues to most applications
sed -i \
-e '/x265/d' \
-e '/aom/d' \
-e '/amf/d' \
-e '/opencl/d' \
-e '/placebo/d' \
-e '/librav1e/d' \
-e '/frei0r/d' \
-e '/gsm/d' \
-e '/opencore/d' \
-e '/libjxl/d' \
-e '/librsvg/d' \
-e '/libopenjpeg/d' \
-e '/--enable-libsvtav1/d' \
-e 's/--enable-vapoursynth/--enable-small/' \
-e 's/--enable-libglslang/--disable-vdpau/' \
"$PKGBUILD"
# --enable-small makes ffmpeg drop the human readable codec names
# (NULL_IF_CONFIG_SMALL in libavcodec/codec_desc.c) and the profile name tables
# (libavcodec/profiles.c). Without them mpv based players (stats overlay, Cine)
# show no codec and no "HW:" line, which looks like hardware decoding is off.
# profiles.c has to be patched together with codec_desc.c, because codec_desc.c
# refers to the ff_*_profiles tables and the link of the programs fails without
# them.
intercept-prepare <<'EOF'
sed -i 's/NULL_IF_CONFIG_SMALL(\(.*\)),$/\1,/' libavcodec/codec_desc.c
sed -i 's/^#if !CONFIG_SMALL$/#if 1/' libavcodec/profiles.c
EOF
cat "$PKGBUILD"
# Do not build if version does not match with upstream
if check-upstream-version; then
makepkg -fs --noconfirm --skippgpcheck
else
exit 0
fi
ls -la
rm -fv ./*-docs-*.pkg.tar.* ./*-debug-*.pkg.tar.*
mv -v ./"$PACKAGE"-*.pkg.tar.zst ../"$PACKAGE"-mini-"$ARCH".pkg.tar.zst
echo "All done!"