Re-use fontconfig fallback code in snap

This commit is contained in:
Ilya Fedin 2020-03-28 11:18:33 +04:00 committed by John Preston
parent bdde198f52
commit aa4968faaa
3 changed files with 8 additions and 8 deletions

View File

@ -96,7 +96,7 @@ bool RunShellCommand(const QByteArray &command) {
}
void FallbackFontConfig() {
#ifdef TDESKTOP_USE_FONT_CONFIG_FALLBACK
#ifdef TDESKTOP_USE_FONTCONFIG_FALLBACK
const auto custom = cWorkingDir() + "tdata/fc-custom-1.conf";
const auto finish = gsl::finally([&] {
if (QFile(custom).exists()) {
@ -131,7 +131,7 @@ void FallbackFontConfig() {
}
QFile(":/fc/fc-custom.conf").copy(custom);
#endif // TDESKTOP_USE_FONT_CONFIG_FALLBACK
#endif // TDESKTOP_USE_FONTCONFIG_FALLBACK
}
bool GenerateDesktopFile(

View File

@ -4,6 +4,7 @@
# For license and copyright information please follow this link:
# https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
option(TDESKTOP_USE_FONTCONFIG_FALLBACK "Use custom fonts.conf (Linux only)." OFF)
option(TDESKTOP_FORCE_GTK_FILE_DIALOG "Force using GTK file dialog (Linux only)." OFF)
option(TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME "Disable automatic 'tg://' URL scheme handler registration." ${DESKTOP_APP_USE_PACKAGED})
option(TDESKTOP_DISABLE_NETWORK_PROXY "Disable all code for working through Socks5 or MTProxy." OFF)
@ -63,6 +64,10 @@ if (DESKTOP_APP_SPECIAL_TARGET)
target_compile_definitions(Telegram PRIVATE TDESKTOP_ALLOW_CLOSED_ALPHA)
endif()
if (TDESKTOP_USE_FONTCONFIG_FALLBACK)
target_compile_definitions(Telegram PRIVATE TDESKTOP_USE_FONTCONFIG_FALLBACK)
endif()
if (TDESKTOP_FORCE_GTK_FILE_DIALOG)
target_compile_definitions(Telegram PRIVATE TDESKTOP_FORCE_GTK_FILE_DIALOG)
endif()

View File

@ -102,6 +102,7 @@ parts:
- -DDESKTOP_APP_USE_PACKAGED_EXPECTED=OFF
- -DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF
- -DTDESKTOP_USE_PACKAGED_TGVOIP=OFF
- -DTDESKTOP_USE_FONTCONFIG_FALLBACK=ON
override-pull: |
snapcraftctl pull
@ -118,10 +119,6 @@ parts:
snapcraftctl set-version "$version"
sed -i 's|^Icon=.*|Icon=/share/icons/hicolor/512x512/apps/telegram.png|g' lib/xdg/telegramdesktop.desktop
override-build: |
snapcraftctl build
mkdir -p "$SNAPCRAFT_PART_INSTALL/etc/fonts"
cp "$SNAPCRAFT_PART_SRC/Telegram/lib_ui/qt_conf/fc-custom.conf" "$SNAPCRAFT_PART_INSTALL/etc/fonts/fonts.conf"
after:
- cmake
- desktop-qt5
@ -159,13 +156,11 @@ parts:
- locales-all
- xdg-user-dirs
- fcitx-frontend-qt5
stage: [-etc/fonts/fonts.conf]
qt5-gtk-platform:
plugin: nil
stage-packages:
- qt5-gtk-platformtheme
stage: [-etc/fonts/fonts.conf]
cmake:
source: "https://gitlab.kitware.com/cmake/cmake.git"