Add webrtc support for snap

This commit is contained in:
Ilya Fedin 2020-08-16 00:23:00 +04:00 committed by John Preston
parent 0e1f59a0ed
commit c529974da5

View file

@ -24,6 +24,7 @@ apps:
- alsa
- audio-playback
- audio-record
- camera
- desktop
- desktop-legacy
- home
@ -102,6 +103,7 @@ parts:
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
- -DDESKTOP_APP_USE_PACKAGED_LAZY=ON
- -DDESKTOP_APP_QTWAYLANDCLIENT_PRIVATE_HEADERS=$SNAPCRAFT_STAGE/usr/include/$SNAPCRAFT_ARCH_TRIPLET/qt5/QtWaylandClient/5.12.8
- -DDESKTOP_APP_WEBRTC_LOCATION=$SNAPCRAFT_STAGE/webrtc/src
override-pull: |
snapcraftctl pull
@ -123,10 +125,29 @@ parts:
- ffmpeg
- openal
- qtwayland
- webrtc
patches:
source: https://github.com/desktop-app/patches.git
source-depth: 1
plugin: dump
organize:
"*": patches/
prime: [-./*]
telegram-patches:
source: Telegram/Patches
plugin: dump
organize:
"*": telegram_patches/
prime: [-./*]
depot-tools:
source: https://chromium.googlesource.com/chromium/tools/depot_tools.git
source-depth: 1
plugin: dump
organize:
"*": depot_tools/
prime: [-./*]
desktop-qt5:
@ -303,12 +324,12 @@ parts:
- --enable-muxer=opus
override-pull: |
snapcraftctl pull
patch -p1 < "$SNAPCRAFT_STAGE/ffmpeg.diff"
patch -p1 < "$SNAPCRAFT_STAGE/telegram_patches/ffmpeg.diff"
prime:
- -./usr/include
- -./usr/lib/pkgconfig
after:
- patches
- telegram-patches
- dav1d
openal:
@ -351,3 +372,73 @@ parts:
- desktop-qt5
stage: [-./usr/lib]
prime: [-./*]
webrtc:
plugin: nil
build-packages:
- libopus-dev
- libssl-dev
stage-packages:
- libopus0
- libssl1.1
override-pull: |
export PATH="$SNAPCRAFT_STAGE/depot_tools:$PATH"
mkdir webrtc
cd webrtc
cp "$SNAPCRAFT_STAGE/patches/webrtc/.gclient" .
git clone --depth=1 https://github.com/open-webrtc-toolkit/owt-deps-webrtc src
gclient sync --no-history
applyPatch() {
cd "$SNAPCRAFT_PART_SRC/webrtc/$1"
git apply "$SNAPCRAFT_STAGE/patches/webrtc/$(basename $1).diff"
}
applyPatch src
applyPatch src/build
applyPatch src/third_party
applyPatch src/third_party/libsrtp
override-build: |
export PATH="$SNAPCRAFT_STAGE/depot_tools:$PATH"
cd webrtc/src
ArgumentsList=`echo \
target_os=\"linux\" \
treat_warnings_as_errors=false \
is_component_build=false \
is_debug=false \
is_clang=false \
proprietary_codecs=true \
use_custom_libcxx=false \
use_rtti=true \
use_gold=false \
use_sysroot=false \
linux_use_bundled_binutils=false \
enable_dsyms=true \
rtc_include_tests=false \
rtc_build_examples=false \
rtc_build_tools=false \
rtc_build_opus=false \
rtc_build_ssl=false \
rtc_ssl_root=\"/usr/include\" \
rtc_ssl_libs=[\"ssl\",\"crypto\"] \
rtc_builtin_ssl_root_certificates=true \
rtc_build_ffmpeg=false \
rtc_ffmpeg_root=\"$SNAPCRAFT_STAGE/usr/include\" \
rtc_ffmpeg_libs=[\"avcodec\",\"swscale\",\"swresample\",\"avutil\"] \
rtc_opus_root=\"/usr/include/opus\" \
rtc_enable_protobuf=false`
gn gen out/Release --args="$ArgumentsList"
ninja -C out/Release webrtc
cd ../..
cp -a webrtc "$SNAPCRAFT_PART_INSTALL"
after:
- depot-tools
- ffmpeg
- patches
prime: [-./*]