2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Self-build ffmpeg in snap for lesser package size

This commit is contained in:
Ilya Fedin
2025-02-20 03:15:54 +04:00
committed by John Preston
parent 90edb0903d
commit a6a8363527

View File

@@ -39,7 +39,7 @@ parts:
cmake-generator: Ninja cmake-generator: Ninja
cmake-parameters: cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr - -DCMAKE_INSTALL_PREFIX=/
- -DTDESKTOP_API_ID=611335 - -DTDESKTOP_API_ID=611335
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c - -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
override-pull: | override-pull: |
@@ -85,8 +85,10 @@ parts:
build-packages: build-packages:
- clang - clang
- gperf - gperf
- nasm
- libavif-dev - libavif-dev
- libboost-regex-dev - libboost-regex-dev
- libdav1d-dev
- libheif-dev - libheif-dev
- libhwy-dev - libhwy-dev
- libjxl-dev - libjxl-dev
@@ -95,6 +97,7 @@ parts:
- libopus-dev - libopus-dev
- libpipewire-0.3-dev - libpipewire-0.3-dev
- libssl-dev - libssl-dev
- libvdpau-dev
- libvpx-dev - libvpx-dev
- libxcb-cursor-dev - libxcb-cursor-dev
- libxcb-glx0-dev - libxcb-glx0-dev
@@ -111,6 +114,7 @@ parts:
- libxcb-xfixes0-dev - libxcb-xfixes0-dev
- libxcb-xkb-dev - libxcb-xkb-dev
- libxkbcommon-x11-dev - libxkbcommon-x11-dev
- libxv-dev
stage-packages: stage-packages:
- libavif16 - libavif16
- libopenal1 - libopenal1
@@ -152,27 +156,153 @@ parts:
prime: [-./*] prime: [-./*]
ffmpeg: ffmpeg:
plugin: nil source: https://github.com/FFmpeg/FFmpeg.git
build-packages: source-depth: 1
- libavcodec-dev source-branch: n6.1.1
- libavfilter-dev plugin: autotools
- libavformat-dev build-environment:
- libavutil-dev - LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
- libswresample-dev autotools-configure-parameters:
- libswscale-dev - --prefix=/usr
stage-packages: - --libdir=/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR
- libavcodec60 - --extra-cflags="-DCONFIG_SAFE_BITSTREAM_READER=1"
- libavfilter9 - --extra-cxxflags="-DCONFIG_SAFE_BITSTREAM_READER=1"
- libavformat60 - --disable-debug
- libavutil58 - --disable-programs
- libswresample4 - --disable-doc
- libswscale7 - --disable-network
override-build: | - --disable-autodetect
craftctl default - --disable-everything
mv "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/blas/"* "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" - --enable-libdav1d
rmdir "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/blas" - --enable-libopenh264
mv "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack/"* "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR" - --enable-libopus
rmdir "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack" - --enable-libvpx
- --enable-vaapi
- --enable-vdpau
- --enable-xlib
- --enable-libdrm
- --enable-ffnvcodec
- --enable-nvdec
- --enable-cuvid
- --enable-protocol=file
- --enable-hwaccel=av1_vaapi
- --enable-hwaccel=av1_nvdec
- --enable-hwaccel=h264_vaapi
- --enable-hwaccel=h264_vdpau
- --enable-hwaccel=h264_nvdec
- --enable-hwaccel=hevc_vaapi
- --enable-hwaccel=hevc_vdpau
- --enable-hwaccel=hevc_nvdec
- --enable-hwaccel=mpeg2_vaapi
- --enable-hwaccel=mpeg2_vdpau
- --enable-hwaccel=mpeg2_nvdec
- --enable-hwaccel=mpeg4_vaapi
- --enable-hwaccel=mpeg4_vdpau
- --enable-hwaccel=mpeg4_nvdec
- --enable-hwaccel=vp8_vaapi
- --enable-hwaccel=vp8_nvdec
- --enable-decoder=aac
- --enable-decoder=aac_fixed
- --enable-decoder=aac_latm
- --enable-decoder=aasc
- --enable-decoder=ac3
- --enable-decoder=alac
- --enable-decoder=av1
- --enable-decoder=av1_cuvid
- --enable-decoder=eac3
- --enable-decoder=flac
- --enable-decoder=gif
- --enable-decoder=h264
- --enable-decoder=hevc
- --enable-decoder=libdav1d
- --enable-decoder=libvpx_vp8
- --enable-decoder=libvpx_vp9
- --enable-decoder=mp1
- --enable-decoder=mp1float
- --enable-decoder=mp2
- --enable-decoder=mp2float
- --enable-decoder=mp3
- --enable-decoder=mp3adu
- --enable-decoder=mp3adufloat
- --enable-decoder=mp3float
- --enable-decoder=mp3on4
- --enable-decoder=mp3on4float
- --enable-decoder=mpeg4
- --enable-decoder=msmpeg4v2
- --enable-decoder=msmpeg4v3
- --enable-decoder=opus
- --enable-decoder=pcm_alaw
- --enable-decoder=pcm_f32be
- --enable-decoder=pcm_f32le
- --enable-decoder=pcm_f64be
- --enable-decoder=pcm_f64le
- --enable-decoder=pcm_lxf
- --enable-decoder=pcm_mulaw
- --enable-decoder=pcm_s16be
- --enable-decoder=pcm_s16be_planar
- --enable-decoder=pcm_s16le
- --enable-decoder=pcm_s16le_planar
- --enable-decoder=pcm_s24be
- --enable-decoder=pcm_s24daud
- --enable-decoder=pcm_s24le
- --enable-decoder=pcm_s24le_planar
- --enable-decoder=pcm_s32be
- --enable-decoder=pcm_s32le
- --enable-decoder=pcm_s32le_planar
- --enable-decoder=pcm_s64be
- --enable-decoder=pcm_s64le
- --enable-decoder=pcm_s8
- --enable-decoder=pcm_s8_planar
- --enable-decoder=pcm_u16be
- --enable-decoder=pcm_u16le
- --enable-decoder=pcm_u24be
- --enable-decoder=pcm_u24le
- --enable-decoder=pcm_u32be
- --enable-decoder=pcm_u32le
- --enable-decoder=pcm_u8
- --enable-decoder=pcm_zork
- --enable-decoder=vorbis
- --enable-decoder=vp8
- --enable-decoder=wavpack
- --enable-decoder=wmalossless
- --enable-decoder=wmapro
- --enable-decoder=wmav1
- --enable-decoder=wmav2
- --enable-decoder=wmavoice
- --enable-encoder=aac
- --enable-encoder=libopenh264
- --enable-encoder=libopus
- --enable-encoder=pcm_s16le
- --enable-filter=atempo
- --enable-parser=aac
- --enable-parser=aac_latm
- --enable-parser=flac
- --enable-parser=gif
- --enable-parser=h264
- --enable-parser=hevc
- --enable-parser=mpeg4video
- --enable-parser=mpegaudio
- --enable-parser=opus
- --enable-parser=vorbis
- --enable-demuxer=aac
- --enable-demuxer=flac
- --enable-demuxer=gif
- --enable-demuxer=h264
- --enable-demuxer=hevc
- --enable-demuxer=matroska
- --enable-demuxer=m4v
- --enable-demuxer=mov
- --enable-demuxer=mp3
- --enable-demuxer=ogg
- --enable-demuxer=wav
- --enable-muxer=mp4
- --enable-muxer=ogg
- --enable-muxer=opus
- --enable-muxer=wav
prime: [-./*]
after:
- nv-codec-headers
- pkgs
geoclue: geoclue:
plugin: nil plugin: nil
@@ -219,6 +349,16 @@ parts:
- ./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.a - ./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libjpeg.a
prime: [-./*] prime: [-./*]
nv-codec-headers:
source: https://github.com/FFmpeg/nv-codec-headers.git
source-depth: 1
source-branch: n12.1.14.0
plugin: make
make-parameters:
- PREFIX=/usr
- LIBDIR=lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR
prime: [-./*]
protobuf: protobuf:
source: https://github.com/protocolbuffers/protobuf.git source: https://github.com/protocolbuffers/protobuf.git
source-depth: 1 source-depth: 1