mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Add webrtc support for snap
This commit is contained in:
parent
0e1f59a0ed
commit
c529974da5
1 changed files with 93 additions and 2 deletions
|
@ -24,6 +24,7 @@ apps:
|
||||||
- alsa
|
- alsa
|
||||||
- audio-playback
|
- audio-playback
|
||||||
- audio-record
|
- audio-record
|
||||||
|
- camera
|
||||||
- desktop
|
- desktop
|
||||||
- desktop-legacy
|
- desktop-legacy
|
||||||
- home
|
- home
|
||||||
|
@ -102,6 +103,7 @@ parts:
|
||||||
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
|
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
|
||||||
- -DDESKTOP_APP_USE_PACKAGED_LAZY=ON
|
- -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_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: |
|
override-pull: |
|
||||||
snapcraftctl pull
|
snapcraftctl pull
|
||||||
|
|
||||||
|
@ -123,10 +125,29 @@ parts:
|
||||||
- ffmpeg
|
- ffmpeg
|
||||||
- openal
|
- openal
|
||||||
- qtwayland
|
- qtwayland
|
||||||
|
- webrtc
|
||||||
|
|
||||||
patches:
|
patches:
|
||||||
|
source: https://github.com/desktop-app/patches.git
|
||||||
|
source-depth: 1
|
||||||
plugin: dump
|
plugin: dump
|
||||||
|
organize:
|
||||||
|
"*": patches/
|
||||||
|
prime: [-./*]
|
||||||
|
|
||||||
|
telegram-patches:
|
||||||
source: 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: [-./*]
|
prime: [-./*]
|
||||||
|
|
||||||
desktop-qt5:
|
desktop-qt5:
|
||||||
|
@ -303,12 +324,12 @@ parts:
|
||||||
- --enable-muxer=opus
|
- --enable-muxer=opus
|
||||||
override-pull: |
|
override-pull: |
|
||||||
snapcraftctl pull
|
snapcraftctl pull
|
||||||
patch -p1 < "$SNAPCRAFT_STAGE/ffmpeg.diff"
|
patch -p1 < "$SNAPCRAFT_STAGE/telegram_patches/ffmpeg.diff"
|
||||||
prime:
|
prime:
|
||||||
- -./usr/include
|
- -./usr/include
|
||||||
- -./usr/lib/pkgconfig
|
- -./usr/lib/pkgconfig
|
||||||
after:
|
after:
|
||||||
- patches
|
- telegram-patches
|
||||||
- dav1d
|
- dav1d
|
||||||
|
|
||||||
openal:
|
openal:
|
||||||
|
@ -351,3 +372,73 @@ parts:
|
||||||
- desktop-qt5
|
- desktop-qt5
|
||||||
stage: [-./usr/lib]
|
stage: [-./usr/lib]
|
||||||
prime: [-./*]
|
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: [-./*]
|
||||||
|
|
Loading…
Add table
Reference in a new issue