Get rid of glibmm

This commit is contained in:
Ilya Fedin 2024-03-14 21:50:58 +04:00 committed by John Preston
parent 3689e7dfbc
commit d3715cc362
6 changed files with 7 additions and 96 deletions

View File

@ -68,6 +68,7 @@ endif()
include(cmake/external/qt/package.cmake)
set(desktop_app_skip_libs
glibmm
variant
)

View File

@ -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)

View File

@ -35,8 +35,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <kshell.h>
#include <ksandbox.h>
#include <glibmm.h>
#include <xdgdbus/xdgdbus.hpp>
#include <xdpbackground/xdpbackground.hpp>
#include <xdprequest/xdprequest.hpp>
@ -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,

View File

@ -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 /

View File

@ -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

View File

@ -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