Make the webview work in the snap package

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

View File

@ -36,9 +36,11 @@
Q_DECLARE_LOGGING_CATEGORY(dcPlatformIntegration)
#include <QProcess>
#include <QtWebView>
PlatformHelperGeneric::PlatformHelperGeneric(QObject *parent) : PlatformHelper(parent)
{
QtWebView::initialize();
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",
"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,
libqt5svg5-dev,
libqt5websockets5-dev,
libqt5webview5-dev,
qt5-default,
qtbase5-dev,
qtconnectivity5-dev,

View File

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