Skip to content

Commit

Permalink
add openzwave and fix domoticz version information
Browse files Browse the repository at this point in the history
- patch source code to show reasonable version information
- add openzwave (needs some workaround)
- add boost:serialization for cross/cereal
  • Loading branch information
hgy59 committed Jun 13, 2021
1 parent 2da6bc6 commit a8be02f
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 3 deletions.
20 changes: 17 additions & 3 deletions cross/domoticz/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ DEPENDS = cross/boost cross/sqlite cross/curl cross/python38 cross/lua cross/zli
DEPENDS += cross/jsoncpp
DEPENDS += cross/mosquitto
DEPENDS += cross/cereal

# TODO:
# jsoncpp fails for qoriq
DEPENDS += cross/openzwave

HOMEPAGE = https://www.domoticz.com/
COMMENT = Domoticz is a Home Automation System.
LICENSE = GPLv3

POST_EXTRACT_TARGET = domoticz_post_extract
PRE_COMPILE_TARGET = domoticz_pre_compile
INSTALL_TARGET = domoticz_install

# for domoticz
BOOST_LIBRARIES = atomic chrono date_time system thread
# for cereal
BOOST_LIBRARIES += serialization
ENV += BOOST_LIBRARIES="$(BOOST_LIBRARIES)"

ENV += CMAKE_INCLUDE_PATH="$(STAGING_INSTALL_PREFIX)/include"
Expand All @@ -31,6 +33,10 @@ ENV += PCH_COMPILE_FLAGS="$(CFLAGS)"
CMAKE_ARGS += -DUSE_BUILTIN_JSONCPP=no
CMAKE_ARGS += -DUSE_BUILTIN_MQTT=no
CMAKE_ARGS += -DUSE_BUILTIN_SQLITE=no
CMAKE_ARGS += -DUSE_STATIC_OPENZWAVE=no

# without this, domoticz does not find some openzwave include files:
ADDITIONAL_CXXFLAGS = -I$(STAGING_INSTALL_PREFIX)/include/openzwave

USE_NATIVE_CMAKE = 1

Expand All @@ -41,6 +47,14 @@ include ../../mk/spksrc.cross-cmake.mk
domoticz_post_extract:
@$(RUN); cd extern; git clone https://github.com/domoticz/minizip.git ./minizip

.PHONY: domoticz_pre_compile
# inject version information
domoticz_pre_compile:
$(RUN) ; sed -e "s/@_version_@/$(PKG_VERS)/g" \
-e "s/@_year_@/$(firstword $(subst ., ,$(PKG_VERS)))/g" \
-e "s/@_date_@/$(shell date +'%Y-%m-%d %H:%M:%S')/g" \
-i main/domoticz.cpp

.PHONY: domoticz_install
domoticz_install:
install -d $(STAGING_INSTALL_PREFIX)/bin $(STAGING_INSTALL_PREFIX)/var
Expand Down
16 changes: 16 additions & 0 deletions cross/domoticz/patches/001-make-version-configurable.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set place holders vor version an year, as the build process fails to read this from History.txt
# Remove display of git hash in version, as we build from source outside a git repository,
# display build date and synocommunity specific information instead.
--- main/domoticz.cpp.orig 2020-04-26 15:49:25.000000000 +0200
+++ main/domoticz.cpp 2021-06-13 01:16:59.799865857 +0200
@@ -685,8 +685,8 @@

void DisplayAppVersion()
{
- _log.Log(LOG_STATUS, "Domoticz V%s (c)2012-%d GizMoCuz", szAppVersion.c_str(), ActYear);
- _log.Log(LOG_STATUS, "Build Hash: %s, Date: %s", szAppHash.c_str(), szAppDate.c_str());
+ _log.Log(LOG_STATUS, "Domoticz V@_version_@ (c)2012-@_year_@ GizMoCuz");
+ _log.Log(LOG_STATUS, "Built by SynoCommunity for synology NAS devices. Date: @_date_@");
}

time_t m_LastHeartbeat = 0;
33 changes: 33 additions & 0 deletions cross/openzwave/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
PKG_NAME = openzwave
PKG_VERS = 1.6.1914
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = http://old.openzwave.com/downloads
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

HOMEPAGE = https://www.openzwave.net
COMMENT = C++ library to control Z-Wave Networks via a USB Z-Wave Controller.
LICENSE = LGPLv3

CONFIGURE_TARGET = nop
INSTALL_TARGET = openzwave_install
POST_INSTALL_TARGET = openzwave_post_install

ENV += CROSS_COMPILE=$(TC_PATH)$(TC_PREFIX)

include ../../mk/spksrc.cross-cc.mk

.PHONY: openzwave_install
# workaround for the non gnu standard usage of pkgconfig
# as the owner is not willing to fix this
# see https://github.com/OpenZWave/open-zwave/issues/1416
openzwave_install:
$(RUN) $(MAKE) DESTDIR=$(INSTALL_DIR) install PREFIX=$(INSTALL_PREFIX) instlibdir=$(INSTALL_PREFIX)/lib pkgconfigdir=$(INSTALL_PREFIX)/lib/pkgconfig

.PHONY: openzwave_post_install
# patch includes as some compilers fail to work with the include folder structure of openzwave
# (use hardcoded list of referenced header files in base folder to avoid too large sed expression size)
openzwave_post_install:
sed -e 's|\(#include "\)\([^.].*/\)|\1../\2|g' -i $(INSTALL_DIR)/$(INSTALL_PREFIX)/include/openzwave/*/*.h
sed -e 's|\(#include "\)\([^.].*/\)|\1../../\2|g' -i $(INSTALL_DIR)/$(INSTALL_PREFIX)/include/openzwave/*/*/*.h
sed -e 's%\(#include \"\)\(Bitfield\.h\|CompatOptionManager\.h\|Defs\.h\|Driver\.h\|TimerThread\.h\|ValueIDIndexes\.h\)%\1../\2%g' -i $(INSTALL_DIR)/$(INSTALL_PREFIX)/include/openzwave/*/*.h
5 changes: 5 additions & 0 deletions cross/openzwave/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bin:bin/MinOZW
rsc:bin/ozw_config
rsc:etc/openzwave/
lnk:lib/libopenzwave.so
lib:lib/libopenzwave.so.1.6
3 changes: 3 additions & 0 deletions cross/openzwave/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
openzwave-1.6.1914.tar.gz SHA1 8055f8e257a9d96adce0348d810b12633f504906
openzwave-1.6.1914.tar.gz SHA256 c4e4eb643709eb73c30cc25cffc24e9e7b6d7c49bd97ee8986c309d168d9ad2f
openzwave-1.6.1914.tar.gz MD5 e7813329cc711ec8f2f99ea503c81d5d

0 comments on commit a8be02f

Please sign in to comment.