diff options
author | xiota | 2023-12-20 03:44:35 -0800 |
---|---|---|
committer | xiota | 2023-12-20 03:44:35 -0800 |
commit | 489377e575b3cfd9537ec536016c0b4fe60db97c (patch) | |
tree | 8b87a7f4014fb455f96be702138ebef454a58c66 /PKGBUILD | |
parent | 0bfabf01a58e2a53f5447555c88d885100b10d5a (diff) | |
download | aur-489377e575b3cfd9537ec536016c0b4fe60db97c.tar.gz |
4.12.2.r10: reorganize
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 247 |
1 files changed, 128 insertions, 119 deletions
@@ -2,86 +2,103 @@ # Contributor: Sven-Hendrik Haase <svenstaro@gmail.com> # Contributor: hexchain <i@hexchain.org> +# options : ${_build_tg_owt:=true} +: ${_pkgtype:=git} + +# basic info _pkgname="telegram-desktop" -pkgname="$_pkgname-git" -pkgver=4.11.6.r5.g468d4c5e4 +pkgname="$_pkgname${_pkgtype:+-$_pkgtype}" +pkgver=4.12.2.r10.g3adbfb1fb pkgrel=1 pkgdesc='Official Telegram Desktop client' url="https://github.com/telegramdesktop/tdesktop" license=('GPL3') arch=('x86_64') -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+=( - 'boost' - 'cmake' - 'extra-cmake-modules' - 'fmt' - 'git' - 'gobject-introspection' - 'ninja' -) -optdepends+=( - 'webkit2gtk: embedded browser features' - 'xdg-desktop-portal: desktop integration' -) - -if [[ x"${_build_tg_owt::1}" != "xt" ]] ; then +# main package +_main_package() { + depends+=( + abseil-cpp + ffmpeg + glibmm-2.68 + hunspell + 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+=( - 'libtg_owt-git' + 'boost' + 'cmake' + 'extra-cmake-modules' + 'fmt' + 'git' + 'gobject-introspection' + 'ninja' ) -fi + optdepends+=( + 'webkit2gtk: embedded browser features' + 'xdg-desktop-portal: desktop integration' + ) + + provides=("$_pkgname=${pkgver%%.r*}") + conflicts=("$_pkgname") + + _pkgsrc="$_pkgname" + source+=("$_pkgsrc"::"git+$url.git") + sha256sums+=('SKIP') + + _source_telegram_desktop + _source_ericniebler_range_v3 + _source_telegramdesktop_libtgvoip + + _source_desktop_app_cmake_helpers + _source_mnauw_cppgir -provides=("$_pkgname=${pkgver%%.r*}") -conflicts=("$_pkgname") + if [[ x"${_build_tg_owt::1}" == "xt" ]] ; then + _source_tg_owt + else + makedepends+=( + 'libtg_owt-git' + ) + fi -_pkgsrc="$_pkgname" -source+=("$_pkgsrc"::"git+$url.git") -sha256sums+=('SKIP') +} +# submodules _source_telegram_desktop() { source+=( 'apple.swift-corelibs-libdispatch'::'git+https://github.com/apple/swift-corelibs-libdispatch.git' @@ -110,7 +127,6 @@ _source_telegram_desktop() { 'hamonikr.nimf'::'git+https://github.com/hamonikr/nimf.git' 'hime-ime.hime'::'git+https://github.com/hime-ime/hime.git' 'hunspell'::'git+https://github.com/hunspell/hunspell.git' - 'jemalloc'::'git+https://github.com/jemalloc/jemalloc.git' 'kde.kcoreaddons'::'git+https://github.com/KDE/kcoreaddons.git' 'kde.kimageformats'::'git+https://github.com/KDE/kimageformats.git' 'kde.plasma-wayland-protocols'::'git+https://github.com/KDE/plasma-wayland-protocols.git' @@ -155,7 +171,6 @@ _source_telegram_desktop() { 'SKIP' 'SKIP' 'SKIP' - 'SKIP' ) _prepare_telegram_desktop() ( @@ -187,7 +202,6 @@ _source_telegram_desktop() { ['hamonikr.nimf']='Telegram/ThirdParty/nimf' ['hime-ime.hime']='Telegram/ThirdParty/hime' ['hunspell']='Telegram/ThirdParty/hunspell' - ['jemalloc']='Telegram/ThirdParty/jemalloc' ['kde.kcoreaddons']='Telegram/ThirdParty/kcoreaddons' ['kde.kimageformats']='Telegram/ThirdParty/kimageformats' ['kde.plasma-wayland-protocols']='Telegram/ThirdParty/plasma-wayland-protocols' @@ -277,7 +291,8 @@ _source_mnauw_cppgir() { ) } -if [[ x"${_build_tg_owt::1}" == "xt" ]] ; then +# tg_owt +_source_tg_owt() { makedepends+=( pipewire yasm @@ -299,60 +314,36 @@ if [[ x"${_build_tg_owt::1}" == "xt" ]] ; then '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" - ) - } + # submodules - 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' + ) - _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 + _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 - cmake "${_cmake_options[@]}" - cmake --build "build-tg_owt" + apply-patch "${srcdir:?}/101.patch" + apply-patch "${srcdir:?}/tg_owt-fix.patch" ) +} - _source_desktop_app_tg_owt -fi - -_source_telegram_desktop -_source_ericniebler_range_v3 -_source_telegramdesktop_libtgvoip - -_source_desktop_app_cmake_helpers -_source_mnauw_cppgir - +# common functions prepare() { apply-patch() { printf '\nApplying patch %s\n' "$1" @@ -386,6 +377,21 @@ 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 + ) + + 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 @@ -424,3 +430,6 @@ build() { package() { DESTDIR="${pkgdir:?}" cmake --install build } + +# execute +_main_package |