From d3715cc3624046d34580b2944d88cea4d9d89576 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 14 Mar 2024 21:50:58 +0400 Subject: [PATCH] Get rid of glibmm --- CMakeLists.txt | 1 + Telegram/CMakeLists.txt | 5 -- .../platform/linux/specific_linux.cpp | 4 -- Telegram/build/docker/centos_env/Dockerfile | 22 ------ docs/building-linux.md | 3 - snap/snapcraft.yaml | 68 ++----------------- 6 files changed, 7 insertions(+), 96 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dcf88602f6..3bf13693b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,7 @@ endif() include(cmake/external/qt/package.cmake) set(desktop_app_skip_libs + glibmm variant ) diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 5d30acc969..46e061a092 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -1679,11 +1679,6 @@ elseif (APPLE) ) endif() else() - target_link_libraries(Telegram - PRIVATE - desktop-app::external_glibmm - ) - include(${cmake_helpers_loc}/external/glib/generate_dbus.cmake) generate_dbus(Telegram org.freedesktop.portal. XdpBackground ${third_party_loc}/xdg-desktop-portal/data/org.freedesktop.portal.Background.xml) generate_dbus(Telegram org.freedesktop. XdgNotifications ${src_loc}/platform/linux/org.freedesktop.Notifications.xml) diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index c6f9390e7b..8d662cdc4a 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -35,8 +35,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include -#include - #include #include #include @@ -692,8 +690,6 @@ void start() { GLib::set_prgname(cExeName().toStdString()); GLib::set_application_name(AppName.data()); - Glib::init(); - Webview::WebKitGTK::SetSocketPath(u"%1/%2-%3-webview-%4"_q.arg( QDir::tempPath(), h, diff --git a/Telegram/build/docker/centos_env/Dockerfile b/Telegram/build/docker/centos_env/Dockerfile index ec9e9a3ad0..9ff771f41c 100644 --- a/Telegram/build/docker/centos_env/Dockerfile +++ b/Telegram/build/docker/centos_env/Dockerfile @@ -705,27 +705,6 @@ RUN git clone -b 2.78.1 --depth=1 {{ GIT }}/GNOME/glib.git \ && cd .. \ && rm -rf glib -FROM patches AS glibmm -COPY --link --from=glib {{ LibrariesPath }}/glib-cache / - -RUN git clone -b 2.78.0 --depth=1 {{ GIT }}/GNOME/glibmm.git \ - && cd glibmm \ - && git apply ../patches/glibmm.patch \ - && CFLAGS="$CFLAGS {{ CFLAGS_LTO }}" CXXFLAGS="$CXXFLAGS {{ CFLAGS_LTO }}" meson build \ - --buildtype=plain \ - --default-library=both \ - -Dbuild-documentation=false \ - -Dbuild-examples=false \ - -Dsigc++-3.0:build-documentation=false \ - -Dsigc++-3.0:build-examples=false \ - -Dsigc++-3.0:build-tests=false \ - -Dsigc++-3.0:validation=false \ - -Dmm-common:use-network=true \ - && meson compile -C build \ - && DESTDIR="{{ LibrariesPath }}/glibmm-cache" meson install -C build \ - && cd .. \ - && rm -rf glibmm - FROM builder AS gobject-introspection COPY --link --from=glib {{ LibrariesPath }}/glib-cache / @@ -873,7 +852,6 @@ COPY --link --from=openal {{ LibrariesPath }}/openal-cache / COPY --link --from=openssl {{ LibrariesPath }}/openssl-cache / COPY --link --from=xkbcommon {{ LibrariesPath }}/xkbcommon-cache / COPY --link --from=glib {{ LibrariesPath }}/glib-cache / -COPY --link --from=glibmm {{ LibrariesPath }}/glibmm-cache / COPY --link --from=gobject-introspection {{ LibrariesPath }}/gobject-introspection-cache / COPY --link --from=qt {{ LibrariesPath }}/qt-cache / COPY --link --from=breakpad {{ LibrariesPath }}/breakpad-cache / diff --git a/docs/building-linux.md b/docs/building-linux.md index 4fa4503b5a..393bd854ac 100644 --- a/docs/building-linux.md +++ b/docs/building-linux.md @@ -36,9 +36,6 @@ Or, to create a debug build, run (also using [your **api_id** and **api_hash**]( -D TDESKTOP_API_ID=YOUR_API_ID \ -D TDESKTOP_API_HASH=YOUR_API_HASH -If you need a backward compatible binary (running on older OS like the official one), you should build the binary with LTO. -To do this, add `-D CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON` option. - The built files will be in the `out` directory. [api_credentials]: api_credentials.md diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index b309c3d117..95e95f3750 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -99,6 +99,7 @@ parts: - libboost-regex1.74-dev - libfmt-dev - libgirepository1.0-dev + - libglib2.0-dev - libheif-dev - libopus-dev - libpulse-dev @@ -113,6 +114,7 @@ parts: - libasound2 - libavif13 - libboost-regex1.74.0 + - libglib2.0-0 - libheif1 - libopus0 - libpulse0 @@ -156,7 +158,6 @@ parts: after: - ffmpeg - libjxl - - glibmm - mozjpeg - openal - protobuf @@ -176,18 +177,6 @@ parts: rm -rf patches stage: [-./*] - meson-deps: - source: https://github.com/mesonbuild/meson.git - source-depth: 1 - source-branch: 1.2.3 - plugin: nil - build-packages: - - python3-pip - - ninja-build - override-build: | - pip install . - stage: [-./*] - desktop-qt: source: https://github.com/desktop-app/snapcraft-desktop-helpers.git source-depth: 1 @@ -254,53 +243,6 @@ parts: after: - mozjpeg - glib: - source: https://github.com/GNOME/glib.git - source-depth: 1 - source-tag: 2.78.1 - plugin: meson - build-packages: - - mm-common - - ninja-build - meson-parameters: - - --buildtype=release - - --prefix=/usr - - --strip - - -Dtests=false - prime: - - -./usr/include - - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig - - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.so - after: - - meson-deps - - glibmm: - source: https://github.com/GNOME/glibmm.git - source-depth: 1 - source-tag: 2.78.0 - plugin: meson - build-packages: - - mm-common - - ninja-build - - libxml-parser-perl - meson-parameters: - - --buildtype=release - - --prefix=/usr - - --strip - - -Dbuild-documentation=false - - -Dbuild-examples=false - - -Dsigc++-3.0:build-documentation=false - - -Dsigc++-3.0:build-examples=false - - -Dsigc++-3.0:build-tests=false - - -Dsigc++-3.0:validation=false - prime: - - -./usr/include - - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig - - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.so - after: - - meson-deps - - glib - libjxl: source: https://github.com/libjxl/libjxl.git source-depth: 1 @@ -418,6 +360,7 @@ parts: - libegl-dev - libfontconfig1-dev - libfreetype-dev + - libglib2.0-dev - libglx-dev - libgtk-3-dev - libharfbuzz-dev @@ -456,6 +399,7 @@ parts: - libegl1 - libfontconfig1 - libfreetype6 + - libglib2.0-0 - libglx0 - libgtk-3-0 - libharfbuzz0b @@ -535,7 +479,6 @@ parts: - -./usr/mkspecs - -./usr/modules after: - - glib - mozjpeg - patches @@ -579,6 +522,7 @@ parts: - libegl-dev - libgbm-dev - libgl-dev + - libglib2.0-dev - libopenh264-dev - libopus-dev - libpipewire-0.3-dev @@ -597,6 +541,7 @@ parts: - libegl1 - libgbm1 - libgl1 + - libglib2.0-0 - libopenh264-6 - libopus0 - libssl3 @@ -620,5 +565,4 @@ parts: - -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.a after: - ffmpeg - - glib - mozjpeg