diff options
author | Giovanni Santini | 2023-06-10 00:22:52 +0200 |
---|---|---|
committer | Giovanni Santini | 2023-06-10 00:22:52 +0200 |
commit | 313dc782b588d4029f9a210d7148129ae4b7912b (patch) | |
tree | f169bbdac22d0883d40eacf715de63775345dcdf | |
parent | 062065167af2f3f0a40ab7dc591a399fc55ea697 (diff) | |
download | aur-313dc782b588d4029f9a210d7148129ae4b7912b.tar.gz |
upgpkg: telegram-desktop-dev 4.8.3-1
- Version bump.
- Added new dependencies.
- Moved all the submodule magic to a separate script.
This simplifies my life generating the sources.
- Cherry-pick a needed commit for avoiding crap in the package.
-rw-r--r-- | .SRCINFO | 84 | ||||
-rw-r--r-- | PKGBUILD | 189 | ||||
-rw-r--r-- | generate_submodules_lines.py | 151 |
3 files changed, 311 insertions, 113 deletions
@@ -1,6 +1,6 @@ pkgbase = telegram-desktop-dev pkgdesc = Official Telegram Desktop client - development release - pkgver = 4.8.1 + pkgver = 4.8.3 pkgrel = 1 url = https://desktop.telegram.org/ arch = x86_64 @@ -17,6 +17,10 @@ pkgbase = telegram-desktop-dev makedepends = wayland-protocols makedepends = plasma-wayland-protocols makedepends = libtg_owt + makedepends = gobject-introspection + makedepends = glib2 + makedepends = boost + makedepends = fmt depends = hunspell depends = ffmpeg depends = hicolor-icon-theme @@ -43,42 +47,46 @@ pkgbase = telegram-desktop-dev optdepends = xdg-desktop-portal: desktop integration provides = telegram-desktop conflicts = telegram-desktop - source = tdesktop::git+https://github.com/telegramdesktop/tdesktop#tag=v4.8.1 + source = tdesktop::git+https://github.com/telegramdesktop/tdesktop#tag=v4.8.3 source = ensure_qt6_build.patch - source = cld3::git+https://github.com/google/cld3.git - source = cmake::git+https://github.com/desktop-app/cmake_helpers.git - source = codegen::git+https://github.com/desktop-app/codegen.git - source = dispatch::git+https://github.com/apple/swift-corelibs-libdispatch - source = expected::git+https://github.com/TartanLlama/expected - source = fcitx5-qt::git+https://github.com/fcitx/fcitx5-qt.git - source = fcitx-qt5::git+https://github.com/fcitx/fcitx-qt5.git - source = GSL::git+https://github.com/Microsoft/GSL.git - source = hime::git+https://github.com/hime-ime/hime.git - source = hunspell::git+https://github.com/hunspell/hunspell - source = jemalloc::git+https://github.com/jemalloc/jemalloc - source = kcoreaddons::git+https://github.com/KDE/kcoreaddons.git - source = kimageformats::git+https://github.com/KDE/kimageformats.git - source = lib_base::git+https://github.com/desktop-app/lib_base.git - source = lib_crl::git+https://github.com/desktop-app/lib_crl.git - source = lib_lottie::git+https://github.com/desktop-app/lib_lottie.git - source = lib_qr::git+https://github.com/desktop-app/lib_qr.git - source = lib_rpl::git+https://github.com/desktop-app/lib_rpl.git - source = lib_spellcheck::git+https://github.com/desktop-app/lib_spellcheck - source = lib_storage::git+https://github.com/desktop-app/lib_storage.git - source = libtgvoip::git+https://github.com/telegramdesktop/libtgvoip - source = lib_tl::git+https://github.com/desktop-app/lib_tl.git - source = lib_ui::git+https://github.com/desktop-app/lib_ui.git - source = lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git - source = lib_webview::git+https://github.com/desktop-app/lib_webview.git - source = lz4::git+https://github.com/lz4/lz4.git - source = nimf::git+https://github.com/hamonikr/nimf.git - source = plasma-wayland-protocols::git+https://github.com/KDE/plasma-wayland-protocols.git - source = QR::git+https://github.com/nayuki/QR-Code-generator - source = range-v3::git+https://github.com/ericniebler/range-v3.git - source = rlottie::git+https://github.com/desktop-app/rlottie.git - source = tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git - source = wayland-protocols::git+https://github.com/gitlab-freedesktop-mirrors/wayland-protocols.git - source = xxHash::git+https://github.com/Cyan4973/xxHash.git + source = submodule_GSL::git+https://github.com/Microsoft/GSL.git + source = submodule_QR-Code-generator::git+https://github.com/nayuki/QR-Code-generator + source = submodule_cld3::git+https://github.com/google/cld3.git + source = submodule_cmake_helpers::git+https://github.com/desktop-app/cmake_helpers.git + source = submodule_codegen::git+https://github.com/desktop-app/codegen.git + source = submodule_cppgir::git+https://gitlab.com/mnauw/cppgir.git + source = submodule_expected::git+https://github.com/TartanLlama/expected + source = submodule_expected-lite::git+https://github.com/martinmoene/expected-lite.git + source = submodule_fcitx-qt5::git+https://github.com/fcitx/fcitx-qt5.git + source = submodule_fcitx5-qt::git+https://github.com/fcitx/fcitx5-qt.git + source = submodule_hime::git+https://github.com/hime-ime/hime.git + source = submodule_hunspell::git+https://github.com/hunspell/hunspell + source = submodule_jemalloc::git+https://github.com/jemalloc/jemalloc + source = submodule_kcoreaddons::git+https://github.com/KDE/kcoreaddons.git + source = submodule_kimageformats::git+https://github.com/KDE/kimageformats.git + source = submodule_lib_base::git+https://github.com/desktop-app/lib_base.git + source = submodule_lib_crl::git+https://github.com/desktop-app/lib_crl.git + source = submodule_lib_lottie::git+https://github.com/desktop-app/lib_lottie.git + source = submodule_lib_qr::git+https://github.com/desktop-app/lib_qr.git + source = submodule_lib_rpl::git+https://github.com/desktop-app/lib_rpl.git + source = submodule_lib_spellcheck::git+https://github.com/desktop-app/lib_spellcheck + source = submodule_lib_storage::git+https://github.com/desktop-app/lib_storage.git + source = submodule_lib_tl::git+https://github.com/desktop-app/lib_tl.git + source = submodule_lib_ui::git+https://github.com/desktop-app/lib_ui.git + source = submodule_lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git + source = submodule_lib_webview::git+https://github.com/desktop-app/lib_webview.git + source = submodule_libtgvoip::git+https://github.com/telegramdesktop/libtgvoip + source = submodule_lz4::git+https://github.com/lz4/lz4.git + source = submodule_nimf::git+https://github.com/hamonikr/nimf.git + source = submodule_plasma-wayland-protocols::git+https://github.com/KDE/plasma-wayland-protocols.git + source = submodule_range-v3::git+https://github.com/ericniebler/range-v3.git + source = submodule_rlottie::git+https://github.com/desktop-app/rlottie.git + source = submodule_swift-corelibs-libdispatch::git+https://github.com/apple/swift-corelibs-libdispatch + source = submodule_tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git + source = submodule_tl-cmake::git+https://github.com/TartanLlama/tl-cmake.git + source = submodule_wayland::git+https://github.com/gitlab-freedesktop-mirrors/wayland.git + source = submodule_wayland-protocols::git+https://github.com/gitlab-freedesktop-mirrors/wayland-protocols.git + source = submodule_xxHash::git+https://github.com/Cyan4973/xxHash.git sha512sums = SKIP sha512sums = 44b4a265cece9a197441cab7483ffdb300c9b93e46983251eed1254b1ab7aa6488e48c3e2aa02dad7f305623314c8def56ca106bc893c777af37bbe8c43f2bc7 sha512sums = SKIP @@ -115,5 +123,9 @@ pkgbase = telegram-desktop-dev sha512sums = SKIP sha512sums = SKIP sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP + sha512sums = SKIP pkgname = telegram-desktop-dev @@ -13,7 +13,7 @@ # You can pass parameters to `ninja` via MAKEFLAGS pkgname=telegram-desktop-dev -pkgver=4.8.1 +pkgver=4.8.3 pkgrel=1 pkgdesc='Official Telegram Desktop client - development release' arch=(x86_64) @@ -26,7 +26,8 @@ depends=('hunspell' 'ffmpeg' 'hicolor-icon-theme' 'lz4' 'minizip' 'openal' 'ttf- 'rnnoise' 'pipewire' 'libxtst' 'libxrandr' 'jemalloc' 'abseil-cpp' 'libdispatch' 'openssl' 'protobuf') makedepends=('cmake' 'git' 'ninja' 'python' 'range-v3' 'tl-expected' 'microsoft-gsl' 'meson' - 'extra-cmake-modules' 'wayland-protocols' 'plasma-wayland-protocols' 'libtg_owt') + 'extra-cmake-modules' 'wayland-protocols' 'plasma-wayland-protocols' 'libtg_owt' + 'gobject-introspection' 'glib2' 'boost' 'fmt') optdepends=('webkit2gtk: embedded browser features' 'xdg-desktop-portal: desktop integration') provides=(telegram-desktop) @@ -42,42 +43,45 @@ source=( "tdesktop::git+https://github.com/telegramdesktop/tdesktop#$_commit" "ensure_qt6_build.patch" # Here are all the submodule repos. - # All the submodules "source" definitions are generated them via: - # git submodule foreach --quiet 'echo \"${name##*/}::git+`git remote get-url origin`\"' | sort - "cld3::git+https://github.com/google/cld3.git" - "cmake::git+https://github.com/desktop-app/cmake_helpers.git" - "codegen::git+https://github.com/desktop-app/codegen.git" - "dispatch::git+https://github.com/apple/swift-corelibs-libdispatch" - "expected::git+https://github.com/TartanLlama/expected" - "fcitx5-qt::git+https://github.com/fcitx/fcitx5-qt.git" - "fcitx-qt5::git+https://github.com/fcitx/fcitx-qt5.git" - "GSL::git+https://github.com/Microsoft/GSL.git" - "hime::git+https://github.com/hime-ime/hime.git" - "hunspell::git+https://github.com/hunspell/hunspell" - "jemalloc::git+https://github.com/jemalloc/jemalloc" - "kcoreaddons::git+https://github.com/KDE/kcoreaddons.git" - "kimageformats::git+https://github.com/KDE/kimageformats.git" - "lib_base::git+https://github.com/desktop-app/lib_base.git" - "lib_crl::git+https://github.com/desktop-app/lib_crl.git" - "lib_lottie::git+https://github.com/desktop-app/lib_lottie.git" - "lib_qr::git+https://github.com/desktop-app/lib_qr.git" - "lib_rpl::git+https://github.com/desktop-app/lib_rpl.git" - "lib_spellcheck::git+https://github.com/desktop-app/lib_spellcheck" - "lib_storage::git+https://github.com/desktop-app/lib_storage.git" - "libtgvoip::git+https://github.com/telegramdesktop/libtgvoip" - "lib_tl::git+https://github.com/desktop-app/lib_tl.git" - "lib_ui::git+https://github.com/desktop-app/lib_ui.git" - "lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git" - "lib_webview::git+https://github.com/desktop-app/lib_webview.git" - "lz4::git+https://github.com/lz4/lz4.git" - "nimf::git+https://github.com/hamonikr/nimf.git" - "plasma-wayland-protocols::git+https://github.com/KDE/plasma-wayland-protocols.git" - "QR::git+https://github.com/nayuki/QR-Code-generator" - "range-v3::git+https://github.com/ericniebler/range-v3.git" - "rlottie::git+https://github.com/desktop-app/rlottie.git" - "tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git" - "wayland-protocols::git+https://github.com/gitlab-freedesktop-mirrors/wayland-protocols.git" - "xxHash::git+https://github.com/Cyan4973/xxHash.git" + # Use the nearby Python script for generating the list + "submodule_GSL::git+https://github.com/Microsoft/GSL.git" + "submodule_QR-Code-generator::git+https://github.com/nayuki/QR-Code-generator" + "submodule_cld3::git+https://github.com/google/cld3.git" + "submodule_cmake_helpers::git+https://github.com/desktop-app/cmake_helpers.git" + "submodule_codegen::git+https://github.com/desktop-app/codegen.git" + "submodule_cppgir::git+https://gitlab.com/mnauw/cppgir.git" + "submodule_expected::git+https://github.com/TartanLlama/expected" + "submodule_expected-lite::git+https://github.com/martinmoene/expected-lite.git" + "submodule_fcitx-qt5::git+https://github.com/fcitx/fcitx-qt5.git" + "submodule_fcitx5-qt::git+https://github.com/fcitx/fcitx5-qt.git" + "submodule_hime::git+https://github.com/hime-ime/hime.git" + "submodule_hunspell::git+https://github.com/hunspell/hunspell" + "submodule_jemalloc::git+https://github.com/jemalloc/jemalloc" + "submodule_kcoreaddons::git+https://github.com/KDE/kcoreaddons.git" + "submodule_kimageformats::git+https://github.com/KDE/kimageformats.git" + "submodule_lib_base::git+https://github.com/desktop-app/lib_base.git" + "submodule_lib_crl::git+https://github.com/desktop-app/lib_crl.git" + "submodule_lib_lottie::git+https://github.com/desktop-app/lib_lottie.git" + "submodule_lib_qr::git+https://github.com/desktop-app/lib_qr.git" + "submodule_lib_rpl::git+https://github.com/desktop-app/lib_rpl.git" + "submodule_lib_spellcheck::git+https://github.com/desktop-app/lib_spellcheck" + "submodule_lib_storage::git+https://github.com/desktop-app/lib_storage.git" + "submodule_lib_tl::git+https://github.com/desktop-app/lib_tl.git" + "submodule_lib_ui::git+https://github.com/desktop-app/lib_ui.git" + "submodule_lib_webrtc::git+https://github.com/desktop-app/lib_webrtc.git" + "submodule_lib_webview::git+https://github.com/desktop-app/lib_webview.git" + "submodule_libtgvoip::git+https://github.com/telegramdesktop/libtgvoip" + "submodule_lz4::git+https://github.com/lz4/lz4.git" + "submodule_nimf::git+https://github.com/hamonikr/nimf.git" + "submodule_plasma-wayland-protocols::git+https://github.com/KDE/plasma-wayland-protocols.git" + "submodule_range-v3::git+https://github.com/ericniebler/range-v3.git" + "submodule_rlottie::git+https://github.com/desktop-app/rlottie.git" + "submodule_swift-corelibs-libdispatch::git+https://github.com/apple/swift-corelibs-libdispatch" + "submodule_tgcalls::git+https://github.com/TelegramMessenger/tgcalls.git" + "submodule_tl-cmake::git+https://github.com/TartanLlama/tl-cmake.git" + "submodule_wayland::git+https://github.com/gitlab-freedesktop-mirrors/wayland.git" + "submodule_wayland-protocols::git+https://github.com/gitlab-freedesktop-mirrors/wayland-protocols.git" + "submodule_xxHash::git+https://github.com/Cyan4973/xxHash.git" ) sha512sums=('SKIP' '44b4a265cece9a197441cab7483ffdb300c9b93e46983251eed1254b1ab7aa6488e48c3e2aa02dad7f305623314c8def56ca106bc893c777af37bbe8c43f2bc7' @@ -114,55 +118,81 @@ sha512sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' 'SKIP') prepare() { + # Magic submodule configuration, thanks to the Python script + git -C "$srcdir/tdesktop" submodule init + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/GSL.url "$srcdir/submodule_GSL" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/QR.url "$srcdir/submodule_QR-Code-generator" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/cld3.url "$srcdir/submodule_cld3" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/dispatch.url "$srcdir/submodule_swift-corelibs-libdispatch" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/expected.url "$srcdir/submodule_expected" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/fcitx-qt5.url "$srcdir/submodule_fcitx-qt5" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/fcitx5-qt.url "$srcdir/submodule_fcitx5-qt" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/hime.url "$srcdir/submodule_hime" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/hunspell.url "$srcdir/submodule_hunspell" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/jemalloc.url "$srcdir/submodule_jemalloc" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/kcoreaddons.url "$srcdir/submodule_kcoreaddons" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/kimageformats.url "$srcdir/submodule_kimageformats" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/libtgvoip.url "$srcdir/submodule_libtgvoip" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/lz4.url "$srcdir/submodule_lz4" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/nimf.url "$srcdir/submodule_nimf" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/plasma-wayland-protocols.url "$srcdir/submodule_plasma-wayland-protocols" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/range-v3.url "$srcdir/submodule_range-v3" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/rlottie.url "$srcdir/submodule_rlottie" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/tgcalls.url "$srcdir/submodule_tgcalls" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/wayland.url "$srcdir/submodule_wayland" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/wayland-protocols.url "$srcdir/submodule_wayland-protocols" + git -C "$srcdir/tdesktop" config src.Telegram/ThirdParty/xxHash.url "$srcdir/submodule_xxHash" + git -C "$srcdir/tdesktop" config src.Telegram/codegen.url "$srcdir/submodule_codegen" + git -C "$srcdir/tdesktop" config src.Telegram/lib_base.url "$srcdir/submodule_lib_base" + git -C "$srcdir/tdesktop" config src.Telegram/lib_crl.url "$srcdir/submodule_lib_crl" + git -C "$srcdir/tdesktop" config src.Telegram/lib_lottie.url "$srcdir/submodule_lib_lottie" + git -C "$srcdir/tdesktop" config src.Telegram/lib_qr.url "$srcdir/submodule_lib_qr" + git -C "$srcdir/tdesktop" config src.Telegram/lib_rpl.url "$srcdir/submodule_lib_rpl" + git -C "$srcdir/tdesktop" config src.Telegram/lib_spellcheck.url "$srcdir/submodule_lib_spellcheck" + git -C "$srcdir/tdesktop" config src.Telegram/lib_storage.url "$srcdir/submodule_lib_storage" + git -C "$srcdir/tdesktop" config src.Telegram/lib_tl.url "$srcdir/submodule_lib_tl" + git -C "$srcdir/tdesktop" config src.Telegram/lib_ui.url "$srcdir/submodule_lib_ui" + git -C "$srcdir/tdesktop" config src.Telegram/lib_webrtc.url "$srcdir/submodule_lib_webrtc" + git -C "$srcdir/tdesktop" config src.Telegram/lib_webview.url "$srcdir/submodule_lib_webview" + git -C "$srcdir/tdesktop" config src.cmake.url "$srcdir/submodule_cmake_helpers" + git -C "$srcdir/tdesktop" submodule update + + git -C "$srcdir/tdesktop/cmake" submodule init + git -C "$srcdir/tdesktop/cmake" config src.external/glib/cppgir.url "$srcdir/submodule_cppgir" + git -C "$srcdir/tdesktop/cmake" submodule update + + git -C "$srcdir/tdesktop/cmake/external/glib/cppgir" submodule init + git -C "$srcdir/tdesktop/cmake/external/glib/cppgir" config src.expected-lite.url "$srcdir/submodule_expected-lite" + git -C "$srcdir/tdesktop/cmake/external/glib/cppgir" submodule update + + git -C "$srcdir/tdesktop/Telegram/ThirdParty/range-v3" submodule init + git -C "$srcdir/tdesktop/Telegram/ThirdParty/range-v3" config src.doc/gh-pages.url "$srcdir/submodule_range-v3" + git -C "$srcdir/tdesktop/Telegram/ThirdParty/range-v3" submodule update + + git -C "$srcdir/tdesktop/Telegram/ThirdParty/libtgvoip" submodule init + git -C "$srcdir/tdesktop/Telegram/ThirdParty/libtgvoip" config src.cmake.url "$srcdir/submodule_cmake_helpers" + git -C "$srcdir/tdesktop/Telegram/ThirdParty/libtgvoip" submodule update + + git -C "$srcdir/tdesktop/Telegram/ThirdParty/expected" submodule init + git -C "$srcdir/tdesktop/Telegram/ThirdParty/expected" config src.cmake/tl-cmake.url "$srcdir/submodule_tl-cmake" + git -C "$srcdir/tdesktop/Telegram/ThirdParty/expected" submodule update + + # Normal preparation here cd "$srcdir/tdesktop" - git submodule init - - # Same magic as above. - # git submodule foreach --quiet 'echo git config submodule.$name.url \"\$srcdir/${name##*/}\"' | sort - git config submodule.cmake.url "$srcdir/cmake" - git config submodule.Telegram/codegen.url "$srcdir/codegen" - git config submodule.Telegram/lib_base.url "$srcdir/lib_base" - git config submodule.Telegram/lib_crl.url "$srcdir/lib_crl" - git config submodule.Telegram/lib_lottie.url "$srcdir/lib_lottie" - git config submodule.Telegram/lib_qr.url "$srcdir/lib_qr" - git config submodule.Telegram/lib_rpl.url "$srcdir/lib_rpl" - git config submodule.Telegram/lib_spellcheck.url "$srcdir/lib_spellcheck" - git config submodule.Telegram/lib_storage.url "$srcdir/lib_storage" - git config submodule.Telegram/lib_tl.url "$srcdir/lib_tl" - git config submodule.Telegram/lib_ui.url "$srcdir/lib_ui" - git config submodule.Telegram/lib_webrtc.url "$srcdir/lib_webrtc" - git config submodule.Telegram/lib_webview.url "$srcdir/lib_webview" - git config submodule.Telegram/ThirdParty/cld3.url "$srcdir/cld3" - git config submodule.Telegram/ThirdParty/dispatch.url "$srcdir/dispatch" - git config submodule.Telegram/ThirdParty/expected.url "$srcdir/expected" - git config submodule.Telegram/ThirdParty/fcitx5-qt.url "$srcdir/fcitx5-qt" - git config submodule.Telegram/ThirdParty/fcitx-qt5.url "$srcdir/fcitx-qt5" - git config submodule.Telegram/ThirdParty/GSL.url "$srcdir/GSL" - git config submodule.Telegram/ThirdParty/hime.url "$srcdir/hime" - git config submodule.Telegram/ThirdParty/hunspell.url "$srcdir/hunspell" - git config submodule.Telegram/ThirdParty/jemalloc.url "$srcdir/jemalloc" - git config submodule.Telegram/ThirdParty/kcoreaddons.url "$srcdir/kcoreaddons" - git config submodule.Telegram/ThirdParty/kimageformats.url "$srcdir/kimageformats" - git config submodule.Telegram/ThirdParty/libtgvoip.url "$srcdir/libtgvoip" - git config submodule.Telegram/ThirdParty/lz4.url "$srcdir/lz4" - git config submodule.Telegram/ThirdParty/nimf.url "$srcdir/nimf" - git config submodule.Telegram/ThirdParty/plasma-wayland-protocols.url "$srcdir/plasma-wayland-protocols" - git config submodule.Telegram/ThirdParty/QR.url "$srcdir/QR" - git config submodule.Telegram/ThirdParty/range-v3.url "$srcdir/range-v3" - git config submodule.Telegram/ThirdParty/rlottie.url "$srcdir/rlottie" - git config submodule.Telegram/ThirdParty/tgcalls.url "$srcdir/tgcalls" - git config submodule.Telegram/ThirdParty/wayland-protocols.url "$srcdir/wayland-protocols" - git config submodule.Telegram/ThirdParty/xxHash.url "$srcdir/xxHash" # Magic is over! # We need the extra flag for this vulnerability: # https://github.blog/2022-10-18-git-security-vulnerabilities-announced/#cve-2022-39253 # With the -c flag we enable the file cloning only for this command, as per guidelines: # https://wiki.archlinux.org/title/VCS_package_guidelines#Git_submodules - git -c protocol.file.allow=always submodule update + #git -c protocol.file.allow=always submodule update --recursive # Cheating! Linking fixed patches to their usual place #for fixed in $srcdir/*_fixed* @@ -171,6 +201,11 @@ prepare() { #done # Patch here, if needed! # patch -Np1 -i "$srcdir/my_beautiful.patch" + + # Ensure cppgir is not installed + cd "$srcdir/tdesktop/cmake" + git cherry-pick 6b0eeb2c15aa278ffa577bcefebcff8f2c98aca9 + # Official package patches } diff --git a/generate_submodules_lines.py b/generate_submodules_lines.py new file mode 100644 index 000000000000..0829d86bdbc2 --- /dev/null +++ b/generate_submodules_lines.py @@ -0,0 +1,151 @@ +#!/usr/bin/env python3 +"""Small utility for generating the relevant metadata for the PKGBUILD.""" +from glob import glob +from os import cpu_count +from os.path import dirname +import shutil +from subprocess import run as run_command +import tempfile +from typing import Tuple + + +def parse_versions() -> Tuple[str, str]: + """Return the old and the new version of Telegram Desktop, in this order.""" + with open("PKGBUILD") as PKGBUILD, open(".SRCINFO") as SRCINFO: + old_content = SRCINFO.readlines() + new_content = PKGBUILD.readlines() + + def fetch_value(file_lines: list[str]) -> str: + """Fetch the value of "pkgver" from the file lines""" + filtered_content = filter(lambda s: s.strip().startswith("pkgver"), file_lines) + first_value_line = next(filtered_content).strip() + # Lines are: pkgver = X, with perhaps spaces + return first_value_line.split("=")[1].strip() + + return fetch_value(old_content), fetch_value(new_content) + + +def git_clone_repo(old_version: str, new_version: str) -> str: + """Fetch the Git repository with the proper parameters and provides the folder name.""" + temp_git_folder = tempfile.mkdtemp() + + git_clone_command = [ + "git", + "clone", + "--quiet", + "--recurse-submodules", + "--shallow-submodules", + f"--shallow-since=v{old_version}", + f"--branch=v{new_version}", + "https://github.com/telegramdesktop/tdesktop", + temp_git_folder, + ] + + cpus = cpu_count() + if cpus is not None: + git_clone_command.append(f"--jobs={cpus}") + + print(f"Runnng: {' '.join(git_clone_command)}") + + run_command(git_clone_command, check=True) + return temp_git_folder + + +def fetch_submodule_data(git_repository: str, base_repo: str): + """Return all relevant instructions for the PKGBUILLD given the repository.""" + sources: dict[str, str] = {} + commands: list[str] = [] + parsed_folders: set[str] = set() + + def generate_repo_data(git_subrepo: str): + """Do the heavy work for one repo and recurse for the others.""" + if git_subrepo in parsed_folders: + print(f"# Folder already handled: {git_subrepo}, skipping ...") + source_folder = git_subrepo.replace(git_repository, base_repo) + print(f"# Working in {source_folder}...") + + md_sep = "::" + """custom metadata separator""" + + git_remotes_command = run_command( + [ + "git", + "-C", + git_subrepo, + "submodule", + "foreach", + "--quiet", + f'printf "$name{md_sep}" ; git remote get-url origin', + ], + capture_output=True, + ) + git_submodules_metadata = git_remotes_command.stdout.decode().splitlines() + + if git_submodules_metadata: + commands.append(f'git -C "{source_folder}" submodule init') + + for git_submodule_data in git_submodules_metadata: + submodule_name, git_remote = git_submodule_data.split(md_sep, maxsplit=1) + + # Fetch the unique repo name and make it easy to use + # https://github.com/some/repo.git -> repo + git_repo_name = ( + "submodule_" + git_remote.split("/")[-1].split(".git", maxsplit=1)[0] + ) + + if git_repo_name in sources and sources[git_repo_name] != git_remote: + raise RuntimeError( + f"Multiple sources with same name {git_repo_name} but different values: " + f"{git_remote} != {sources[git_repo_name]}" + ) + + sources[git_repo_name] = git_remote + commands.append( + f'git -C "{source_folder}" config src.{submodule_name}.url "$srcdir/{git_repo_name}"' + ) + + if git_submodules_metadata: + commands.append(f'git -C "{source_folder}" submodule update') + commands.append("") + + parsed_folders.add(git_subrepo) + + # Recurse on lower subrepos + found_gitmodules = glob(f"{git_subrepo}/**/.gitmodules", recursive=True) + found_subrepos = [ + dirname(gitmodule_path) for gitmodule_path in found_gitmodules + ] + + for found_subrepo in found_subrepos: + if found_subrepo in parsed_folders: + continue + generate_repo_data(found_subrepo) + + generate_repo_data(git_repository) + + return sources, commands + + +def generate_metadata(): + """Main method, doing the hard work.""" + old_version, new_version = parse_versions() + + git_repo_path = git_clone_repo(old_version, new_version) + + sources, commands = fetch_submodule_data(git_repo_path, "$srcdir/tdesktop") + + indent = " " * 4 + + print("# Sources:") + for k, v in sorted(sources.items()): + print(indent + f'"{k}::git+{v}"') + + print("# Commands in prepare:") + for l in commands: + print(indent + l if l.strip() else "") + + shutil.rmtree(git_repo_path) + + +if __name__ == "__main__": + generate_metadata() |