Skip to content

Commit

Permalink
Get rid of glibmm
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Mar 14, 2024
1 parent 3689e7d commit d3715cc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 96 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ endif()
include(cmake/external/qt/package.cmake)

set(desktop_app_skip_libs
glibmm
variant
)

Expand Down
5 changes: 0 additions & 5 deletions Telegram/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions Telegram/SourceFiles/platform/linux/specific_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ For license and copyright information please follow this link:
#include <kshell.h>
#include <ksandbox.h>

#include <glibmm.h>

#include <xdgdbus/xdgdbus.hpp>
#include <xdpbackground/xdpbackground.hpp>
#include <xdprequest/xdprequest.hpp>
Expand Down Expand Up @@ -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,
Expand Down
22 changes: 0 additions & 22 deletions Telegram/build/docker/centos_env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 /

Expand Down Expand Up @@ -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 /
Expand Down
3 changes: 0 additions & 3 deletions docs/building-linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
68 changes: 6 additions & 62 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ parts:
- libboost-regex1.74-dev
- libfmt-dev
- libgirepository1.0-dev
- libglib2.0-dev
- libheif-dev
- libopus-dev
- libpulse-dev
Expand All @@ -113,6 +114,7 @@ parts:
- libasound2
- libavif13
- libboost-regex1.74.0
- libglib2.0-0
- libheif1
- libopus0
- libpulse0
Expand Down Expand Up @@ -156,7 +158,6 @@ parts:
after:
- ffmpeg
- libjxl
- glibmm
- mozjpeg
- openal
- protobuf
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -418,6 +360,7 @@ parts:
- libegl-dev
- libfontconfig1-dev
- libfreetype-dev
- libglib2.0-dev
- libglx-dev
- libgtk-3-dev
- libharfbuzz-dev
Expand Down Expand Up @@ -456,6 +399,7 @@ parts:
- libegl1
- libfontconfig1
- libfreetype6
- libglib2.0-0
- libglx0
- libgtk-3-0
- libharfbuzz0b
Expand Down Expand Up @@ -535,7 +479,6 @@ parts:
- -./usr/mkspecs
- -./usr/modules
after:
- glib
- mozjpeg
- patches

Expand Down Expand Up @@ -579,6 +522,7 @@ parts:
- libegl-dev
- libgbm-dev
- libgl-dev
- libglib2.0-dev
- libopenh264-dev
- libopus-dev
- libpipewire-0.3-dev
Expand All @@ -597,6 +541,7 @@ parts:
- libegl1
- libgbm1
- libgl1
- libglib2.0-0
- libopenh264-6
- libopus0
- libssl3
Expand All @@ -620,5 +565,4 @@ parts:
- -./usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*.a
after:
- ffmpeg
- glib
- mozjpeg

0 comments on commit d3715cc

Please sign in to comment.