diff --git a/.github/workflows/appimage-release.yml b/.github/workflows/appimage-release.yml index aa5ebf803..92769706d 100644 --- a/.github/workflows/appimage-release.yml +++ b/.github/workflows/appimage-release.yml @@ -22,6 +22,7 @@ jobs: MANUAL_CACHING: "1" DOC_PATH: "docs/building-cmake.md" AUTO_CACHING: "1" + CXX: "g++ -static-libstdc++" steps: - name: Get repository name. @@ -124,7 +125,7 @@ jobs: path: ${{ env.LibrariesPath }}/python-cache key: ${{ runner.OS }}-python-${{ env.CACHE_KEY }} - name: Python 3.8 build. - if: steps.python-openssl.outputs.cache-hit != 'true' + if: steps.cache-python.outputs.cache-hit != 'true' run: | cd $LibrariesPath @@ -160,7 +161,7 @@ jobs: git clone -b v5.69.0 --depth=1 $GIT/KDE/extra-cmake-modules.git cd extra-cmake-modules cmake . -DCMAKE_BUILD_TYPE=Release - cmake --build . + cmake --build . -- -j$(nproc) sudo cmake --install . cd .. rm -rf extra-cmake-modules @@ -210,7 +211,7 @@ jobs: -DRANGE_V3_EXAMPLES=OFF \ -DRANGE_V3_DOCS=OFF - cmake --build . + cmake --build . -- -j$(nproc) sudo cmake --install . cd .. @@ -224,7 +225,7 @@ jobs: cd zlib/contrib/minizip autoreconf -i ./configure - make + make -j$(nproc) sudo make install cd ../../.. rm -rf zlib @@ -410,7 +411,7 @@ jobs: -DALSOFT_UTILS=OFF \ -DALSOFT_CONFIG=OFF - cmake --build . + cmake --build . -- -j$(nproc) sudo cmake --install . sudo ldconfig @@ -424,8 +425,9 @@ jobs: git clone -b v1.7.0 --depth=1 $GIT/hunspell/hunspell.git cd hunspell autoreconf -vfi - ./configure - make + # unable to link libstdc++ statically, thanks to autoconf + ./configure --disable-shared + make -j$(nproc) sudo make install sudo ldconfig cd .. @@ -504,6 +506,8 @@ jobs: -qt-xcb \ -openssl-linked \ OPENSSL_LIBS="-L/usr/local/lib -lssl -lcrypto" \ + QMAKE_CXX="$CXX" \ + QMAKE_LINK="$CXX" \ -nomake examples \ -nomake tests @@ -539,7 +543,7 @@ jobs: cmake . \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_LIBRARY=OFF - cmake --build . + cmake --build . -- -j$(nproc) sudo install -D platforminputcontext/libfcitxplatforminputcontextplugin.so /usr/local/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so cd .. rm -rf fcitx-qt5 @@ -564,7 +568,7 @@ jobs: --disable-appindicator \ --disable-lib64 \ --qt5-im-module-path=/usr/local/plugins/platforminputcontexts - make + make -j$(nproc) sudo make install cd .. rm -rf hime @@ -598,7 +602,7 @@ jobs: cmake . \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_DOC=OFF - cmake --build . + cmake --build . -- -j$(nproc) sudo cmake --install . sudo ldconfig cd .. @@ -625,7 +629,7 @@ jobs: -DTDESKTOP_USE_PACKAGED_TGVOIP=OFF cd ../out/Release - cmake --build . + cmake --build . -- -j$(nproc) DESTDIR=../../AppDir cmake --install . - name: AppImageKit-checkrt build. @@ -648,7 +652,6 @@ jobs: # Workaround to increase compatibility with older systems; see https://github.com/darealshinji/AppImageKit-checkrt for details install -D $LibrariesPath/AppImageKit-checkrt/exec.so AppDir/usr/optional/exec.so install -D $LibrariesPath/AppImageKit-checkrt/AppRun_patched AppDir/AppRun - install -D /usr/lib/x86_64-linux-gnu/libstdc++.so.6 AppDir/usr/optional/libstdc++/libstdc++.so.6 ../linuxdeployqt-continuous-x86_64.AppImage \ AppDir/usr/share/applications/*.desktop \ diff --git a/.github/workflows/appimage.yml b/.github/workflows/appimage.yml index 28a96478f..49e0fab8e 100644 --- a/.github/workflows/appimage.yml +++ b/.github/workflows/appimage.yml @@ -37,6 +37,7 @@ jobs: MANUAL_CACHING: "1" DOC_PATH: "docs/building-cmake.md" AUTO_CACHING: "1" + CXX: "g++ -static-libstdc++" steps: - name: Get repository name. @@ -139,7 +140,7 @@ jobs: path: ${{ env.LibrariesPath }}/python-cache key: ${{ runner.OS }}-python-${{ env.CACHE_KEY }} - name: Python 3.8 build. - if: steps.python-openssl.outputs.cache-hit != 'true' + if: steps.cache-python.outputs.cache-hit != 'true' run: | cd $LibrariesPath @@ -175,7 +176,7 @@ jobs: git clone -b v5.69.0 --depth=1 $GIT/KDE/extra-cmake-modules.git cd extra-cmake-modules cmake . -DCMAKE_BUILD_TYPE=Release - cmake --build . + cmake --build . -- -j$(nproc) sudo cmake --install . cd .. rm -rf extra-cmake-modules @@ -225,7 +226,7 @@ jobs: -DRANGE_V3_EXAMPLES=OFF \ -DRANGE_V3_DOCS=OFF - cmake --build . + cmake --build . -- -j$(nproc) sudo cmake --install . cd .. @@ -239,7 +240,7 @@ jobs: cd zlib/contrib/minizip autoreconf -i ./configure - make + make -j$(nproc) sudo make install cd ../../.. rm -rf zlib @@ -425,7 +426,7 @@ jobs: -DALSOFT_UTILS=OFF \ -DALSOFT_CONFIG=OFF - cmake --build . + cmake --build . -- -j$(nproc) sudo cmake --install . sudo ldconfig @@ -439,8 +440,9 @@ jobs: git clone -b v1.7.0 --depth=1 $GIT/hunspell/hunspell.git cd hunspell autoreconf -vfi - ./configure - make + # unable to link libstdc++ statically, thanks to autoconf + ./configure --disable-shared + make -j$(nproc) sudo make install sudo ldconfig cd .. @@ -519,6 +521,8 @@ jobs: -qt-xcb \ -openssl-linked \ OPENSSL_LIBS="-L/usr/local/lib -lssl -lcrypto" \ + QMAKE_CXX="$CXX" \ + QMAKE_LINK="$CXX" \ -nomake examples \ -nomake tests @@ -554,7 +558,7 @@ jobs: cmake . \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_LIBRARY=OFF - cmake --build . + cmake --build . -- -j$(nproc) sudo install -D platforminputcontext/libfcitxplatforminputcontextplugin.so /usr/local/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so cd .. rm -rf fcitx-qt5 @@ -579,7 +583,7 @@ jobs: --disable-appindicator \ --disable-lib64 \ --qt5-im-module-path=/usr/local/plugins/platforminputcontexts - make + make -j$(nproc) sudo make install cd .. rm -rf hime @@ -613,7 +617,7 @@ jobs: cmake . \ -DCMAKE_BUILD_TYPE=Release \ -DWITH_DOC=OFF - cmake --build . + cmake --build . -- -j$(nproc) sudo cmake --install . sudo ldconfig cd .. @@ -638,7 +642,7 @@ jobs: -DTDESKTOP_USE_PACKAGED_TGVOIP=OFF cd ../out/Release - cmake --build . + cmake --build . -- -j$(nproc) DESTDIR=../../AppDir cmake --install . - name: AppImageKit-checkrt build. @@ -661,7 +665,6 @@ jobs: # Workaround to increase compatibility with older systems; see https://github.com/darealshinji/AppImageKit-checkrt for details install -D $LibrariesPath/AppImageKit-checkrt/exec.so AppDir/usr/optional/exec.so install -D $LibrariesPath/AppImageKit-checkrt/AppRun_patched AppDir/AppRun - install -D /usr/lib/x86_64-linux-gnu/libstdc++.so.6 AppDir/usr/optional/libstdc++/libstdc++.so.6 ../linuxdeployqt-continuous-x86_64.AppImage \ AppDir/usr/share/applications/*.desktop \ diff --git a/Telegram/Patches/AppImageKit-checkrt.diff b/Telegram/Patches/AppImageKit-checkrt.diff index 58fdcd1cb..8c293cb2b 100644 --- a/Telegram/Patches/AppImageKit-checkrt.diff +++ b/Telegram/Patches/AppImageKit-checkrt.diff @@ -263,19 +263,6 @@ index cd8fe34..dab0cff 100644 + wget -c "https://raw.githubusercontent.com/AppImage/AppImageKit/master/src/AppRun.c" .PHONY: checkrt test run_tests all clean -diff --git a/checkrt.c b/checkrt.c -index 7607d61..f5a187f 100644 ---- a/checkrt.c -+++ b/checkrt.c -@@ -72,7 +72,7 @@ void checkrt(char *usr_in_appdir) - SCANLIB(stdcxx_sys_lib, stdcxx_sys_sym, "^GLIBCXX_3\\.4"); - SCANLIB(stdcxx_bundle_lib, stdcxx_bundle_sym, "^GLIBCXX_3\\.4"); - stdcxx_sys_ver = atoi(stdcxx_sys_sym+12); -- stdcxx_bundle_ver = atoi(stdcxx_bundle_sym+12); -+ stdcxx_bundle_ver = 21; - DEBUG("%s ==> %s (%d)\n", stdcxx_sys_lib, stdcxx_sys_sym, stdcxx_sys_ver); - DEBUG("%s ==> %s (%d)\n\n", stdcxx_bundle_lib, stdcxx_bundle_sym, stdcxx_bundle_ver); - } diff --git a/env.c b/env.c index 6776bff..9c1d476 100755 --- a/env.c diff --git a/Telegram/Patches/qtbase_5_12_8_appimage.diff b/Telegram/Patches/qtbase_5_12_8_appimage.diff index 39c8e3ec9..89add7fad 100644 --- a/Telegram/Patches/qtbase_5_12_8_appimage.diff +++ b/Telegram/Patches/qtbase_5_12_8_appimage.diff @@ -12,32 +12,6 @@ index 266faca0ed..cf9dafb6d8 100644 void *poolFrame = nullptr; if (__builtin_available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 5.0, *)) { void *frame; -diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp -index 5014878bd2..0e05e0f5b9 100644 ---- a/src/gui/kernel/qguiapplication.cpp -+++ b/src/gui/kernel/qguiapplication.cpp -@@ -50,6 +50,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -268,7 +269,12 @@ static void initThemeHints() - static bool checkNeedPortalSupport() - { - #if QT_CONFIG(dbus) -- return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty() || qEnvironmentVariableIsSet("SNAP"); -+ bool neededByDesktopEnvironment = false; -+ if (QGuiApplication::desktopSettingsAware()) { -+ const QByteArray desktopEnvironment = QGuiApplicationPrivate::platformIntegration()->services()->desktopEnvironment(); -+ neededByDesktopEnvironment = (desktopEnvironment == "KDE"); -+ } -+ return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty() || qEnvironmentVariableIsSet("SNAP") || neededByDesktopEnvironment; - #else - return false; - #endif // QT_CONFIG(dbus) diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index 48060a2c37..fff3271ec9 100644 --- a/src/gui/kernel/qstylehints.cpp @@ -1018,7 +992,7 @@ index 077955eb4e..5c8a3dddf7 100644 case FontDialog: return new QGtk3FontDialogHelper; diff --git a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp -index fb65f6d909..f2e53ed851 100644 +index fb65f6d909..66c3a54a07 100644 --- a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp +++ b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportaltheme.cpp @@ -57,9 +57,11 @@ public: @@ -1033,14 +1007,19 @@ index fb65f6d909..f2e53ed851 100644 }; QXdgDesktopPortalTheme::QXdgDesktopPortalTheme() -@@ -90,6 +92,12 @@ QXdgDesktopPortalTheme::QXdgDesktopPortalTheme() +@@ -85,11 +87,17 @@ QXdgDesktopPortalTheme::QXdgDesktopPortalTheme() + break; + } + // No error message; not having a theme plugin is allowed. ++ ++ // Try to use gtk's open directory dialog if there are no fallback theme ++ d->gtkTheme = QPlatformThemeFactory::create(QLatin1String("gtk3"), nullptr); + } + // 3) Fall back on the built-in "null" platform theme. if (!d->baseTheme) d->baseTheme = new QPlatformTheme; + -+ // Try to use gtk's open directory dialog if there are no fallback theme -+ d->gtkTheme = QPlatformThemeFactory::create(QLatin1String("gtk3"), nullptr); -+ + if (!d->gtkTheme) + d->gtkTheme = new QPlatformTheme; } diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index c4319da1a..066540b21 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -608,6 +608,10 @@ namespace Platform { void start() { LOG(("Launcher filename: %1").arg(GetLauncherFilename())); + if (InAppImage()) { + qputenv("LIBGL_ALWAYS_INDIRECT", "1"); + } + #ifdef TDESKTOP_USE_FONTCONFIG_FALLBACK FallbackFontConfig(); #endif // TDESKTOP_USE_FONTCONFIG_FALLBACK