From 8204e1d3eccd830df0e5ae7adc3c5da58f7e4343 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 26 Jun 2019 21:43:45 +0200 Subject: [PATCH 1/3] Use the new nymea-plugininfocompiler for building the matadata. --- debian/changelog | 5 +++++ debian/control | 2 ++ plugins.pri | 23 ++++++++--------------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3d2079b..1b4b252 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,8 @@ +nymea-plugins (0.14.0) UNRELEASED; urgency=medium + + + -- Michael Zanetti Wed, 26 Jun 2019 21:44:29 +0200 + nymea-plugins (0.12.3) xenial; urgency=medium [ Michael Zanetti ] diff --git a/debian/control b/debian/control index 290d09e..109179e 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,8 @@ Build-depends: libboblight-dev, libnymea1-dev, libnymea-mqtt-dev, libqt5serialport5-dev, + libqt5websockets5-dev, + nymea-dev-tools:native, pkg-config, python:any, qtbase5-dev, diff --git a/plugins.pri b/plugins.pri index 27e281d..35a5e9a 100644 --- a/plugins.pri +++ b/plugins.pri @@ -10,11 +10,6 @@ PKGCONFIG += nymea HEADERS += $${OUT_PWD}/plugininfo.h \ $${OUT_PWD}/extern-plugininfo.h -# Check if this is a snap build -snappy{ - INCLUDEPATH+=$$(SNAPCRAFT_STAGE)/usr/include/nymea -} - # Make the device plugin json file visible in the Qt Creator OTHER_FILES += $$PWD/$${TARGET}/deviceplugin"$$TARGET".json @@ -23,19 +18,17 @@ OTHER_FILES += $$PWD/$${TARGET}/deviceplugin"$$TARGET".json # Create plugininfo file plugininfo.target = $$OUT_PWD/plugininfo.h +extern-plugininfo.target = $$OUT_PWD/extern-plugininfo.h plugininfo_dummy.target = plugininfo.h +extern-plugininfo_dummy.target = extern-plugininfo.h plugininfo.depends = FORCE -plugininfo.commands = nymea-generateplugininfo --filetype i --jsonfile $$PWD/$${TARGET}/deviceplugin"$$TARGET".json --output plugininfo.h --builddir $$OUT_PWD +plugininfo.commands = nymea-plugininfocompiler \ + $$PWD/$${TARGET}/deviceplugin"$$TARGET".json \ + --output $$OUT_PWD/plugininfo.h \ + --extern $$OUT_PWD/extern-plugininfo.h plugininfo_dummy.commands = $$plugininfo.commands -QMAKE_EXTRA_TARGETS += plugininfo plugininfo_dummy - -# Create extern-plugininfo file -extern_plugininfo.target = $$OUT_PWD/extern-plugininfo.h -extern_plugininfo_dummy.target = extern-plugininfo.h -extern_plugininfo.depends = FORCE -extern_plugininfo.commands = nymea-generateplugininfo --filetype e --jsonfile $$PWD/$${TARGET}/deviceplugin"$$TARGET".json --output extern-plugininfo.h --builddir $$OUT_PWD -extern_plugininfo_dummy.commands = $$extern_plugininfo.commands -QMAKE_EXTRA_TARGETS += extern_plugininfo extern_plugininfo_dummy +extern-plugininfo.depends = plugininfo +QMAKE_EXTRA_TARGETS += plugininfo plugininfo_dummy extern-plugininfo extern-plugininfo_dummy # Clean up autogenerated plugin info files plugininfo_clean.commands = rm -fv $$OUT_PWD/plugininfo.h $$OUT_PWD/extern-plugininfo.h From dd481d69b27966f0b36a175cd7347acc25ba52d3 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 11 Jul 2019 00:54:13 +0200 Subject: [PATCH 2/3] Use system-wide plugin.pri --- plugins.pri | 69 +++++++++++++---------------------------------------- 1 file changed, 17 insertions(+), 52 deletions(-) diff --git a/plugins.pri b/plugins.pri index 35a5e9a..0dd7d09 100644 --- a/plugins.pri +++ b/plugins.pri @@ -1,52 +1,17 @@ -TEMPLATE = lib -CONFIG += plugin - -QMAKE_CXXFLAGS += -Werror -std=c++11 -g -QMAKE_LFLAGS += -std=c++11 - -CONFIG += link_pkgconfig -PKGCONFIG += nymea - -HEADERS += $${OUT_PWD}/plugininfo.h \ - $${OUT_PWD}/extern-plugininfo.h - -# Make the device plugin json file visible in the Qt Creator -OTHER_FILES += $$PWD/$${TARGET}/deviceplugin"$$TARGET".json - -# NOTE: if the code includes "plugininfo.h", it would fail if we only give it a compiler for $$OUT_PWD/plugininfo.h -# Let's add a dummy target with the plugininfo.h file without any path to allow the developer to just include it like that. - -# Create plugininfo file -plugininfo.target = $$OUT_PWD/plugininfo.h -extern-plugininfo.target = $$OUT_PWD/extern-plugininfo.h -plugininfo_dummy.target = plugininfo.h -extern-plugininfo_dummy.target = extern-plugininfo.h -plugininfo.depends = FORCE -plugininfo.commands = nymea-plugininfocompiler \ - $$PWD/$${TARGET}/deviceplugin"$$TARGET".json \ - --output $$OUT_PWD/plugininfo.h \ - --extern $$OUT_PWD/extern-plugininfo.h -plugininfo_dummy.commands = $$plugininfo.commands -extern-plugininfo.depends = plugininfo -QMAKE_EXTRA_TARGETS += plugininfo plugininfo_dummy extern-plugininfo extern-plugininfo_dummy - -# Clean up autogenerated plugin info files -plugininfo_clean.commands = rm -fv $$OUT_PWD/plugininfo.h $$OUT_PWD/extern-plugininfo.h -clean.depends = plugininfo_clean -QMAKE_EXTRA_TARGETS += clean plugininfo_clean - -# Install translation files -TRANSLATIONS *= $$files($${PWD}/$${TARGET}/translations/*ts, true) -lupdate.depends = FORCE -lupdate.depends += plugininfo.h -lupdate.commands = lupdate -recursive -no-obsolete $$PWD/"$$TARGET"/"$$TARGET".pro; -QMAKE_EXTRA_TARGETS += lupdate - -translations.path = /usr/share/nymea/translations -translations.files = $$[QT_SOURCE_TREE]/translations/*.qm -TRANSLATIONS += $$files($$[QT_SOURCE_TREE]/translations/*.ts, true) - -# Install plugin -target.path = $$[QT_INSTALL_LIBS]/nymea/plugins/ -INSTALLS += target translations - +isEmpty(PLUGIN_PRI) { + exists($$[QT_INSTALL_PREFIX]/include/nymea/plugin.pri) { + include($$[QT_INSTALL_PREFIX]/include/nymea/plugin.pri) + } else { + message("plugin.pri not found. Either install libnymea1-dev or use the PLUGIN_PRI argument to point to it.") + message("For building this project without nymea installed system-wide, you will want to export those variables in addition:") + message("PKG_CONFIG_PATH=/path/to/build-nymea/libnymea/pkgconfig/") + message("CPATH=/path/to/nymea/libnymea/") + message("LIBRARY_PATH=/path/to/build-nymea/libnymea/") + message("PATH=/path/to/build-nymea/tools/nymea-plugininfocompiler:$PATH") + message("LD_LIBRARY_PATH=/path/to/build-nymea/libnymea/") + error("plugin.pri not found. Cannot continue") + } +} else { + message("Using $$PLUGIN_PRI") + include($$PLUGIN_PRI) +} From 598b6d3da97732d6764343f5ada52534fd332d0d Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Thu, 11 Jul 2019 11:42:50 +0200 Subject: [PATCH 3/3] Bump version to be in line with nymea --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1b4b252..649994b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -nymea-plugins (0.14.0) UNRELEASED; urgency=medium +nymea-plugins (0.15.0) UNRELEASED; urgency=medium -- Michael Zanetti Wed, 26 Jun 2019 21:44:29 +0200