Merge PR #617: Make the webview work in the snap package

This commit is contained in:
Jenkins nymea 2021-07-07 19:03:46 +02:00
commit e4edd78662
7 changed files with 51 additions and 33 deletions

View File

@ -1,21 +0,0 @@
{
"builder": "qmake",
"kill": "nymea-app",
"build_args": "CONFIG+=ubports",
"dependencies_target": [
"libavahi-client-dev",
"libavahi-common-dev",
"libqt5charts5-dev",
"qt5-default",
"qml-module-qtcharts",
"qml-module-qt-labs-calendar",
"libconnectivity-qt1-dev",
"libunity-api-dev"
],
"install_lib": [
"/usr/lib/${ARCH_TRIPLET}/libQt5Nfc.so*"
],
"install_qml": [
"/usr/lib/${ARCH_TRIPLET}/qt5/qml/Qt/labs/calendar/"
]
}

1
clickable.json Symbolic link
View File

@ -0,0 +1 @@
packaging/ubuntu/click/clickable.json

View File

@ -6,6 +6,7 @@ TARGET=$${APPLICATION_NAME}
CONFIG += link_pkgconfig CONFIG += link_pkgconfig
QT += network qml quick quickcontrols2 svg websockets bluetooth charts gui-private nfc QT += network qml quick quickcontrols2 svg websockets bluetooth charts gui-private nfc
!ubports: QT += webview
INCLUDEPATH += $$top_srcdir/libnymea-app INCLUDEPATH += $$top_srcdir/libnymea-app
LIBS += -L$$top_builddir/libnymea-app/ -lnymea-app LIBS += -L$$top_builddir/libnymea-app/ -lnymea-app
@ -26,11 +27,9 @@ HEADERS += \
nfchelper.h \ nfchelper.h \
nfcthingactionwriter.h \ nfcthingactionwriter.h \
platformintegration/generic/screenhelper.h \ platformintegration/generic/screenhelper.h \
platformintegration/ubports/platformhelperubports.h \
stylecontroller.h \ stylecontroller.h \
pushnotifications.h \ pushnotifications.h \
platformhelper.h \ platformhelper.h \
platformintegration/generic/platformhelpergeneric.h \
ruletemplates/messages.h ruletemplates/messages.h
SOURCES += main.cpp \ SOURCES += main.cpp \
@ -40,18 +39,22 @@ SOURCES += main.cpp \
mouseobserver.cpp \ mouseobserver.cpp \
nfchelper.cpp \ nfchelper.cpp \
nfcthingactionwriter.cpp \ nfcthingactionwriter.cpp \
platformintegration/generic/screenhelper.cpp \
platformintegration/ubports/platformhelperubports.cpp \
stylecontroller.cpp \ stylecontroller.cpp \
pushnotifications.cpp \ pushnotifications.cpp \
platformhelper.cpp \ platformhelper.cpp \
platformintegration/generic/platformhelpergeneric.cpp \ platformintegration/generic/screenhelper.cpp
RESOURCES += resources.qrc \ RESOURCES += resources.qrc \
ruletemplates.qrc \ ruletemplates.qrc \
images.qrc \ images.qrc \
translations.qrc \ translations.qrc \
linux:!android:!ubports: {
HEADERS += platformintegration/generic/platformhelpergeneric.h
SOURCES += platformintegration/generic/platformhelpergeneric.cpp
}
!equals(OVERLAY_PATH, "") { !equals(OVERLAY_PATH, "") {
message("Resource overlay enabled. Will be using overlay from $${OVERLAY_PATH}") message("Resource overlay enabled. Will be using overlay from $${OVERLAY_PATH}")
RESOURCES += $${OVERLAY_PATH}/overlay.qrc RESOURCES += $${OVERLAY_PATH}/overlay.qrc
@ -68,7 +71,7 @@ RESOURCES += resources.qrc \
android { android {
include(../3rdParty/android/android_openssl/openssl.pri) include(../3rdParty/android/android_openssl/openssl.pri)
QT += androidextras webview QT += androidextras
HEADERS += platformintegration/android/platformhelperandroid.h HEADERS += platformintegration/android/platformhelperandroid.h
SOURCES += platformintegration/android/platformhelperandroid.cpp SOURCES += platformintegration/android/platformhelperandroid.cpp
@ -98,7 +101,9 @@ android {
} }
macx: { macx: {
QT += webview HEADERS += platformintegration/generic/platformhelpergeneric.h
SOURCES += platformintegration/generic/platformhelpergeneric.cpp
PRODUCT_NAME=$$TARGET PRODUCT_NAME=$$TARGET
QMAKE_TARGET_BUNDLE_PREFIX = io.nymea QMAKE_TARGET_BUNDLE_PREFIX = io.nymea
@ -120,7 +125,6 @@ macx: {
ios: { ios: {
message("iOS build") message("iOS build")
QT += webview
HEADERS += platformintegration/ios/platformhelperios.h HEADERS += platformintegration/ios/platformhelperios.h
SOURCES += platformintegration/ios/platformhelperios.cpp SOURCES += platformintegration/ios/platformhelperios.cpp
OBJECTIVE_SOURCES += $${IOS_PACKAGE_DIR}/platformhelperios.mm \ OBJECTIVE_SOURCES += $${IOS_PACKAGE_DIR}/platformhelperios.mm \
@ -175,13 +179,17 @@ ubports: {
CONFIG += link_pkgconfig CONFIG += link_pkgconfig
PKGCONFIG += connectivity-qt1 PKGCONFIG += connectivity-qt1
HEADERS += platformintegration/ubports/pushclient.h HEADERS += platformintegration/ubports/pushclient.h \
platformintegration/ubports/platformhelperubports.h \
SOURCES += platformintegration/ubports/pushclient.cpp SOURCES += platformintegration/ubports/pushclient.cpp \
platformintegration/ubports/platformhelperubports.cpp \
} }
win32 { win32 {
QT += webview HEADERS += platformintegration/generic/platformhelpergeneric.h
SOURCES += platformintegration/generic/platformhelpergeneric.cpp
equals(OVERLAY_PATH, "") { equals(OVERLAY_PATH, "") {
win32:RCC_ICONS += ../packaging/windows/packages/io.nymea.nymeaapp/meta/logo.ico win32:RCC_ICONS += ../packaging/windows/packages/io.nymea.nymeaapp/meta/logo.ico
} else { } else {

View File

@ -36,9 +36,11 @@
Q_DECLARE_LOGGING_CATEGORY(dcPlatformIntegration) Q_DECLARE_LOGGING_CATEGORY(dcPlatformIntegration)
#include <QProcess> #include <QProcess>
#include <QtWebView>
PlatformHelperGeneric::PlatformHelperGeneric(QObject *parent) : PlatformHelper(parent) PlatformHelperGeneric::PlatformHelperGeneric(QObject *parent) : PlatformHelper(parent)
{ {
QtWebView::initialize();
m_screenHelper = new ScreenHelper(this); m_screenHelper = new ScreenHelper(this);
} }

View File

@ -0,0 +1,21 @@
{
"builder": "qmake",
"kill": "nymea-app",
"build_args": "CONFIG+=ubports",
"dependencies_target": [
"libavahi-client-dev",
"libavahi-common-dev",
"libqt5charts5-dev",
"qt5-default",
"qml-module-qtcharts",
"qml-module-qt-labs-calendar",
"libconnectivity-qt1-dev",
"libunity-api-dev"
],
"install_lib": [
"/usr/lib/${ARCH_TRIPLET}/libQt5Nfc.so*"
],
"install_qml": [
"/usr/lib/${ARCH_TRIPLET}/qt5/qml/Qt/labs/calendar/"
]
}

View File

@ -15,5 +15,5 @@
}, },
"version": "1.0.100", "version": "1.0.100",
"maintainer": "Michael Zanetti <michael.zanetti@nymea.io>", "maintainer": "Michael Zanetti <michael.zanetti@nymea.io>",
"framework" : "ubuntu-sdk-16.04" "framework" : "ubuntu-sdk-16.04.5"
} }

View File

@ -12,6 +12,7 @@ Build-Depends: debhelper (>= 9.0.0),
libqt5charts5-dev, libqt5charts5-dev,
libqt5svg5-dev, libqt5svg5-dev,
libqt5websockets5-dev, libqt5websockets5-dev,
libqt5webview5-dev,
qt5-default, qt5-default,
qtbase5-dev, qtbase5-dev,
qtconnectivity5-dev, qtconnectivity5-dev,

View File

@ -17,6 +17,11 @@ architectures:
- build-on: arm64 - build-on: arm64
- build-on: armhf - build-on: armhf
# Required for QtWebEngine
layout:
/usr/share/qt5:
bind: $SNAP/usr/share/qt5
apps: apps:
daemon: daemon:
daemon: simple daemon: simple
@ -113,6 +118,7 @@ parts:
- qml-module-qtquick-controls2 - qml-module-qtquick-controls2
- qml-module-qtquick-layouts - qml-module-qtquick-layouts
- qml-module-qtquick-window2 - qml-module-qtquick-window2
- qml-module-qtwebview
- qml-module-qt-labs-calendar - qml-module-qt-labs-calendar
- qml-module-qt-labs-settings - qml-module-qt-labs-settings
- qml-module-qt-labs-folderlistmodel - qml-module-qt-labs-folderlistmodel