Merge PR #153: Don't set debian/ubuntu specific paths in project file

pull/163/head
Jenkins 2019-05-02 11:56:04 +02:00
commit 87e8c5cbd3
10 changed files with 31 additions and 39 deletions

View File

@ -2,3 +2,4 @@ usr/lib/@DEB_HOST_MULTIARCH@/libnymea.so
usr/include/nymea/* usr/include/nymea
usr/bin/nymea-generateplugininfo usr/bin
libnymea/plugin/plugin.pri usr/include/nymea/
usr/lib/@DEB_HOST_MULTIARCH@/nymea.pc usr/lib/@DEB_HOST_MULTIARCH@/pkgconfig/

View File

@ -1,5 +1,4 @@
usr/bin/nymead
usr/lib/@DEB_HOST_MULTIARCH@/libnymea-core.so
usr/lib/@DEB_HOST_MULTIARCH@/libnymea-core.so.1
usr/lib/@DEB_HOST_MULTIARCH@/libnymea-core.so.1.0
usr/lib/@DEB_HOST_MULTIARCH@/libnymea-core.so.1.0.0

2
debian/rules vendored
View File

@ -40,6 +40,8 @@ override_dh_auto_build:
make -j$(DEB_PARALLEL_JOBS) $(MAKE_TARGETS)
override_dh_install: $(PREPROCESS_FILES:.in=)
# libnymea-core isn't public api... delete dev lib and just keep runtime libs.
rm $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libnymea-core.so
dh_install --fail-missing
# installing the documentation as there is no extra install target
cp -a $(CURDIR)/doc/html $(CURDIR)/debian/nymea-doc/usr/share/doc/nymea/ || true

View File

@ -7,7 +7,7 @@ QT += sql
INCLUDEPATH += $$top_srcdir/libnymea
LIBS += -L$$top_builddir/libnymea/ -lnymea -lssl -lcrypto -lavahi-common -lavahi-client -lnymea-mqtt
target.path = /usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')
target.path = $$[QT_INSTALL_LIBS]
INSTALLS += target
# icons for the webserver

View File

@ -245,14 +245,13 @@ QStringList DeviceManager::pluginSearchDirs()
if (!envPath.isEmpty()) {
searchDirs << QString(envPath).split(':');
}
foreach (QString libraryPath, QCoreApplication::libraryPaths()) {
searchDirs << libraryPath.replace("qt5", "nymea");
}
searchDirs << QCoreApplication::applicationDirPath() + "/../lib/nymea/plugins";
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/";
searchDirs << QCoreApplication::applicationDirPath() + "/../../../plugins/";
searchDirs << QString("%1").arg(NYMEA_PLUGINS_PATH);
QString snapDir = QString::fromUtf8(qgetenv("SNAP"));
if (!snapDir.isEmpty()) {
searchDirs << QString("%1%2").arg(snapDir).arg(NYMEA_PLUGINS_PATH);
}
return searchDirs;
}

View File

@ -8,10 +8,6 @@ DEFINES += LIBNYMEA_LIBRARY
QMAKE_LFLAGS += -fPIC
target.path = /usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')
INSTALLS += target
# Avahi libs
LIBS += -lavahi-common -lavahi-client
HEADERS += devicemanager.h \
@ -35,11 +31,6 @@ HEADERS += devicemanager.h \
network/oauth2.h \
network/avahi/qtavahiservicebrowser.h \
network/avahi/avahiserviceentry.h \
#network/avahi/qtavahiclient.h \
#network/avahi/qt-watch.h \
#network/avahi/qtavahiservice.h \
#network/avahi/qtavahiservice_p.h \
#network/avahi/qtavahiservicebrowser_p.h \
hardware/bluetoothlowenergy/bluetoothlowenergydevice.h \
hardware/bluetoothlowenergy/bluetoothdiscoveryreply.h \
hardware/bluetoothlowenergy/bluetoothlowenergymanager.h \
@ -74,7 +65,7 @@ HEADERS += devicemanager.h \
nymeadbusservice.h \
network/mqtt/mqttprovider.h \
network/mqtt/mqttchannel.h \
translator.h
translator.h
SOURCES += devicemanager.cpp \
loggingcategories.cpp \
@ -95,11 +86,6 @@ SOURCES += devicemanager.cpp \
network/oauth2.cpp \
network/avahi/avahiserviceentry.cpp \
network/avahi/qtavahiservicebrowser.cpp \
#network/avahi/qt-watch.cpp \
#network/avahi/qtavahiclient.cpp \
#network/avahi/qtavahiservice.cpp \
#network/avahi/qtavahiservice_p.cpp \
#network/avahi/qtavahiservicebrowser_p.cpp \
hardware/bluetoothlowenergy/bluetoothlowenergymanager.cpp \
hardware/bluetoothlowenergy/bluetoothlowenergydevice.cpp \
hardware/bluetoothlowenergy/bluetoothdiscoveryreply.cpp \
@ -134,9 +120,14 @@ SOURCES += devicemanager.cpp \
nymeadbusservice.cpp \
network/mqtt/mqttprovider.cpp \
network/mqtt/mqttchannel.cpp \
translator.cpp
translator.cpp
RESOURCES += \
interfaces/interfaces.qrc
## Install instructions
# install plugininfo python script for libnymea-dev
generateplugininfo.files = $$top_srcdir/plugins/nymea-generateplugininfo
generateplugininfo.path = /usr/bin
@ -145,11 +136,21 @@ INSTALLS += generateplugininfo
# install header file with relative subdirectory
for(header, HEADERS) {
path = /usr/include/nymea/$${dirname(header)}
path = $${PREFIX}/include/nymea/$${dirname(header)}
eval(headers_$${path}.files += $${header})
eval(headers_$${path}.path = $${path})
eval(INSTALLS *= headers_$${path})
}
RESOURCES += \
interfaces/interfaces.qrc
# define install target
target.path = $$[QT_INSTALL_LIBS]
INSTALLS += target
# Create pkgconfig file
CONFIG += create_pc create_prl no_install_prl
QMAKE_PKGCONFIG_NAME = libnymea
QMAKE_PKGCONFIG_DESCRIPTION = nymea development library
QMAKE_PKGCONFIG_PREFIX = $${PREFIX}
QMAKE_PKGCONFIG_LIBDIR = $$target.path
QMAKE_PKGCONFIG_INCDIR = /usr/include/nymea
QMAKE_PKGCONFIG_VERSION = $$NYMEA_VERSION_STRING

View File

@ -85,12 +85,7 @@ void Translator::loadTranslator(DevicePlugin *plugin, const QLocale &locale)
} else {
QString pluginId = plugin->pluginId().toString().remove(QRegExp("[{}]"));
QStringList searchDirs = QString(qgetenv("NYMEA_PLUGINS_PATH")).split(':');
searchDirs << QCoreApplication::applicationDirPath() + "/../lib/nymea/plugins";
searchDirs << QCoreApplication::applicationDirPath() + "/../plugins/";
searchDirs << QCoreApplication::applicationDirPath() + "/../../../plugins/";
foreach (const QString &pluginPath, searchDirs) {
foreach (const QString &pluginPath, m_deviceManager->pluginSearchDirs()) {
if (translator->load(locale, pluginId, "-", QDir(pluginPath + "/translations/").absolutePath(), ".qm")) {
qCDebug(dcTranslations()) << "* Loaded translation" << locale.name() << "for plugin" << plugin->pluginName() << "from" << QDir(pluginPath + "/translations/").absolutePath();
loaded = true;

View File

@ -1,9 +1,6 @@
# Parse and export NYMEA_VERSION_STRING
NYMEA_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
# Install path for plugins
NYMEA_PLUGINS_PATH=/usr/lib/$$system('dpkg-architecture -q DEB_HOST_MULTIARCH')/nymea/plugins/
# define protocol versions
JSON_PROTOCOL_VERSION_MAJOR=2
JSON_PROTOCOL_VERSION_MINOR=0
@ -15,8 +12,7 @@ COPYRIGHT_YEAR_TO=2019
DEFINES += NYMEA_VERSION_STRING=\\\"$${NYMEA_VERSION_STRING}\\\" \
JSON_PROTOCOL_VERSION=\\\"$${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}\\\" \
REST_API_VERSION=\\\"$${REST_API_VERSION}\\\" \
COPYRIGHT_YEAR_STRING=\\\"$${COPYRIGHT_YEAR_FROM}-$${COPYRIGHT_YEAR_TO}\\\" \
NYMEA_PLUGINS_PATH=\\\"$${NYMEA_PLUGINS_PATH}\\\"
COPYRIGHT_YEAR_STRING=\\\"$${COPYRIGHT_YEAR_FROM}-$${COPYRIGHT_YEAR_TO}\\\"
QT *= network websockets bluetooth dbus

View File

@ -58,7 +58,6 @@ message("Copyright $${COPYRIGHT_YEAR_FROM} - $${COPYRIGHT_YEAR_TO}")
message("Building nymea version $${NYMEA_VERSION_STRING}")
message("JSON-RPC API version $${JSON_PROTOCOL_VERSION_MAJOR}.$${JSON_PROTOCOL_VERSION_MINOR}")
message("REST API version $${REST_API_VERSION}")
message("Plugin path $${NYMEA_PLUGINS_PATH}")
message("Source directory: $${top_srcdir}")
message("Build directory: $${top_builddir}")
message("Translations: $${TRANSLATIONS}")

View File

@ -34,5 +34,5 @@ PRE_TARGETDEPS += compiler_plugininfo_make_all compiler_externplugininfo_make_al
QMAKE_EXTRA_COMPILERS += plugininfo externplugininfo
# Install plugin
target.path = $$NYMEA_PLUGINS_PATH
target.path = $$[QT_INSTALL_LIBS]/nymea/plugins/
INSTALLS += target