Commit d2e8d0eb authored by Sébastien Blin's avatar Sébastien Blin Committed by Andreas Traczyk

build: support native build on linux

Change-Id: Ia48eaaf0f08f186a29516611538dd03b2594aa6a
parent a4bf7e3e
......@@ -11,4 +11,5 @@ release/
qrencode-win32/
*.dll
.gitignore
*.qm
\ No newline at end of file
*.qm
build/
\ No newline at end of file
# Windows client for Jami
# Jami-qt
`jami-qt` is the cross platform client for Jami. For now, it's mainly used for the Windows platform and is not tested on other platforms.
![jami-logo](images/logo-jami-standard-coul.png)
For more information about the jami project, see the following:
......@@ -15,48 +20,28 @@ For more information about the jami project, see the following:
## Get the source code
- ```git clone https://gerrit-ring.savoirfairelinux.com/ring-client-windows```
- `git clone https://gerrit-ring.savoirfairelinux.com/ring-client-windows`
## Build instructions
*USE THE QMAKE OF Qt BUILT WITH MINGW* (e.g. /usr/bin/[i686 | x86_64]-w64-mingw32-qmake-qt5)
**NOTE: The build process is currently under a full refactorization. This section will be updated soon**
## Windows
TBD
### Build winsparkle
In the client directory after having initialized the submodule:
```
cd ring-client-windows
cd winsparkle
mkdir build && cd build
export QTDIR=<path to mingw qt> (e.g. /usr/[i686 | x86_64]-w64-mingw32/lib/qt)
git submodule init && git submodule update
cd libqrencode
./autogen.sh && ./configure --host=[i686 | x86_64]-w64-mingw32 --prefix=<Install dir of Jami and LRC>
make
make install
cd ..
qmake ../RingWinClient.pro -r -spec win32-g++ RING=<Install dir of Jami and LRC> [BUILD=Debug]
cmake -DCMAKE_TOOLCHAIN_FILE=<LRC Directory>/cmake/winBuild.cmake -DCMAKE_INSTALL_PREFIX=Install dir of Jami and LRC> ../cmake",
make
make install
```
You will find all files in ./release directory.
#Auto update
If you want to enable auto-update
- Build winsparkle
In the client directory after having initialized the submodule
```
cd winsparkle
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=<LRC Directory>/cmake/winBuild.cmake -DCMAKE_INSTALL_PREFIX=Install dir of Jami and LRC> ../cmake",
make
make install
```
- Compile the client with `ENABLE_AUTOUPDATE=True`
## Debugging
Compile the client with 'BUILD=Debug' and libRingClient with '-DCMAKE_BUILD_TYPE=Debug'
## Packaging
### Packaging
* Nsis : Nullsoft Scriptable Install System :http://nsis.sourceforge.net/Main_Page.
......@@ -64,3 +49,42 @@ Compile the client with 'BUILD=Debug' and libRingClient with '-DCMAKE_BUILD_TYPE
cd build/release
makensis ring.nsi
```
## Linux
For now, this process is experimental. The best way to do that is:
1. Compile the daemon and LRC as specified in these projects (see the respective repositories or https://git.jami.net/savoirfairelinux/ring-project/wikis/technical/Build-instructions).
2. Install needed dependencies (TBD):
+ For Fedora:
```bash
sudo dnf install qt5-qtsvg-devel qt5-qtwebengine-devel qt5-multimedia-devel
```
3. If you are not using the `ring-project` repository, you have to define the `LRC` environment variable to contains the install directory for `LRC`. Also, you will have to setup `LD_LIBRARY_PATH` if your install directory is a custom one.
4. Then, build the client:
```bash
mkdir build
cd build
qmake-qt5 ../jami-qt.pro
make -j 9
```
5. Then, you are finally ready to launch `jami-qt` in your `build` directory.
### Known issues
1. The build system is not straight forward
2. Video doesn't work
3. Can't maximize/minimize window
4. Crash if the daemon is not started and installed.
## Mac OS
TBD
## Debugging
Compile the client with 'BUILD=Debug' and libRingClient with '-DCMAKE_BUILD_TYPE=Debug'
\ No newline at end of file
This diff is collapsed.
......@@ -15,7 +15,6 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
#include "direct.h"
#include <QFileDialog>
#include "lrcinstance.h"
......
......@@ -32,7 +32,7 @@
#include <algorithm>
#include <memory>
#include "qrencode.h"
#include <qrencode.h>
//ERROR is defined in windows.h
#include "utils.h"
......
TEMPLATE = app
TARGET = jami-qt
QT += widgets xml multimedia multimediawidgets network webenginewidgets
isEmpty(LRC) {
LRC=../../install/lrc/
}
INCLUDEPATH += $${LRC}/include/libringclient
INCLUDEPATH += $${LRC}/include
LIBS += -L$${LRC}/lib -lringclient
LIBS += -lqrencode
# Input
HEADERS += aboutdialog.h \
bannedcontactswidget.h \
idlabel.h \
globalsystemtray.h \
selectareadialog.h \
ringcontactlineedit.h \
version.h \
windowscontactbackend.h \
smartlistview.h \
settingskey.h \
photoboothwidget.h \
navwidget.h \
videowidget.h \
videoview.h \
accountitemdelegate.h \
accountlistmodel.h \
advancedsettingswidget.h \
avatargraphicsview.h \
animationhelpers.h \
bannedlistmodel.h \
callwidget.h \
conversationitemdelegate.h \
deleteaccountdialog.h \
currentaccountcombobox.h \
conversationsfilterwidget.h \
lrcinstance.h \
linkdevwidget.h \
invitebuttonswidget.h \
messagewebview.h \
messagewebpage.h \
mainwindow.h \
photoboothdialog.h \
passworddialog.h \
newwizardwidget.h \
regnamedialog.h \
pixbufmanipulator.h \
ringbutton.h \
settingsitemwidget.h \
setavatardialog.h \
runguard.h \
ringthemeutils.h \
settingswidget.h \
smartlistselectorbuttonnotifier.h \
smartlistmodel.h \
shmclient.h \
videooverlay.h \
utils.h \
webchathelpers.h
FORMS += contactdialog.ui \
videoview.ui \
animatedoverlay.ui \
bannedcontactswidget.ui \
ringbutton.ui \
deviceeditwidget.ui \
invitebuttonswidget.ui \
photoboothdialog.ui \
passworddialog.ui \
setavatardialog.ui \
deleteaccountdialog.ui \
aboutdialog.ui \
accountdetails.ui \
mainwindow.ui \
linkdevwidget.ui \
photoboothwidget.ui \
newwizardwidget.ui \
regnamedialog.ui \
advancedsettingswidget.ui \
callwidget.ui \
settingswidget.ui \
videooverlay.ui
SOURCES += aboutdialog.cpp \
bannedcontactswidget.cpp \
idlabel.cpp \
globalsystemtray.cpp \
pixbufmanipulator.cpp \
navwidget.cpp \
ringcontactlineedit.cpp \
smartlistview.cpp \
selectareadialog.cpp \
windowscontactbackend.cpp \
videowidget.cpp \
accountlistmodel.cpp \
accountitemdelegate.cpp \
advancedsettingswidget.cpp \
animationhelpers.cpp \
bannedlistmodel.cpp \
avatargraphicsview.cpp \
callwidget.cpp \
conversationsfilterwidget.cpp \
conversationitemdelegate.cpp \
deleteaccountdialog.cpp \
currentaccountcombobox.cpp \
main.cpp \
linkdevwidget.cpp \
invitebuttonswidget.cpp \
messagewebview.cpp \
messagewebpage.cpp \
mainwindow.cpp \
photoboothdialog.cpp \
passworddialog.cpp \
newwizardwidget.cpp \
regnamedialog.cpp \
photoboothwidget.cpp \
ringbutton.cpp \
settingsitemwidget.cpp \
setavatardialog.cpp \
runguard.cpp \
settingswidget.cpp \
smartlistselectorbuttonnotifier.cpp \
smartlistmodel.cpp \
shmclient.cpp \
videooverlay.cpp \
utils.cpp \
videoview.cpp \
webchathelpers.cpp
RESOURCES += ressources.qrc
TRANSLATIONS += translations/ring_client_windows.ts \
translations/ring_client_windows_ar.ts \
translations/ring_client_windows_bg.ts \
translations/ring_client_windows_ca.ts \
translations/ring_client_windows_cs_CZ.ts \
translations/ring_client_windows_da.ts \
translations/ring_client_windows_da_DK.ts \
translations/ring_client_windows_de.ts \
translations/ring_client_windows_de_DE.ts \
translations/ring_client_windows_el.ts \
translations/ring_client_windows_en_GB.ts \
translations/ring_client_windows_eo.ts \
translations/ring_client_windows_es.ts \
translations/ring_client_windows_es_AR.ts \
translations/ring_client_windows_et_EE.ts \
translations/ring_client_windows_eu.ts \
translations/ring_client_windows_fa_IR.ts \
translations/ring_client_windows_fi.ts \
translations/ring_client_windows_fr.ts \
translations/ring_client_windows_fr_CA.ts \
translations/ring_client_windows_fr_FR.ts \
translations/ring_client_windows_he.ts \
translations/ring_client_windows_hi_IN.ts \
translations/ring_client_windows_hr.ts \
translations/ring_client_windows_hu.ts \
translations/ring_client_windows_id.ts \
translations/ring_client_windows_it.ts \
translations/ring_client_windows_it_IT.ts \
translations/ring_client_windows_ja.ts \
translations/ring_client_windows_ko_KR.ts \
translations/ring_client_windows_lt.ts \
translations/ring_client_windows_ms.ts \
translations/ring_client_windows_nb.ts \
translations/ring_client_windows_nl.ts \
translations/ring_client_windows_nl_BE.ts \
translations/ring_client_windows_nl_NL.ts \
translations/ring_client_windows_pa.ts \
translations/ring_client_windows_pl.ts \
translations/ring_client_windows_pl_PL.ts \
translations/ring_client_windows_pt.ts \
translations/ring_client_windows_pt_BR.ts \
translations/ring_client_windows_pt_PT.ts \
translations/ring_client_windows_ro.ts \
translations/ring_client_windows_ru.ts \
translations/ring_client_windows_ru_RU.ts \
translations/ring_client_windows_sk_SK.ts \
translations/ring_client_windows_sl.ts \
translations/ring_client_windows_sq_AL.ts \
translations/ring_client_windows_sv.ts \
translations/ring_client_windows_tr.ts \
translations/ring_client_windows_uk.ts \
translations/ring_client_windows_zh.ts \
translations/ring_client_windows_zh_CN.ts \
translations/ring_client_windows_zh_TW.ts
......@@ -263,7 +263,9 @@ main(int argc, char *argv[])
auto ret = a.exec();
#ifdef Q_OS_WIN
FreeConsole();
#endif
QCoreApplication::exit();
GlobalSystemTray::instance().deleteLater();
......
......@@ -31,11 +31,11 @@
#include <windows.h>
#include <QWinThumbnailToolBar>
#include <QWinThumbnailToolButton>
#include "winsparkle.h"
#endif
#include "aboutdialog.h"
#include "settingskey.h"
#include "winsparkle.h"
#include "callmodel.h"
#include "callwidget.h"
#include "utils.h"
......@@ -102,7 +102,6 @@ MainWindow::MainWindow(QWidget* parent) :
QString aboutTitle = tr("About");
::AppendMenuW(sysMenu, MF_STRING, IDM_ABOUTBOX, aboutTitle.toStdWString().c_str());
}
#endif
win_sparkle_set_appcast_url("https://dl.ring.cx/windows/winsparkle-ring.xml");
win_sparkle_set_app_details(L"Savoir-faire Linux", L"Jami", QString(VERSION_STRING).toStdWString().c_str());
......@@ -117,6 +116,7 @@ MainWindow::MainWindow(QWidget* parent) :
QObject::connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, [=]() {
win_sparkle_cleanup();
});
#endif
setContextMenuPolicy(Qt::NoContextMenu);
......
/***************************************************************************
* Copyright (C) 2015-2017 by Savoir-faire Linux *
* Author: Anthony Léonard <anthony.leonard@savoirfairelinux.com> *
* Author: Olivier Soldano <olivier.soldano@savoirfairelinux.com> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
#include <QDebug>
#include "sendcontactrequestwidget.h"
#include "ui_sendcontactrequestwidget.h"
#include "account.h"
#include "accountmodel.h"
#include "availableaccountmodel.h"
#include "recentmodel.h"
#include "contactmethod.h"
#include "phonedirectorymodel.h"
SendContactRequestWidget::SendContactRequestWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::SendContactRequestWidget)
{
ui->setupUi(this);
ui->peerContactID->setText("ContactID"); // TODO: Display ID/Username
}
SendContactRequestWidget::~SendContactRequestWidget()
{
disconnect(sendCRClickedConnection_);
delete ui;
}
void
SendContactRequestWidget::setup(const QModelIndex& nodeIdx)
{
auto cmVector = RecentModel::instance().getContactMethods(nodeIdx);
disconnect(sendCRClickedConnection_);
QString number = cmVector[0]->uri();
ui->peerContactID->setText(number);
sendCRClickedConnection_ = connect(ui->sendContactRequestButton, &QPushButton::clicked, [this,nodeIdx]() {
sendCR(nodeIdx);
});
}
void SendContactRequestWidget::sendCR(const QModelIndex& nodeIdx)
{
auto cmVector = RecentModel::instance().getContactMethods(nodeIdx);
QString number = cmVector[0]->uri();
auto cm = PhoneDirectoryModel::instance().getNumber(number);
if(cm->account() != nullptr){
cm->account()->sendContactRequest(cm);
} else {
qDebug() << "no account linked to contact method";
auto idx = AvailableAccountModel::instance().selectionModel()->currentIndex();
if (idx.isValid()) {
cm->setAccount(idx.data(static_cast<int>(Ring::Role::Object)).value<Account*>());
cm->account()->sendContactRequest(cm);
}
}
}
......@@ -16,12 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
**************************************************************************/
#include <QtMultimedia\QCameraInfo>
#include <QtMultimedia/QCameraInfo>
#include <QFileDialog>
#include <QAbstractScrollArea>
#include <QScreen>
#include <QWindow>
#include <QtMultimedia\QCameraImageCapture>
#include <QtMultimedia/QCameraImageCapture>
#include <QBuffer>
#include <QStandardPaths>
......
......@@ -23,12 +23,12 @@
#include <QAction>
#include <QDialog>
#include <QRegion>
#include <QtMultimedia\QCamera>
#include <QtMultimedia/QCamera>
#include <QGraphicsScene>
#include <QtMultimedia\QMediaPlayer>
#include <QtMultimedia\QCameraImageCapture>
#include <QtMultimediaWidgets\QCameraViewfinder>
#include <QtMultimedia\QCameraImageCapture>
#include <QtMultimedia/QMediaPlayer>
#include <QtMultimedia/QCameraImageCapture>
#include <QtMultimediaWidgets/QCameraViewfinder>
#include <QtMultimedia/QCameraImageCapture>
#include "accountlistmodel.h"
......
......@@ -50,7 +50,9 @@
#include "video/previewmanager.h"
#include "callmodel.h"
#ifdef Q_OS_WIN
#include "winsparkle.h"
#endif
SettingsWidget::SettingsWidget(QWidget* parent)
: NavWidget(parent),
......@@ -738,8 +740,10 @@ void SettingsWidget::populateGeneralSettings()
}
ui->recordPathButton->setText(media::RecordingModel::instance().recordPath());
#ifdef Q_OS_WIN
ui->autoUpdateCheckBox->setChecked(win_sparkle_get_automatic_check_for_updates());
ui->intervalUpdateCheckSpinBox->setValue(win_sparkle_get_update_check_interval() / 86400);
#endif
}
void
......@@ -768,18 +772,23 @@ SettingsWidget::setClosedOrMinSlot(int state)
void
SettingsWidget::checkForUpdateSlot()
{
#ifdef Q_OS_WIN
win_sparkle_check_update_with_ui();
#endif
}
void
SettingsWidget::setUpdateIntervalSlot(int value)
{
#ifdef Q_OS_WIN
win_sparkle_set_update_check_interval(value * 86400);
#endif
}
void
SettingsWidget::setUpdateAutomaticSlot(int state)
{
#ifdef Q_OS_WIN
if (state == Qt::CheckState::Unchecked) {
win_sparkle_set_automatic_check_for_updates(false);
ui->intervalUpdateCheckSpinBox->setEnabled(false);
......@@ -787,6 +796,7 @@ SettingsWidget::setUpdateAutomaticSlot(int state)
win_sparkle_set_automatic_check_for_updates(true);
ui->intervalUpdateCheckSpinBox->setEnabled(true);
}
#endif
}
void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment