aboutsummaryrefslogblamecommitdiffstats
path: root/community/telegram-desktop/remove-glibc.patch
blob: 999b6a8f156218bbd95e1d74406777a098983f9b (plain) (tree)


































































                                                                                                                                  
Upstream: Unsuitable (requires re-work into something that doesn't break libc)
Reason: This is Glibc specific and treating Linux == glibc is harmful

diff --git a/Telegram/lib_base/base/platform/linux/base_info_linux.cpp b/Telegram/lib_base/base/platform/linux/base_info_linux.cpp
index ea9ab61..bbef601 100644
--- a/Telegram/lib_base/base/platform/linux/base_info_linux.cpp
+++ b/Telegram/lib_base/base/platform/linux/base_info_linux.cpp
@@ -13,7 +13,6 @@
 #include <QtCore/QVersionNumber>
 #include <QtCore/QDate>
 #include <QtGui/QGuiApplication>
-#include <gnu/libc-version.h>
 
 namespace Platform {
 namespace {
@@ -53,15 +52,6 @@ void FallbackFontConfig(
 	}
 }
 
-const std::optional<QVersionNumber> &GetLibCVersion() {
-	static const auto result = [&] {
-		const auto version = gnu_get_libc_version(); // #TODO log
-		const auto parsed = QVersionNumber::fromString(version);
-		return parsed.isNull() ? std::nullopt : std::make_optional(parsed);
-	}();
-	return result;
-}
-
 } // namespace
 
 QString DeviceModelPretty() {
@@ -84,8 +74,7 @@ QString SystemVersionPretty() {
 	return "Linux "
 		+ (list.isEmpty() ? QString() : list[0] + ' ')
 		+ (IsWayland() ? "Wayland " : "X11 ")
-		+ "glibc "
-		+ GetGlibCVersion();
+		+ "musl";
 }
 
 QString SystemCountry() {
@@ -103,10 +92,6 @@ QString SystemLanguage() {
 QDate WhenSystemBecomesOutdated() {
 	if (IsLinux32Bit()) {
 		return QDate(2020, 9, 1);
-	} else if (const auto version = GetGlibCVersion(); !version.isEmpty()) {
-		if (QVersionNumber::fromString(version) < QVersionNumber(2, 23)) {
-			return QDate(2020, 9, 1); // Older than Ubuntu 16.04.
-		}
 	}
 	return QDate();
 }
@@ -129,14 +114,6 @@ QString AutoUpdateKey() {
 	}
 }
 
-QString GetGlibCVersion() {
-	static const auto result = [&] {
-		const auto version = QString::fromLatin1(gnu_get_libc_version());
-		return QVersionNumber::fromString(version).isNull() ? QString() : version;
-	}();
-	return result;
-}
-
 bool IsWayland() {
 	return QGuiApplication::platformName().startsWith("wayland", Qt::CaseInsensitive);
 }