From e320be96262344bc02efba13433de58691e302b7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 19 Jul 2016 21:09:34 +0300 Subject: [PATCH] Fixed build for QtCreator and Ubuntu. --- .travis/build.sh | 4 +++- Telegram/SourceFiles/platform/linux/linux_libs.h | 2 +- .../platform/linux/main_window_linux.cpp | 4 ++-- Telegram/Telegram.pro | 14 +++++++++++--- Telegram/build/makefile_static.sh | 2 +- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.travis/build.sh b/.travis/build.sh index a047817033..899316f664 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -141,6 +141,8 @@ build() { # Patch tdesktop sed -i 's/CUSTOM_API_ID//g' "$UPSTREAM/Telegram/Telegram.pro" + sed -i 's,LIBS += /usr/local/lib/libxkbcommon.a,,g" "$UPSTREAM/Telegram/Telegram.pro" + sed -i 's,#xkbcommon,xkbcommon,g" "$UPSTREAM/Telegram/Telegram.pro" sed -i "s,\..*/Libraries/breakpad/,$BREAKPAD_PATH/,g" "$UPSTREAM/Telegram/Telegram.pro" local options="" @@ -321,4 +323,4 @@ check() { source ./.travis/common.sh -run \ No newline at end of file +run diff --git a/Telegram/SourceFiles/platform/linux/linux_libs.h b/Telegram/SourceFiles/platform/linux/linux_libs.h index d51db1c677..6fd9a802f3 100644 --- a/Telegram/SourceFiles/platform/linux/linux_libs.h +++ b/Telegram/SourceFiles/platform/linux/linux_libs.h @@ -227,7 +227,7 @@ inline GtkWindow *gtk_window_cast(Object *obj) { return g_type_cic_helper(obj, gtk_window_get_type()); } -typedef gboolean (*f_g_type_check_instance_is_a)(GTypeInstance *instance, GType iface_type) G_GNUC_PURE; +typedef gboolean (*f_g_type_check_instance_is_a)(GTypeInstance *instance, GType iface_type); extern f_g_type_check_instance_is_a g_type_check_instance_is_a; template diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 5fe26b0fad..2647ea36e6 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -360,8 +360,8 @@ void MainWindow::psUpdateCounter() { bool muted = App::histories().unreadOnlyMuted(); style::color bg = muted ? st::counterMuteBG : st::counterBG; - icon.addPixmap(App::pixmapFromImageInPlace(iconWithCounter(16, counter, bg, true), Qt::ColorOnly)); - icon.addPixmap(App::pixmapFromImageInPlace(iconWithCounter(32, counter, bg, true), Qt::ColorOnly)); + icon.addPixmap(App::pixmapFromImageInPlace(iconWithCounter(16, counter, bg, true))); + icon.addPixmap(App::pixmapFromImageInPlace(iconWithCounter(32, counter, bg, true))); } trayIcon->setIcon(icon); } diff --git a/Telegram/Telegram.pro b/Telegram/Telegram.pro index 7e1fbb32fb..4fe6d5d377 100644 --- a/Telegram/Telegram.pro +++ b/Telegram/Telegram.pro @@ -111,7 +111,6 @@ SOURCES += \ ./SourceFiles/apiwrap.cpp \ ./SourceFiles/app.cpp \ ./SourceFiles/application.cpp \ - ./SourceFiles/audio.cpp \ ./SourceFiles/autoupdater.cpp \ ./SourceFiles/dialogswidget.cpp \ ./SourceFiles/dropdown.cpp \ @@ -280,7 +279,6 @@ HEADERS += \ ./SourceFiles/apiwrap.h \ ./SourceFiles/app.h \ ./SourceFiles/application.h \ - ./SourceFiles/audio.h \ ./SourceFiles/autoupdater.h \ ./SourceFiles/config.h \ ./SourceFiles/countries.h \ @@ -534,7 +532,11 @@ PKGCONFIG += \ x11\ xi\ xext\ - xkbcommon\ +# In order to work libxkbcommon must be linked statically, +# PKGCONFIG links it like "-L/usr/local/lib -lxkbcommon" +# which makes a dynamic link which leads to segfault in +# QApplication() -> createPlatformIntegration -> QXcbIntegrationPlugin::create + #xkbcommon\ openal\ libavformat\ libavcodec\ @@ -556,6 +558,12 @@ LIBS += $${QT_TDESKTOP_PATH}/plugins/platforminputcontexts/libcomposeplatforminp LIBS += ./../../../Libraries/breakpad/src/client/linux/libbreakpad_client.a +# In order to work libxkbcommon must be linked statically, +# PKGCONFIG links it like "-L/usr/local/lib -lxkbcommon" +# which makes a dynamic link which leads to segfault in +# QApplication() -> createPlatformIntegration -> QXcbIntegrationPlugin::create +LIBS += /usr/local/lib/libxkbcommon.a + RESOURCES += \ ./Resources/telegram.qrc \ ./Resources/telegram_linux.qrc \ diff --git a/Telegram/build/makefile_static.sh b/Telegram/build/makefile_static.sh index e855ce828a..da1c19c1a6 100755 --- a/Telegram/build/makefile_static.sh +++ b/Telegram/build/makefile_static.sh @@ -58,7 +58,6 @@ Replace '\-lICE' "$ArchDirPath\/libICE\.a" Replace '\-lfontconfig' "$ArchDirPath\/libfontconfig\.a $ArchDirPath\/libexpat\.a" Replace '\-lfreetype' "$ArchDirPath\/libfreetype\.a" Replace '\-lXext' "$ArchDirPath\/libXext\.a" -Replace '\-lxkbcommon' "$LocalDirPath\/libxkbcommon\.a" Replace '\-lopus' "$LocalDirPath\/libopus\.a" Replace '\-lopenal' "$LocalDirPath\/libopenal\.a" Replace '\-lavformat' "$LocalDirPath\/libavformat\.a" @@ -66,4 +65,5 @@ Replace '\-lavcodec' "$LocalDirPath\/libavcodec\.a" Replace '\-lswresample' "$LocalDirPath\/libswresample\.a" Replace '\-lswscale' "$LocalDirPath\/libswscale\.a" Replace '\-lavutil' "$LocalDirPath\/libavutil\.a" +Replace '\-lva-x11' "$LocalDirPath\/libva-x11\.a" Replace '\-lva' "$LocalDirPath\/libva\.a"