Skip to content

Commit

Permalink
Fixed build for QtCreator and Ubuntu.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Jul 19, 2016
1 parent fa708ad commit e320be9
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .travis/build.sh
Expand Up @@ -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=""
Expand Down Expand Up @@ -321,4 +323,4 @@ check() {

source ./.travis/common.sh

run
run
2 changes: 1 addition & 1 deletion Telegram/SourceFiles/platform/linux/linux_libs.h
Expand Up @@ -227,7 +227,7 @@ inline GtkWindow *gtk_window_cast(Object *obj) {
return g_type_cic_helper<GtkWindow, Object>(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 <typename Object>
Expand Down
4 changes: 2 additions & 2 deletions Telegram/SourceFiles/platform/linux/main_window_linux.cpp
Expand Up @@ -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);
}
Expand Down
14 changes: 11 additions & 3 deletions Telegram/Telegram.pro
Expand Up @@ -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 \
Expand Down Expand Up @@ -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 \
Expand Down Expand Up @@ -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\
Expand All @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion Telegram/build/makefile_static.sh
Expand Up @@ -58,12 +58,12 @@ 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"
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"

0 comments on commit e320be9

Please sign in to comment.