From 2a6e2fa353d5c4b7ab6a05eef5ce8952c78c2a73 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 28 Sep 2022 20:01:59 +0400 Subject: [PATCH] Bundle kcoreaddons --- .gitmodules | 3 ++ Telegram/SourceFiles/core/update_checker.cpp | 3 +- Telegram/SourceFiles/core/utils.h | 12 +++--- .../SourceFiles/mtproto/session_private.cpp | 2 +- .../platform/linux/specific_linux.cpp | 5 ++- Telegram/ThirdParty/kcoreaddons | 1 + Telegram/build/docker/centos_env/Dockerfile | 43 ------------------- Telegram/lib_base | 2 +- cmake | 2 +- snap/snapcraft.yaml | 39 ----------------- 10 files changed, 18 insertions(+), 94 deletions(-) create mode 160000 Telegram/ThirdParty/kcoreaddons diff --git a/.gitmodules b/.gitmodules index c3618c2c87..36964946da 100644 --- a/.gitmodules +++ b/.gitmodules @@ -94,3 +94,6 @@ [submodule "Telegram/ThirdParty/kimageformats"] path = Telegram/ThirdParty/kimageformats url = https://github.com/KDE/kimageformats.git +[submodule "Telegram/ThirdParty/kcoreaddons"] + path = Telegram/ThirdParty/kcoreaddons + url = https://github.com/KDE/kcoreaddons.git diff --git a/Telegram/SourceFiles/core/update_checker.cpp b/Telegram/SourceFiles/core/update_checker.cpp index 4d7c2b528e..5d4046635c 100644 --- a/Telegram/SourceFiles/core/update_checker.cpp +++ b/Telegram/SourceFiles/core/update_checker.cpp @@ -31,7 +31,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include -#include + +#include extern "C" { #include diff --git a/Telegram/SourceFiles/core/utils.h b/Telegram/SourceFiles/core/utils.h index 7424889c0a..0e74a5664a 100644 --- a/Telegram/SourceFiles/core/utils.h +++ b/Telegram/SourceFiles/core/utils.h @@ -22,12 +22,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include -#if __has_include() -#include +#if __has_include() +#include #endif -#if __has_include() -#include +#if __has_include() +#include #endif #define qsl(s) QStringLiteral(s) @@ -39,7 +39,7 @@ inline bool in_range(Value &&value, From &&from, Till &&till) { return (value >= from) && (value < till); } -#if __has_include() +#if __has_include() inline QList GetMimeUrls(const QMimeData *data) { if (!data->hasUrls()) { return {}; @@ -51,7 +51,7 @@ inline QList GetMimeUrls(const QMimeData *data) { } #endif -#if __has_include() && defined DeclareReadSetting +#if __has_include() && defined DeclareReadSetting inline QString FlatpakID() { static const auto Result = [] { if (!qEnvironmentVariableIsEmpty("FLATPAK_ID")) { diff --git a/Telegram/SourceFiles/mtproto/session_private.cpp b/Telegram/SourceFiles/mtproto/session_private.cpp index cba21d5957..fe4beb8356 100644 --- a/Telegram/SourceFiles/mtproto/session_private.cpp +++ b/Telegram/SourceFiles/mtproto/session_private.cpp @@ -21,7 +21,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/unixtime.h" #include "base/platform/base_platform_info.h" -#include +#include #include namespace MTP { diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 57d25adf5f..636c7536c5 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -35,8 +35,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include #include -#include -#include + +#include +#include #ifndef DESKTOP_APP_DISABLE_DBUS_INTEGRATION #include diff --git a/Telegram/ThirdParty/kcoreaddons b/Telegram/ThirdParty/kcoreaddons new file mode 160000 index 0000000000..3c1d4a275d --- /dev/null +++ b/Telegram/ThirdParty/kcoreaddons @@ -0,0 +1 @@ +Subproject commit 3c1d4a275d06a9702f55be6e62321eca9637463f diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index ce79ff9590..41c7682ac2 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -62,15 +62,6 @@ RUN git clone -b nasm-2.15.05 --depth=1 {{ GIT }}/netwide-assembler/nasm.git \ && cd .. \ && rm -rf nasm -FROM builder AS extra-cmake-modules -RUN git clone -b v5.98.0 --depth=1 {{ GIT }}/KDE/extra-cmake-modules.git \ - && cd extra-cmake-modules \ - && cmake -GNinja -B build . -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF \ - && cmake --build build --parallel \ - && DESTDIR="{{ LibrariesPath }}/extra-cmake-modules-cache" cmake --install build \ - && cd .. \ - && rm -rf extra-cmake-modules - FROM builder AS libffi RUN git clone -b v3.4.2 --depth=1 {{ GIT }}/libffi/libffi.git \ && cd libffi \ @@ -718,39 +709,6 @@ RUN git clone -b {{ QT_TAG }} --depth=1 git://code.qt.io/qt/qt5.git qt_{{ QT }} && cd .. \ && rm -rf qt_{{ QT }} -FROM patches AS kcoreaddons -COPY --link --from=extra-cmake-modules {{ LibrariesPath }}/extra-cmake-modules-cache / -COPY --link --from=libffi {{ LibrariesPath }}/libffi-cache / -COPY --link --from=zlib {{ LibrariesPath }}/zlib-cache / -COPY --link --from=libproxy {{ LibrariesPath }}/libproxy-cache / -COPY --link --from=mozjpeg {{ LibrariesPath }}/mozjpeg-cache / -COPY --link --from=xcb {{ LibrariesPath }}/xcb-cache / -COPY --link --from=xcb-wm {{ LibrariesPath }}/xcb-wm-cache / -COPY --link --from=xcb-util {{ LibrariesPath }}/xcb-util-cache / -COPY --link --from=xcb-image {{ LibrariesPath }}/xcb-image-cache / -COPY --link --from=xcb-keysyms {{ LibrariesPath }}/xcb-keysyms-cache / -COPY --link --from=xcb-render-util {{ LibrariesPath }}/xcb-render-util-cache / -COPY --link --from=wayland {{ LibrariesPath }}/wayland-cache / -COPY --link --from=openssl {{ LibrariesPath }}/openssl-cache / -COPY --link --from=xkbcommon {{ LibrariesPath }}/xkbcommon-cache / -COPY --link --from=qt {{ LibrariesPath }}/qt-cache / - -RUN git clone -b v5.98.0 --depth=1 {{ GIT }}/KDE/kcoreaddons.git \ - && cd kcoreaddons \ - && curl -sSL https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/258.patch | git apply \ - && rm -rf po \ - && cmake -GNinja -B build . \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH={{ QT_PREFIX }} \ - -DBUILD_SHARED_LIBS=OFF \ - -DBUILD_TESTING=OFF \ - -DBUILD_WITH_QT6=ON \ - -DEXCLUDE_DEPRECATED_BEFORE_AND_AT=5.78.0 \ - && cmake --build build --parallel \ - && DESTDIR="{{ LibrariesPath }}/kcoreaddons-cache" cmake --install build \ - && cd .. \ - && rm -rf kcoreaddons - FROM patches AS breakpad RUN git clone https://chromium.googlesource.com/breakpad/breakpad.git \ && cd breakpad \ @@ -846,7 +804,6 @@ COPY --link --from=xkbcommon {{ LibrariesPath }}/xkbcommon-cache / COPY --link --from=libsigcplusplus {{ LibrariesPath }}/libsigcplusplus-cache / COPY --link --from=glibmm {{ LibrariesPath }}/glibmm-cache / COPY --link --from=qt {{ LibrariesPath }}/qt-cache / -COPY --link --from=kcoreaddons {{ LibrariesPath }}/kcoreaddons-cache / COPY --link --from=breakpad {{ LibrariesPath }}/breakpad-cache / COPY --link --from=webrtc {{ LibrariesPath }}/tg_owt tg_owt COPY --link --from=webrtc_release {{ LibrariesPath }}/tg_owt/out/Release tg_owt/out/Release diff --git a/Telegram/lib_base b/Telegram/lib_base index 72f9e778be..d0932b9ead 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 72f9e778be5503b918d8677c8216360695767835 +Subproject commit d0932b9ead24bb86fb91b493573e464e9145cbc2 diff --git a/cmake b/cmake index f49e254d8c..84f43a8252 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit f49e254d8c5287752b5ed7b86bd84073f584768e +Subproject commit 84f43a82524b0fa6ad13f3310f7a38a32f6746f1 diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 30507f6834..98485a3c43 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -156,7 +156,6 @@ parts: after: - desktop-qt - ffmpeg - - kcoreaddons - libjxl - mozjpeg - openal @@ -200,17 +199,6 @@ parts: - mozjpeg - qt - extra-cmake-modules: - source: https://github.com/KDE/extra-cmake-modules.git - source-depth: 1 - source-tag: v5.98.0 - plugin: cmake - cmake-parameters: - - -DCMAKE_BUILD_TYPE=Release - - -DCMAKE_INSTALL_PREFIX=/usr - - -DBUILD_TESTING=OFF - prime: [-./*] - ffmpeg: plugin: nil build-packages: @@ -230,33 +218,6 @@ parts: after: - mozjpeg - kcoreaddons: - source: https://github.com/KDE/kcoreaddons.git - source-depth: 1 - source-tag: v5.98.0 - plugin: cmake - build-packages: - - curl - cmake-parameters: - - -DCMAKE_BUILD_TYPE=Release - - -DCMAKE_INSTALL_PREFIX=/usr - - -DBUILD_TESTING=OFF - - -DBUILD_WITH_QT6=ON - - -DEXCLUDE_DEPRECATED_BEFORE_AND_AT=5.78.0 - override-pull: | - snapcraftctl pull - curl -sSL https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/258.patch | git apply - rm -rf po - prime: - - -./usr/bin - - -./usr/include - - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/cmake - - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.so - - -./usr/mkspecs - after: - - extra-cmake-modules - - desktop-qt - libjxl: source: https://github.com/libjxl/libjxl.git source-depth: 1