summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiota2023-11-12 04:36:51 -0800
committerxiota2023-11-12 04:36:51 -0800
commit0bfabf01a58e2a53f5447555c88d885100b10d5a (patch)
treec2d18a48c6397ba5b232fae9eb78442da0d6ab1d
parentfc3aa523db5f1bdfc4877f61b8e7c6b19b1e4a4f (diff)
downloadaur-0bfabf01a58e2a53f5447555c88d885100b10d5a.tar.gz
conditionally build libtg_owt
clean up depends/makedepends
-rw-r--r--.SRCINFO53
-rw-r--r--PKGBUILD270
2 files changed, 150 insertions, 173 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 95b3d4bc138e..bdb664844a5e 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -5,67 +5,38 @@ pkgbase = telegram-desktop-git
url = https://github.com/telegramdesktop/tdesktop
arch = x86_64
license = GPL3
+ makedepends = boost
makedepends = cmake
makedepends = extra-cmake-modules
+ makedepends = fmt
makedepends = git
- makedepends = meson
- makedepends = microsoft-gsl
+ makedepends = gobject-introspection
makedepends = ninja
makedepends = pipewire
- makedepends = plasma-wayland-protocols
- makedepends = python
- makedepends = range-v3
- makedepends = tl-expected
- makedepends = unzip
- makedepends = wayland-protocols
- makedepends = webkit2gtk
makedepends = yasm
- makedepends = boost
- makedepends = fmt
- makedepends = gobject-introspection
- makedepends = mm-common
- makedepends = perl-xml-parser
- makedepends = libepoxy
- makedepends = libva
- makedepends = unzip
+ makedepends = libxcomposite
+ makedepends = libxrandr
+ makedepends = libxtst
depends = abseil-cpp
depends = ffmpeg
- depends = gcc-libs
- depends = glib2
- depends = glibc
depends = glibmm-2.68
- depends = hicolor-icon-theme
depends = hunspell
depends = jemalloc
depends = libdispatch
- depends = libjpeg-turbo
- depends = libpipewire
depends = libsigc++-3.0
depends = libvpx
- depends = libx11
- depends = libxcb
- depends = libxcomposite
- depends = libxdamage
- depends = libxext
- depends = libxfixes
- depends = libxrandr
- depends = libxtst
- depends = lz4
depends = minizip
depends = openal
depends = openh264
- depends = openssl
depends = opus
depends = protobuf
+ depends = qt6-base
+ depends = qt6-declarative
depends = qt6-svg
depends = qt6-wayland
depends = rnnoise
- depends = wayland
depends = xcb-util-keysyms
depends = xxhash
- depends = zlib
- depends = qt6-imageformats
- depends = ttf-opensans
optdepends = webkit2gtk: embedded browser features
optdepends = xdg-desktop-portal: desktop integration
provides = telegram-desktop=4.11.6
@@ -74,6 +45,10 @@ pkgbase = telegram-desktop-git
source = telegram-tg_owt::git+https://github.com/desktop-app/tg_owt.git
source = https://patch-diff.githubusercontent.com/raw/desktop-app/tg_owt/pull/101.patch
source = tg_owt-fix.patch
+ source = abseil.abseil-cpp::git+https://github.com/abseil/abseil-cpp.git
+ source = chromiumsrc.libyuv::git+https://gitlab.com/chromiumsrc/libyuv.git
+ source = cisco.libsrtp::git+https://github.com/cisco/libsrtp.git
+ source = google.crc32c::git+https://github.com/google/crc32c.git
source = apple.swift-corelibs-libdispatch::git+https://github.com/apple/swift-corelibs-libdispatch.git
source = cyan4973.xxhash::git+https://github.com/Cyan4973/xxHash.git
source = desktop-app.cmake_helpers::git+https://github.com/desktop-app/cmake_helpers.git
@@ -114,10 +89,6 @@ pkgbase = telegram-desktop-git
source = mnauw.cppgir::git+https://gitlab.com/mnauw/cppgir.git
source = yugr.implib.so::git+https://github.com/yugr/Implib.so.git
source = martinmoene.expected-lite::git+https://github.com/martinmoene/expected-lite.git
- source = abseil.abseil-cpp::git+https://github.com/abseil/abseil-cpp.git
- source = chromiumsrc.libyuv::git+https://gitlab.com/chromiumsrc/libyuv.git
- source = cisco.libsrtp::git+https://github.com/cisco/libsrtp.git
- source = google.crc32c::git+https://github.com/google/crc32c.git
sha256sums = SKIP
sha256sums = SKIP
sha256sums = f4d26c1048a7fd1ac3419042009c3b52c001458e44309a765d42d7df9f45f1ef
diff --git a/PKGBUILD b/PKGBUILD
index e43ad66bec1f..245fa257eb95 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,107 +2,85 @@
# Contributor: Sven-Hendrik Haase <svenstaro@gmail.com>
# Contributor: hexchain <i@hexchain.org>
+: ${_build_tg_owt:=true}
+
_pkgname="telegram-desktop"
pkgname="$_pkgname-git"
pkgver=4.11.6.r5.g468d4c5e4
pkgrel=1
pkgdesc='Official Telegram Desktop client'
-arch=('x86_64')
url="https://github.com/telegramdesktop/tdesktop"
license=('GPL3')
+arch=('x86_64')
-depends=(
- 'abseil-cpp'
- 'ffmpeg'
- 'gcc-libs'
- 'glib2'
- 'glibc'
- 'glibmm-2.68'
- 'hicolor-icon-theme'
- 'hunspell'
- 'jemalloc'
- 'libdispatch'
- 'libjpeg-turbo'
- 'libpipewire'
- 'libsigc++-3.0'
- 'libvpx'
- 'libx11'
- 'libxcb'
- 'libxcomposite'
- 'libxdamage'
- 'libxext'
- 'libxfixes'
- 'libxrandr'
- 'libxtst'
- 'lz4'
- 'minizip'
- 'openal'
- 'openh264'
- 'openssl'
- 'opus'
- 'protobuf'
- 'qt6-svg'
- 'qt6-wayland'
- 'rnnoise'
- 'wayland'
- 'xcb-util-keysyms'
- 'xxhash'
- 'zlib'
-
- 'qt6-imageformats'
- 'ttf-opensans'
+depends+=(
+ abseil-cpp
+ ffmpeg
+ glibmm-2.68
+ hunspell
+ jemalloc
+ libdispatch
+ libsigc++-3.0
+ libvpx
+ minizip
+ openal
+ openh264
+ opus
+ protobuf
+ qt6-base
+ qt6-declarative
+ qt6-svg
+ qt6-wayland
+ rnnoise
+ xcb-util-keysyms
+ xxhash
+
+ ## implicit
+ #gcc-libs
+ #glib2
+ #glibc
+ #hicolor-icon-theme
+ #libjpeg-turbo
+ #libpipewire
+ #libx11
+ #libxcb
+ #libxcomposite
+ #libxdamage
+ #libxext
+ #libxfixes
+ #libxrandr
+ #libxtst
+ #lz4
+ #openssl
+ #wayland
+ #zlib
)
-makedepends=(
+makedepends+=(
+ 'boost'
'cmake'
'extra-cmake-modules'
- 'git'
- 'meson'
- 'microsoft-gsl'
- 'ninja'
- 'pipewire'
- 'plasma-wayland-protocols'
- 'python'
- 'range-v3'
- 'tl-expected'
- 'unzip'
- 'wayland-protocols'
- 'webkit2gtk'
- 'yasm'
-
- 'boost'
'fmt'
+ 'git'
'gobject-introspection'
- 'mm-common'
- 'perl-xml-parser'
-
- 'libepoxy'
- 'libva'
- 'unzip'
+ 'ninja'
)
-optdepends=(
+optdepends+=(
'webkit2gtk: embedded browser features'
'xdg-desktop-portal: desktop integration'
)
+if [[ x"${_build_tg_owt::1}" != "xt" ]] ; then
+ makedepends+=(
+ 'libtg_owt-git'
+ )
+fi
+
provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")
_pkgsrc="$_pkgname"
-_pkgsrc_tgowt="telegram-tg_owt"
-source=(
- "$_pkgsrc"::"git+$url.git"
-
- "$_pkgsrc_tgowt"::"git+https://github.com/desktop-app/tg_owt.git"
- "https://patch-diff.githubusercontent.com/raw/desktop-app/tg_owt/pull/101.patch"
- "tg_owt-fix.patch"
-)
-sha256sums=(
- 'SKIP'
-
- 'SKIP'
- 'f4d26c1048a7fd1ac3419042009c3b52c001458e44309a765d42d7df9f45f1ef'
- '8d3a1c4b2e40eef7a4cc8e6f498c416af47a91b878ec3762b51476e89695cb13'
-)
+source+=("$_pkgsrc"::"git+$url.git")
+sha256sums+=('SKIP')
_source_telegram_desktop() {
source+=(
@@ -223,35 +201,6 @@ _source_telegram_desktop() {
)
}
-_source_desktop_app_tg_owt() {
- source+=(
- 'abseil.abseil-cpp'::'git+https://github.com/abseil/abseil-cpp.git'
- 'chromiumsrc.libyuv'::'git+https://gitlab.com/chromiumsrc/libyuv.git'
- 'cisco.libsrtp'::'git+https://github.com/cisco/libsrtp.git'
- 'google.crc32c'::'git+https://github.com/google/crc32c.git'
- )
- sha256sums+=(
- 'SKIP'
- 'SKIP'
- 'SKIP'
- 'SKIP'
- )
-
- _prepare_desktop_app_tg_owt() (
- cd "${srcdir:?}/$_pkgsrc_tgowt"
- local -A _submodules=(
- ['abseil.abseil-cpp']='src/third_party/abseil-cpp'
- ['chromiumsrc.libyuv']='src/third_party/libyuv'
- ['cisco.libsrtp']='src/third_party/libsrtp'
- ['google.crc32c']='src/third_party/crc32c/src'
- )
- _submodule_update
-
- apply-patch "${srcdir:?}/101.patch"
- apply-patch "${srcdir:?}/tg_owt-fix.patch"
- )
-}
-
_source_ericniebler_range_v3() {
source+=(
'ericniebler.range-v3'::'git+https://github.com/ericniebler/range-v3.git'
@@ -328,6 +277,75 @@ _source_mnauw_cppgir() {
)
}
+if [[ x"${_build_tg_owt::1}" == "xt" ]] ; then
+ makedepends+=(
+ pipewire
+ yasm
+
+ libxcomposite
+ libxrandr
+ libxtst
+ )
+
+ _pkgsrc_tgowt="telegram-tg_owt"
+ source+=(
+ "$_pkgsrc_tgowt"::"git+https://github.com/desktop-app/tg_owt.git"
+ "https://patch-diff.githubusercontent.com/raw/desktop-app/tg_owt/pull/101.patch"
+ "tg_owt-fix.patch"
+ )
+ sha256sums+=(
+ 'SKIP'
+ 'f4d26c1048a7fd1ac3419042009c3b52c001458e44309a765d42d7df9f45f1ef'
+ '8d3a1c4b2e40eef7a4cc8e6f498c416af47a91b878ec3762b51476e89695cb13'
+ )
+
+ _source_desktop_app_tg_owt() {
+ source+=(
+ 'abseil.abseil-cpp'::'git+https://github.com/abseil/abseil-cpp.git'
+ 'chromiumsrc.libyuv'::'git+https://gitlab.com/chromiumsrc/libyuv.git'
+ 'cisco.libsrtp'::'git+https://github.com/cisco/libsrtp.git'
+ 'google.crc32c'::'git+https://github.com/google/crc32c.git'
+ )
+ sha256sums+=(
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ 'SKIP'
+ )
+
+ _prepare_desktop_app_tg_owt() (
+ cd "${srcdir:?}/$_pkgsrc_tgowt"
+ local -A _submodules=(
+ ['abseil.abseil-cpp']='src/third_party/abseil-cpp'
+ ['chromiumsrc.libyuv']='src/third_party/libyuv'
+ ['cisco.libsrtp']='src/third_party/libsrtp'
+ ['google.crc32c']='src/third_party/crc32c/src'
+ )
+ _submodule_update
+
+ apply-patch "${srcdir:?}/101.patch"
+ apply-patch "${srcdir:?}/tg_owt-fix.patch"
+ )
+ }
+
+ _build_tg_owt() (
+ local _cmake_options=(
+ -B "build-tg_owt"
+ -S "$_pkgsrc_tgowt"
+ -G Ninja
+ -DCMAKE_BUILD_TYPE=Release
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON
+ -DBUILD_SHARED_LIBS=OFF
+ -DTG_OWT_PACKAGED_BUILD=ON
+ )
+
+ cmake "${_cmake_options[@]}"
+ cmake --build "build-tg_owt"
+ )
+
+ _source_desktop_app_tg_owt
+fi
+
_source_telegram_desktop
_source_ericniebler_range_v3
_source_telegramdesktop_libtgvoip
@@ -335,8 +353,6 @@ _source_telegramdesktop_libtgvoip
_source_desktop_app_cmake_helpers
_source_mnauw_cppgir
-_source_desktop_app_tg_owt
-
prepare() {
apply-patch() {
printf '\nApplying patch %s\n' "$1"
@@ -352,14 +368,16 @@ prepare() {
done
}
+ if [[ x"${_build_tg_owt::1}" == "xt" ]] ; then
+ _prepare_desktop_app_tg_owt
+ fi
+
_prepare_telegram_desktop
_prepare_ericniebler_range_v3
_prepare_telegramdesktop_libtgvoip
_prepare_desktop_app_cmake_helpers
_prepare_mnauw_cppgir
-
- _prepare_desktop_app_tg_owt
}
pkgver() {
@@ -368,24 +386,6 @@ pkgver() {
| sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}
-_build_tg_owt() (
- local _cmake_options=(
- -B "build-tg_owt"
- -S "$_pkgsrc_tgowt"
- -G Ninja
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_POSITION_INDEPENDENT_CODE=ON
- -DBUILD_SHARED_LIBS=OFF
- -DTG_OWT_PACKAGED_BUILD=ON
-
- -DCMAKE_C_FLAGS="${CFLAGS} -ffat-lto-objects"
- -DCMAKE_CXX_FLAGS="${CXXFLAGS} -ffat-lto-objects -I/usr/include/libdrm"
- )
-
- cmake "${_cmake_options[@]}"
- cmake --build "build-tg_owt"
-)
-
_build_telegram() (
# Turns out we're allowed to use the official API key that telegram uses for their snap builds:
# https://github.com/telegramdesktop/tdesktop/blob/8fab9167beb2407c1153930ed03a4badd0c2b59f/snap/snapcraft.yaml#L87-L88
@@ -397,7 +397,6 @@ _build_telegram() (
-G Ninja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX="/usr"
- -Dtg_owt_DIR="${srcdir:?}/build-tg_owt"
-DDESKTOP_APP_DISABLE_AUTOUPDATE=ON
-DTDESKTOP_API_TEST=ON
-DTDESKTOP_API_ID=611335
@@ -406,12 +405,19 @@ _build_telegram() (
-Wno-dev
)
+ if [[ x"${_build_tg_owt::1}" == "xt" ]] ; then
+ _cmake_options+=(-Dtg_owt_DIR="${srcdir:?}/build-tg_owt")
+ fi
+
cmake "${_cmake_options[@]}"
cmake --build build
)
build() {
- _build_tg_owt
+ if [[ x"${_build_tg_owt::1}" == "xt" ]] ; then
+ _build_tg_owt
+ fi
+
_build_telegram
}