fix plugin path for snap
This commit is contained in:
parent
4928a2a640
commit
a64441bdf5
6
guh.pri
6
guh.pri
@ -1,13 +1,17 @@
|
|||||||
# Parse and export GUH_VERSION_STRING
|
# Parse and export GUH_VERSION_STRING
|
||||||
GUH_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
|
GUH_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
|
||||||
|
|
||||||
|
# Install path for plugins
|
||||||
|
GUH_PLUGINS_PATH=/usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/guh/plugins/
|
||||||
|
|
||||||
# define protocol versions
|
# define protocol versions
|
||||||
JSON_PROTOCOL_VERSION=47
|
JSON_PROTOCOL_VERSION=47
|
||||||
REST_API_VERSION=1
|
REST_API_VERSION=1
|
||||||
|
|
||||||
DEFINES += GUH_VERSION_STRING=\\\"$${GUH_VERSION_STRING}\\\" \
|
DEFINES += GUH_VERSION_STRING=\\\"$${GUH_VERSION_STRING}\\\" \
|
||||||
JSON_PROTOCOL_VERSION=\\\"$${JSON_PROTOCOL_VERSION}\\\" \
|
JSON_PROTOCOL_VERSION=\\\"$${JSON_PROTOCOL_VERSION}\\\" \
|
||||||
REST_API_VERSION=\\\"$${REST_API_VERSION}\\\"
|
REST_API_VERSION=\\\"$${REST_API_VERSION}\\\" \
|
||||||
|
GUH_PLUGINS_PATH=\\\"$${GUH_PLUGINS_PATH}\\\"
|
||||||
|
|
||||||
QT *= network websockets bluetooth dbus
|
QT *= network websockets bluetooth dbus
|
||||||
|
|
||||||
|
|||||||
1
guh.pro
1
guh.pro
@ -41,6 +41,7 @@ message("Qt version:" $$[QT_VERSION])
|
|||||||
message("Building guh version $${GUH_VERSION_STRING}")
|
message("Building guh version $${GUH_VERSION_STRING}")
|
||||||
message("JSON-RPC API version $${JSON_PROTOCOL_VERSION}")
|
message("JSON-RPC API version $${JSON_PROTOCOL_VERSION}")
|
||||||
message("REST API version $${REST_API_VERSION}")
|
message("REST API version $${REST_API_VERSION}")
|
||||||
|
message("Plugin path $${GUH_PLUGINS_PATH}")
|
||||||
|
|
||||||
coverage {
|
coverage {
|
||||||
message("Building coverage.")
|
message("Building coverage.")
|
||||||
|
|||||||
@ -183,6 +183,7 @@
|
|||||||
#include "plugin/deviceplugin.h"
|
#include "plugin/deviceplugin.h"
|
||||||
#include "typeutils.h"
|
#include "typeutils.h"
|
||||||
#include "guhsettings.h"
|
#include "guhsettings.h"
|
||||||
|
#include "unistd.h"
|
||||||
|
|
||||||
#include <QPluginLoader>
|
#include <QPluginLoader>
|
||||||
#include <QStaticPlugin>
|
#include <QStaticPlugin>
|
||||||
@ -258,6 +259,10 @@ QStringList DeviceManager::pluginSearchDirs()
|
|||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/";
|
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/";
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/deviceplugins";
|
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/deviceplugins";
|
||||||
searchDirs << QCoreApplication::applicationDirPath() + "/../../../plugins/deviceplugins";
|
searchDirs << QCoreApplication::applicationDirPath() + "/../../../plugins/deviceplugins";
|
||||||
|
searchDirs << QString("%1").arg(GUH_PLUGINS_PATH);
|
||||||
|
#ifdef SNAPPY
|
||||||
|
searchDirs << QString("%1%2").arg(QString::fromUtf8(qgetenv("SNAP"))).arg(GUH_PLUGINS_PATH);
|
||||||
|
#endif
|
||||||
return searchDirs;
|
return searchDirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,6 @@ translations.path = /usr/share/guh/translations
|
|||||||
translations.files = $$[QT_SOURCE_TREE]/translations/*.qm
|
translations.files = $$[QT_SOURCE_TREE]/translations/*.qm
|
||||||
|
|
||||||
# Install plugin
|
# Install plugin
|
||||||
target.path = /usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/guh/plugins/
|
target.path = $$GUH_PLUGINS_PATH
|
||||||
INSTALLS += target translations
|
INSTALLS += target translations
|
||||||
|
|
||||||
|
|||||||
@ -231,7 +231,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SNAPPY
|
#ifdef SNAPPY
|
||||||
// http://snapcraft.io/docs/reference/env
|
// Note: http://snapcraft.io/docs/reference/env
|
||||||
qCDebug(dcApplication) << "Snap name :" << qgetenv("SNAP_NAME");
|
qCDebug(dcApplication) << "Snap name :" << qgetenv("SNAP_NAME");
|
||||||
qCDebug(dcApplication) << "Snap version :" << qgetenv("SNAP_VERSION");
|
qCDebug(dcApplication) << "Snap version :" << qgetenv("SNAP_VERSION");
|
||||||
qCDebug(dcApplication) << "Snap directory :" << qgetenv("SNAP");
|
qCDebug(dcApplication) << "Snap directory :" << qgetenv("SNAP");
|
||||||
|
|||||||
@ -69,13 +69,14 @@ parts:
|
|||||||
- avahi-daemon
|
- avahi-daemon
|
||||||
- libavahi-client3
|
- libavahi-client3
|
||||||
- libavahi-common3
|
- libavahi-common3
|
||||||
after: [ guh-cli, guh-webinterface, qt5conf]
|
after: [ qt5conf ]
|
||||||
|
|
||||||
guh-cli:
|
guh-cli:
|
||||||
plugin: python
|
plugin: python
|
||||||
python-version: python2
|
python-version: python2
|
||||||
source: https://github.com/guh/guh-cli.git
|
source: https://github.com/guh/guh-cli.git
|
||||||
source-type: git
|
source-type: git
|
||||||
|
after: [ guh ]
|
||||||
build-packages:
|
build-packages:
|
||||||
- python-dev
|
- python-dev
|
||||||
- python-pip
|
- python-pip
|
||||||
@ -87,5 +88,6 @@ parts:
|
|||||||
plugin: dump
|
plugin: dump
|
||||||
source: https://jenkins.guh.io/view/guh-webinterface/job/guh-webinterface-all/lastBuild/artifact/guh-webinterface.tar.gz
|
source: https://jenkins.guh.io/view/guh-webinterface/job/guh-webinterface-all/lastBuild/artifact/guh-webinterface.tar.gz
|
||||||
source-type: tar
|
source-type: tar
|
||||||
|
after: [ guh-cli ]
|
||||||
organize:
|
organize:
|
||||||
'*': guh-webinterface/
|
'*': guh-webinterface/
|
||||||
|
|||||||
Reference in New Issue
Block a user