From 5ad12f77471d43d0d6abf9119ca112a3c8bb3abb Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 17 Apr 2019 18:36:02 +0200 Subject: [PATCH 1/3] Don't use dpkg specific tools to set install path --- nymea-plugins.pro | 9 +-------- plugins.pri | 8 ++++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/nymea-plugins.pro b/nymea-plugins.pro index 53b41119..62962686 100644 --- a/nymea-plugins.pro +++ b/nymea-plugins.pro @@ -49,8 +49,6 @@ PLUGIN_DIRS = \ ws2812 \ -CONFIG+=all - message(============================================) message("Qt version:" $$[QT_VERSION]) @@ -73,12 +71,9 @@ QMAKE_EXTRA_TARGETS += lrelease # For Qt-Creator's code model: Add CPATH to INCLUDEPATH explicitly INCLUDEPATH += $$(CPATH) -message(" cpath is $$(CPATH)") # Verify if building only a selection of plugins contains(CONFIG, selection) { - CONFIG-=all - # Check each plugin if the subdir exists for(plugin, PLUGINS) { contains(PLUGIN_DIRS, $${plugin}) { @@ -88,9 +83,7 @@ contains(CONFIG, selection) { } } message("Building plugin selection: $${SUBDIRS}") -} - -all { +} else { SUBDIRS *= $${PLUGIN_DIRS} message("Building all plugins") } diff --git a/plugins.pri b/plugins.pri index ac74e252..009dd0da 100644 --- a/plugins.pri +++ b/plugins.pri @@ -4,13 +4,13 @@ CONFIG += plugin QMAKE_CXXFLAGS += -Werror -std=c++11 -g QMAKE_LFLAGS += -std=c++11 -INCLUDEPATH += /usr/include/nymea +# FIXME: Ideally libnymea-dev would ship pkgconfig files so we get libnymea includes from there +INCLUDEPATH += $$[QT_INSTALL_HEADERS]/../nymea + LIBS += -lnymea HEADERS += $${OUT_PWD}/plugininfo.h \ $${OUT_PWD}/extern-plugininfo.h -PLUGIN_PATH=/usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/nymea/plugins/ - # Check if this is a snap build snappy{ INCLUDEPATH+=$$(SNAPCRAFT_STAGE)/usr/include/nymea @@ -55,6 +55,6 @@ translations.files = $$[QT_SOURCE_TREE]/translations/*.qm TRANSLATIONS += $$files($$[QT_SOURCE_TREE]/translations/*.ts, true) # Install plugin -target.path = $$PLUGIN_PATH +target.path = $$[QT_INSTALL_LIBS]/nymea/plugins/ INSTALLS += target translations From 4d52635d29b7a52d4fe2b40c6cf57a645dd802bb Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Wed, 17 Apr 2019 20:08:21 +0200 Subject: [PATCH 2/3] cleanup lost file --- lircd/devicepluginlircd.cpp | 104 ------------------------------------ 1 file changed, 104 deletions(-) delete mode 100644 lircd/devicepluginlircd.cpp diff --git a/lircd/devicepluginlircd.cpp b/lircd/devicepluginlircd.cpp deleted file mode 100644 index 4c30f4ff..00000000 --- a/lircd/devicepluginlircd.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * * - * Copyright (C) 2015 Simon Stürz * - * Copyright (C) 2014 Michael Zanetti * - * * - * This file is part of nymea. * - * * - * This library is free software; you can redistribute it and/or * - * modify it under the terms of the GNU Lesser General Public * - * License as published by the Free Software Foundation; either * - * version 2.1 of the License, or (at your option) any later version. * - * * - * This library 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with this library; If not, see * - * . * - * * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -/*! - \page lirc.html - \title LIRC - \brief Plugin for the LIRC infrared daemon. - - \ingroup plugins - \ingroup nymea-plugins-maker - - This plugin allows to interact with \l{http://www.lirc.org/}{LIRC} daemon and controll commonly used remote controls. - If lircd (LIRC daemon) is configured on your system, nymea will connect to the lirc daemon and all configured remote - controls of lircd will appear in nymea. - - \chapter Plugin properties - Following JSON file contains the definition and the description of all available \l{DeviceClass}{DeviceClasses} - and \l{Vendor}{Vendors} of this \l{DevicePlugin}. - - For more details how to read this JSON file please check out the documentation for \l{The plugin JSON File}. - - \quotefile plugins/deviceplugins/lircd/devicepluginlircd.json -*/ - -#include "devicepluginlircd.h" - -#include "plugin/device.h" -#include "devicemanager.h" -#include "plugininfo.h" -#include "lircdclient.h" - -#include -#include - -DeviceClassId lircdDeviceClassId = DeviceClassId("5c2bc4cd-ba6c-4052-b6cd-1db83323ea22"); -EventTypeId LircKeypressEventTypeId = EventTypeId("8711471a-fa0e-410b-b174-dfc3d2aeffb1"); - -DevicePluginLircd::DevicePluginLircd() -{ - m_lircClient = new LircClient(this); - - //m_lircClient->connect(); - connect(m_lircClient, &LircClient::buttonPressed, this, &DevicePluginLircd::buttonPressed); -} - -DeviceManager::HardwareResources DevicePluginLircd::requiredHardware() const -{ - return DeviceManager::HardwareResourceNone; -} - -void DevicePluginLircd::buttonPressed(const QString &remoteName, const QString &buttonName, int repeat) -{ - Device *remote = nullptr; - QList configuredRemotes = deviceManager()->findConfiguredDevices(lircdDeviceClassId); - foreach (Device *device, configuredRemotes) { - if (device->paramValue(irReceiverNameParamTypeId).toString() == remoteName) { - remote = device; - break; - } - } - if (!remote) { - qCWarning(dcLircd) << "Unhandled remote" << remoteName << buttonName; - return; - } - - qCDebug(dcLircd) << "found remote" << remoteName << supportedDevices().first().eventTypes().count(); - ParamList params; - Param buttonParam(irReceiverButtonParamTypeId, buttonName); - params.append(buttonParam); - Param repeatParam(irReceiverRepeatParamTypeId, repeat); - params.append(repeatParam); - Event event(LircKeypressEventTypeId, remote->id(), params); - emitEvent(event); -} - -//QVariantMap DevicePluginLircd::configuration() const -//{ -// return m_config; -//} - -//void DevicePluginLircd::setConfiguration(const QVariantMap &configuration) -//{ -// m_config = configuration; -//} From 067b42575c68c9fe02d2b1adb1c4f48d27b1c83b Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 23 Apr 2019 21:44:12 +0200 Subject: [PATCH 3/3] Use pkgconfig to find libnymea --- plugins.pri | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins.pri b/plugins.pri index 009dd0da..27e281de 100644 --- a/plugins.pri +++ b/plugins.pri @@ -4,10 +4,9 @@ CONFIG += plugin QMAKE_CXXFLAGS += -Werror -std=c++11 -g QMAKE_LFLAGS += -std=c++11 -# FIXME: Ideally libnymea-dev would ship pkgconfig files so we get libnymea includes from there -INCLUDEPATH += $$[QT_INSTALL_HEADERS]/../nymea +CONFIG += link_pkgconfig +PKGCONFIG += nymea -LIBS += -lnymea HEADERS += $${OUT_PWD}/plugininfo.h \ $${OUT_PWD}/extern-plugininfo.h