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
#-------------------------------------------------
#
# Project created by QtCreator 2015-03-23T14:30:35
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets svg xml network
win32: QT += winextras
VERSION = 2.0.0
GIT_VERSION = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags)
RING_CLIENT_BUILD_DATE = $$(RING_CLIENT_BUILD_DATE)
isEmpty(RING_CLIENT_BUILD_DATE){
RING_CLIENT_BUILD_DATE = $$system(date +%Y%m%d)
}
NIGHTLY_VERSION =$$system(date +'%Y%m%d')
DEFINES += VERSION=\\\"$$VERSION\\\"
DEFINES += GIT_VERSION=\\\"$$GIT_VERSION\\\"
DEFINES += NIGHTLY_VERSION=\\\"$$NIGHTLY_VERSION\\\"
DEFINES += RING_CLIENT_BUILD_DATE=\"\\\"$$RING_CLIENT_BUILD_DATE\\\"\"
DEFINES += LRC_IMPORT
BUILD=$${BUILD}
TARGET = Jami
TEMPLATE = app
QMAKE_CXXFLAGS += -std=c++14
contains(BUILD, Debug) {
QMAKE_STRIP = echo
CONFIG += console
}
isEmpty(QMAKE_LRELEASE) {
QMAKE_LRELEASE = lrelease
}
SOURCES += main.cpp\
mainwindow.cpp \
callwidget.cpp \
configurationwidget.cpp \
navwidget.cpp \
accountdetails.cpp \
aboutdialog.cpp \
videowidget.cpp \
utils.cpp \
wizarddialog.cpp \
windowscontactbackend.cpp \
selectareadialog.cpp \
accountserializationadapter.cpp \
accountstatedelegate.cpp \
videoview.cpp \
videooverlay.cpp \
contactpicker.cpp \
globalsystemtray.cpp \
conversationitemdelegate.cpp \
conversationsfilterwidget.cpp \
callutilsdialog.cpp \
idlabel.cpp \
ringcontactlineedit.cpp \
pixbufmanipulator.cpp \
qualitydialog.cpp \
ringbutton.cpp \
photoboothdialog.cpp \
sendcontactrequestwidget.cpp \
contactrequestwidget.cpp \
smartlistselectorbuttonnotifier.cpp \
deleteaccountdialog.cpp \
bannedcontactswidget.cpp \
photoboothwidget.cpp \
smartlistmodel.cpp \
smartlistview.cpp \
accountitemdelegate.cpp \
accountlistmodel.cpp \
invitebuttonswidget.cpp \
wizardwidget.cpp \
currentaccountcombobox.cpp \
messagewebpage.cpp \
messagewebview.cpp \
webchathelpers.cpp \
animationhelpers.cpp \
settingsitemwidget.cpp
HEADERS += mainwindow.h \
callwidget.h \
configurationwidget.h \
navwidget.h \
accountdetails.h \
aboutdialog.h \
videowidget.h \
utils.h \
wizarddialog.h \
windowscontactbackend.h \
selectareadialog.h \
accountserializationadapter.h \
accountstatedelegate.h \
videoview.h \
videooverlay.h \
contactpicker.h \
settingskey.h \
globalsystemtray.h \
conversationitemdelegate.h \
conversationsfilterwidget.h \
callutilsdialog.h \
idlabel.h \
ringcontactlineedit.h \
pixbufmanipulator.h \
qualitydialog.h \
ringthemeutils.h \
ringbutton.h \
photoboothdialog.h \
sendcontactrequestwidget.h \
contactrequestwidget.h \
smartlistselectorbuttonnotifier.h \
deleteaccountdialog.h \
bannedcontactswidget.h \
photoboothwidget.h \
lrcinstance.h \
smartlistmodel.h \
smartlistview.h \
accountitemdelegate.h \
accountlistmodel.h \
invitebuttonswidget.h \
wizardwidget.h \
currentaccountcombobox.h \
messagewebpage.h \
messagewebview.h \
webchathelpers.h \
animationhelpers.h \
settingsitemwidget.h
contains(DEFINES, URI_PROTOCOL) {
HEADERS += shmclient.h
SOURCES += shmclient.cpp
}
FORMS += mainwindow.ui \
callwidget.ui \
configurationwidget.ui \
accountdetails.ui \
aboutdialog.ui \
wizarddialog.ui \
videoview.ui \
videooverlay.ui \
contactpicker.ui \
callutilsdialog.ui \
qualitydialog.ui \
ringbutton.ui \
photoboothdialog.ui \
sendcontactrequestwidget.ui \
contactrequestwidget.ui \
deleteaccountdialog.ui \
bannedcontactswidget.ui \
photoboothwidget.ui \
invitebuttonswidget.ui \
wizardwidget.ui \
animatedoverlay.ui
win32: LIBS += -lole32 -luuid -lshlwapi -lgdi32
LIBS += -lqrencode
INCLUDEPATH += $${RING}/include/libringclient
INCLUDEPATH += $${RING}/include
LIBS += -L$${RING}/lib -lringclient
RESOURCES += \
ressources.qrc
RC_FILE = ico.rc
TRANSLATIONS = \
translations/ring_client_windows_nb.ts \
translations/ring_client_windows_pa.ts \
translations/ring_client_windows_pt_BR.ts \
translations/ring_client_windows_pt.ts \
translations/ring_client_windows_ms.ts \
translations/ring_client_windows_de.ts \
translations/ring_client_windows_uk.ts \
translations/ring_client_windows_sq_AL.ts \
translations/ring_client_windows_ca.ts \
translations/ring_client_windows_es.ts \
translations/ring_client_windows_da_DK.ts \
translations/ring_client_windows_et_EE.ts \
translations/ring_client_windows_de_DE.ts \
translations/ring_client_windows_lt.ts \
translations/ring_client_windows_fr_FR.ts \
translations/ring_client_windows_nl_BE.ts \
translations/ring_client_windows_he.ts \
translations/ring_client_windows_sk_SK.ts \
translations/ring_client_windows_pl.ts \
translations/ring_client_windows_es_AR.ts \
translations/ring_client_windows_nl.ts \
translations/ring_client_windows_it_IT.ts \
translations/ring_client_windows_bg.ts \
translations/ring_client_windows_pt_PT.ts \
translations/ring_client_windows_id.ts \
translations/ring_client_windows_en_GB.ts \
translations/ring_client_windows_pl_PL.ts \
translations/ring_client_windows.ts \
translations/ring_client_windows_eu.ts \
translations/ring_client_windows_eo.ts \
translations/ring_client_windows_nl_NL.ts \
translations/ring_client_windows_ru_RU.ts \
translations/ring_client_windows_hr.ts \
translations/ring_client_windows_da.ts \
translations/ring_client_windows_zh_CN.ts \
translations/ring_client_windows_fr.ts \
translations/ring_client_windows_tr.ts \
translations/ring_client_windows_cs_CZ.ts \
translations/ring_client_windows_zh_TW.ts \
translations/ring_client_windows_fr_CA.ts \
translations/ring_client_windows_ko_KR.ts \
translations/ring_client_windows_zh.ts \
translations/ring_client_windows_fa_IR.ts \
translations/ring_client_windows_fi.ts \
translations/ring_client_windows_sv.ts \
translations/ring_client_windows_it.ts \
translations/ring_client_windows_el.ts \
translations/ring_client_windows_ja.ts \
translations/ring_client_windows_hu.ts \
translations/ring_client_windows_sl.ts \
translations/ring_client_windows_hi_IN.ts \
translations/ring_client_windows_ro.ts \
translations/ring_client_windows_ru.ts \
translations/ring_client_windows_ar.ts \
maketranslationdir.target = customtarget
maketranslationdir.commands = $(MKDIR) $$OUT_PWD/share/ring/translations/
updateqm.input = TRANSLATIONS
updateqm.output = $$OUT_PWD/release/share/ring/translations/${QMAKE_FILE_BASE}.qm
updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $$OUT_PWD/release/share/ring/translations/${QMAKE_FILE_BASE}.qm
updateqm.CONFIG += no_link
QMAKE_EXTRA_TARGETS += maketranslationdir
QMAKE_EXTRA_COMPILERS += updateqm
PRE_TARGETDEPS += customtarget compiler_updateqm_make_all
QM_FILES.files = share
QM_FILES.path = $$OUT_PWD/release
INSTALLS += QM_FILES
DISTFILES += \
License.rtf \
ring.nsi
win32 {
RINGTONES.files = $${RING}/share/ring/ringtones
RINGTONES.path = $$OUT_PWD/release
PACKAGING.files = ring.nsi images/jami.ico
PACKAGING.path = $$OUT_PWD/release
LICENSE.files = License.rtf
LICENSE.path = $$OUT_PWD/release
RUNTIMEDIR=$$[QT_INSTALL_BINS]
RUNTIME.files = $${RING}/bin/libring.dll $${RING}/bin/libringclient.dll $${RING}/bin/libqrencode.dll
RUNTIME.path = $$OUT_PWD/release
LRC_TRANSLATION.files = $${RING}/share/libringclient/translations
LRC_TRANSLATION.path = $$OUT_PWD/release/share/libringclient/
QTRUNTIME.files = $$RUNTIMEDIR/Qt5Core.dll $$RUNTIMEDIR/Qt5Widgets.dll \
$$RUNTIMEDIR/Qt5Gui.dll $$RUNTIMEDIR/Qt5Svg.dll \
$$RUNTIMEDIR/Qt5Xml.dll $$RUNTIMEDIR/Qt5WinExtras.dll \
$$RUNTIMEDIR/Qt5Network.dll $$RUNTIMEDIR/Qt5Sql.dll \
$$RUNTIMEDIR/Qt5WebEngineWidgets.dll $$RUNTIMEDIR/Qt5WebChannel.dll
QTRUNTIME.path = $$OUT_PWD/release
QTDEPSRUNTIME.files = $$RUNTIMEDIR/zlib1.dll \
$$RUNTIMEDIR/libfreetype-6.dll $$RUNTIMEDIR/libglib-2.0-0.dll \
$$RUNTIMEDIR/libharfbuzz-0.dll \
$$RUNTIMEDIR/libintl-8.dll $$RUNTIMEDIR/libpcre-1.dll \
$$RUNTIMEDIR/libpcre2-16-0.dll $$RUNTIMEDIR/libpng16-16.dll \
$$RUNTIMEDIR/libjpeg-62.dll $$RUNTIMEDIR/iconv.dll \
$$RUNTIMEDIR/libidn-11.dll $$RUNTIMEDIR/liblzma-5.dll \
$$RUNTIMEDIR/libGLESv2.dll $$RUNTIMEDIR/libbz2-1.dll \
$$RUNTIMEDIR/libsqlite3-0.dll
QTDEPSRUNTIME.path = $$OUT_PWD/release
QTPLATFORMS.files = $$[QT_INSTALL_PLUGINS]/platforms/qwindows.dll
QTPLATFORMS.path = $$OUT_PWD/release/platforms
QTPLUGINIMAGE.files = $$[QT_INSTALL_PLUGINS]/imageformats/
QTPLUGINIMAGE.path = $$OUT_PWD/release
QTSQLDRIVERS.files = $$[QT_INSTALL_PLUGINS]/sqldrivers/qsqlite.dll
QTSQLDRIVERS.path = $$OUT_PWD/release/sqldrivers
LIBSTD.files = $$RUNTIMEDIR/libgcc_s_sjlj-1.dll $$RUNTIMEDIR/libstdc++-6.dll \
$$RUNTIMEDIR/libwinpthread-1.dll $$RUNTIMEDIR/libgcc_s_seh-1.dll
LIBSTD.path = $$OUT_PWD/release
INSTALLS += RINGTONES PACKAGING LICENSE RUNTIME LRC_TRANSLATION QTRUNTIME QTDEPSRUNTIME \
QTPLUGINIMAGE QTPLATFORMS QTSQLDRIVERS LIBSTD
DEFINES += ENABLE_AUTOUPDATE
LIBS += -L$${RING}/lib -lWinSparkle
WINSPARKLE.files = $${RING}/bin/WinSparkle.dll $${RING}/bin/libringclient.dll
WINSPARKLE.path = $$OUT_PWD/release
INSTALLS += WINSPARKLE
message("AUTO UPDATES enabled")
}
......@@ -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[])