fixed linux launch with static linking

This commit is contained in:
John Preston 2016-02-05 17:32:19 +03:00
parent 6e8fc37ca9
commit 759ede3c57
5 changed files with 143 additions and 176 deletions

View File

@ -48,21 +48,6 @@ The source code is published under GPLv3 with OpenSSL exception, the license is
Compiles given files to single update file, compresses it with lzma and signs with a private key. It is not built in **Debug** and **Release** configurations of Telegram solution, because private key is inaccessible.
* ### Prepare
Prepares a release for deployment, puts all current files to deploy/{version} folder.
**Windows**:
* tsetup{version}.exe installer
* Telegram.exe
* Telegram.pdb (debug info for crash minidumps view)
* tupdate{updversion} binary lzma update archive
**Mac**:
* tsetup{version}.dmg
* Telegram.app
* tmacupd{updversion} binary lzma update archive
* ### MetaEmoji
Creates four sprites and text2emoji replace code

View File

@ -11,11 +11,9 @@ Replace () {
}
Replace '\-llzma' '\/usr\/lib\/x86_64\-linux\-gnu\/liblzma\.a'
Replace '\-lz' '\/usr\/lib\/x86_64\-linux\-gnu\/libz\.a'
Replace '\-lssl' '\/usr\/lib\/x86_64\-linux\-gnu\/libssl\.a'
Replace '\-lcrypto' '\/usr\/lib\/x86_64\-linux\-gnu\/libcrypto\.a'
Replace '\-lexif' '\/usr\/lib\/x86_64\-linux\-gnu\/libexif\.a'
Replace '\-lgobject\-2\.0' '\/usr\/lib\/x86_64\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/x86_64\-linux\-gnu\/libffi\.a'
#Replace '\-lgobject\-2\.0' '\/usr\/lib\/x86_64\-linux\-gnu\/libgobject\-2\.0\.a \/usr\/lib\/x86_64\-linux\-gnu\/libffi\.a'
Replace '\-lXi' '\/usr\/lib\/x86_64\-linux\-gnu\/libXi\.a'
Replace '\-lSM' '\/usr\/lib\/x86_64\-linux\-gnu\/libSM\.a'
Replace '\-lICE' '\/usr\/lib\/x86_64\-linux\-gnu\/libICE\.a'

View File

@ -25,8 +25,9 @@ Copyright (c) 2014-2015 John Preston, https://desktop.telegram.org
#include "application.h"
#include "fileuploader.h"
#include "mainwidget.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
#include <libexif/exif-data.h>
#endif
#include "localstorage.h"
#include "numbers.h"

View File

@ -346,25 +346,6 @@ namespace {
return FALSE;
}
class _PsInitializer {
public:
_PsInitializer() {
static bool inited = false;
if (inited) return;
inited = true;
QString cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower();
noQtTrayIcon = (cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome"));
tryAppIndicator = (cdesktop == qstr("xfce"));
noTryUnity = (cdesktop != qstr("unity"));
if (noQtTrayIcon) cSetSupportTray(false);
DEBUG_LOG(("Loading libraries"));
setupGtk();
setupUnity();
}
bool loadLibrary(QLibrary &lib, const char *name, int version) {
DEBUG_LOG(("Loading '%1' with version %2..").arg(QLatin1String(name)).arg(version));
lib.setFileNameAndVersion(QLatin1String(name), version);
@ -401,8 +382,13 @@ namespace {
if (!loadFunction(lib_gtk, "g_object_ref_sink", ps_g_object_ref_sink)) return;
if (!loadFunction(lib_gtk, "g_object_unref", ps_g_object_unref)) return;
useGtkBase = true;
DEBUG_LOG(("Library gtk functions loaded!"));
if (ps_gtk_init_check(0, 0)) {
DEBUG_LOG(("Checked gtk with gtk_init_check!"));
useGtkBase = true;
} else {
DEBUG_LOG(("Failed to gtk_init_check(0, 0)!"));
}
}
void setupAppIndicator(QLibrary &lib_indicator) {
@ -495,7 +481,6 @@ namespace {
useUnityCount = true;
DEBUG_LOG(("Unity count api loaded!"));
}
};
class _PsEventFilter : public QAbstractNativeEventFilter {
public:
@ -516,8 +501,6 @@ namespace {
PsMainWindow::PsMainWindow(QWidget *parent) : QMainWindow(parent),
posInited(false), trayIcon(0), trayIconMenu(0), icon256(qsl(":/gui/art/icon256.png")), iconbig256(icon256), wndIcon(QIcon::fromTheme("telegram", QIcon(QPixmap::fromImage(icon256, Qt::ColorOnly)))), _psCheckStatusIconLeft(100), _psLastIndicatorUpdate(0) {
_PsInitializer initializer;
connect(&_psCheckStatusIconTimer, SIGNAL(timeout()), this, SLOT(psStatusIconCheck()));
_psCheckStatusIconTimer.setSingleShot(false);
@ -770,20 +753,13 @@ void PsMainWindow::psCreateTrayIcon() {
if (!noQtTrayIcon) {
cSetSupportTray(QSystemTrayIcon::isSystemTrayAvailable());
if (!noTryUnity) {
if (ps_gtk_init_check(0, 0)) {
DEBUG_LOG(("Checked gtk with gtk_init_check!"));
} else {
DEBUG_LOG(("Failed to gtk_init_check(0, 0)!"));
useUnityCount = false;
}
}
return;
}
if (useAppIndicator) {
DEBUG_LOG(("Trying to create AppIndicator"));
if (ps_gtk_init_check(0, 0)) {
DEBUG_LOG(("Checked gtk with gtk_init_check!"));
_trayMenu = ps_gtk_menu_new();
if (_trayMenu) {
DEBUG_LOG(("Created gtk menu for appindicator!"));
@ -803,9 +779,6 @@ void PsMainWindow::psCreateTrayIcon() {
} else {
DEBUG_LOG(("Failed to gtk_menu_new()!"));
}
} else {
DEBUG_LOG(("Failed to gtk_init_check(0, 0)!"));
}
if (_trayMenu && _trayIndicator) {
ps_app_indicator_set_status(_trayIndicator, APP_INDICATOR_STATUS_ACTIVE);
ps_app_indicator_set_menu(_trayIndicator, PS_GTK_MENU(_trayMenu));
@ -816,7 +789,7 @@ void PsMainWindow::psCreateTrayIcon() {
}
}
if (useStatusIcon) {
if (ps_gtk_init_check(0, 0) && ps_gdk_init_check(0, 0)) {
if (ps_gdk_init_check(0, 0)) {
if (!_trayMenu) _trayMenu = ps_gtk_menu_new();
if (_trayMenu) {
loadPixbuf(_trayIconImageGen());
@ -1269,6 +1242,16 @@ void psShowInFolder(const QString &name) {
namespace PlatformSpecific {
Initializer::Initializer() {
QString cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower();
noQtTrayIcon = (cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome"));
tryAppIndicator = (cdesktop == qstr("xfce"));
noTryUnity = (cdesktop != qstr("unity"));
if (noQtTrayIcon) cSetSupportTray(false);
DEBUG_LOG(("Loading libraries"));
setupGtk();
setupUnity();
}
Initializer::~Initializer() {

View File

@ -318,7 +318,7 @@ INCLUDEPATH += "/usr/include/atk-1.0"
INCLUDEPATH += "/usr/include/dee-1.0"
INCLUDEPATH += "/usr/include/libdbusmenu-glib-0.4"
LIBS += -lcrypto -lssl -ldl -llzma -lexif -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus -lva
LIBS += -lcrypto -lssl -ldl -llzma -lopenal -lavformat -lavcodec -lswresample -lswscale -lavutil -lopus -lva
LIBS += ./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.a \
./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libibusplatforminputcontextplugin.a \
./../../../Libraries/QtStatic/qtbase/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.a