|
| 1 | +# Maintainer: Jiachen YANG <farseerfc at archlinux dot org> |
| 2 | +# Maintainer: Sven-Hendrik Haase <[email protected]> |
| 3 | + |
| 4 | +pkgname=libtg_owt |
| 5 | +# It seems the currently desired version can be gotten from |
| 6 | +# https://github.com/telegramdesktop/tdesktop/blob/dev/Telegram/build/docker/centos_env/Dockerfile |
| 7 | +_commit=442d5bb593c0ae314960308d78f2016ad1f80c3e |
| 8 | +pkgver=0.git16.${_commit} |
| 9 | +pkgrel=2 |
| 10 | +pkgdesc='WebRTC library' |
| 11 | +arch=('x86_64') |
| 12 | +url='https://github.com/desktop-app/tg_owt' |
| 13 | +license=('BSD') |
| 14 | +# libdrm is dynamically loaded via dlopen |
| 15 | +depends=('libdrm') |
| 16 | +makedepends=('git' 'ninja' 'unzip' 'cmake' 'protobuf' 'libxrandr' 'libxcomposite' 'openssl' 'glibc' |
| 17 | + 'ffmpeg4.4' 'libva' 'opus' 'yasm' 'libjpeg-turbo' 'pipewire' 'libxtst' 'libepoxy') |
| 18 | +options=('staticlibs') |
| 19 | +source=("tg_owt::git+${url}.git#commit=${_commit}" |
| 20 | + "libvpx::git+https://chromium.googlesource.com/webm/libvpx.git" |
| 21 | + "libyuv::git+https://chromium.googlesource.com/libyuv/libyuv.git" |
| 22 | + "pipewire::git+https://github.com/PipeWire/pipewire.git") |
| 23 | +b2sums=('SKIP' |
| 24 | + 'SKIP' |
| 25 | + 'SKIP' |
| 26 | + 'SKIP') |
| 27 | + |
| 28 | +prepare() { |
| 29 | + cd tg_owt |
| 30 | + git submodule init |
| 31 | + git config submodule.src/third_party/libvpx/source/libvpx.url "$srcdir"/libvpx |
| 32 | + git config submodule.src/third_party/libyuv.url "$srcdir"/libyuv |
| 33 | + git config submodule.src/third_party/pipewire.url "$srcdir"/pipewire |
| 34 | + git -c protocol.file.allow=always submodule update |
| 35 | +} |
| 36 | + |
| 37 | +build() { |
| 38 | + cd tg_owt |
| 39 | + |
| 40 | + export CFLAGS+=" -ffat-lto-objects" |
| 41 | + export CXXFLAGS+=" -ffat-lto-objects -I/usr/include/libdrm" |
| 42 | + export PKG_CONFIG_PATH='/usr/lib/ffmpeg4.4/pkgconfig' |
| 43 | + # Upstream stated that only static builds are really supported so that's what we'll do. |
| 44 | + # https://github.com/desktop-app/tg_owt/issues/75#issuecomment-992061171 |
| 45 | + cmake \ |
| 46 | + -B build \ |
| 47 | + -G Ninja \ |
| 48 | + -DCMAKE_BUILD_TYPE=Release \ |
| 49 | + -DCMAKE_INSTALL_PREFIX=/usr \ |
| 50 | + -DBUILD_SHARED_LIBS=OFF |
| 51 | + sed -i "s|/usr/lib/libav|/usr/lib/ffmpeg4.4/libav|g" build/build.ninja |
| 52 | + sed -i "s|/usr/lib/libsw|/usr/lib/ffmpeg4.4/libsw|g" build/build.ninja |
| 53 | + sed -i "s|-lavcodec|/usr/lib/ffmpeg4.4/libavcodec.so|g" build/build.ninja |
| 54 | + sed -i "s|-lavformat|/usr/lib/ffmpeg4.4/libavformat.so|g" build/build.ninja |
| 55 | + sed -i "s|-lavutil|/usr/lib/ffmpeg4.4/libavutil.so|g" build/build.ninja |
| 56 | + sed -i "s|-lswscale|/usr/lib/ffmpeg4.4/libswscale.so|g" build/build.ninja |
| 57 | + sed -i "s|-lswresample|/usr/lib/ffmpeg4.4/libswresample.so|g" build/build.ninja |
| 58 | + ninja -C build |
| 59 | +} |
| 60 | + |
| 61 | +package() { |
| 62 | + cd tg_owt |
| 63 | + DESTDIR="${pkgdir}/" ninja -C build install |
| 64 | + install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE |
| 65 | +} |
0 commit comments