-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update Domoticz to r2563 and add openzwave support #1769
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
PKG_NAME = cp210x | ||
PKG_DIR = $(PKG_NAME) | ||
|
||
DOWNLOAD_TARGET = kernel | ||
|
||
REQ_KERNEL = 1 | ||
|
||
HOMEPAGE = http://sourceforge.net/projects/dsgpl/ | ||
COMMENT = CP210x USB to UART Bridge VCP Drivers | ||
LICENSE = GNU GPL | ||
|
||
CONFIGURE_TARGET = nope | ||
COMPILE_TARGET = myCompile | ||
INSTALL_TARGET = myInstall | ||
|
||
include ../../mk/spksrc.cross-cc.mk | ||
|
||
.PHONY: myCompile | ||
myCompile: | ||
@mkdir -p $(WORK_DIR)/$(PKG_DIR) | ||
@echo "obj-m += cp210x.o" > $(WORK_DIR)/$(PKG_DIR)/Makefile | ||
@cp $(KERNEL_DIR)/drivers/usb/serial/cp210x.c $(WORK_DIR)/$(PKG_DIR)/ | ||
CPPFLAGS="" CFLAGS="" LDFLAGS="" \ | ||
make -C $(KERNEL_DIR) SUBDIRS=$(WORK_DIR)/$(PKG_DIR) modules | ||
|
||
.PHONY: myInstall | ||
myInstall: | ||
mkdir -p $(STAGING_INSTALL_PREFIX)/modules | ||
install -m 755 $(WORK_DIR)/$(PKG_DIR)/$(PKG_NAME).ko $(STAGING_INSTALL_PREFIX)/modules/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rsc:modules/cp210x.ko |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,6 @@ rsc:svnversion.h | |
rsc:www | ||
rsc:Config | ||
rsc:scripts | ||
rsc:samplescripts | ||
rsc:var | ||
rsc:rules.d |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,66 @@ | ||
--- CMakeLists.txt.orig 2015-03-25 08:59:06.695422175 +0100 | ||
+++ CMakeLists.txt 2015-03-25 08:59:32.740438770 +0100 | ||
@@ -405,7 +405,7 @@ | ||
message(STATUS "Not building on Raspberry Pi. GPIO support disabled.") | ||
ENDIF(RaspberryPi) | ||
--- CMakeLists.txt | ||
+++ CMakeLists.txt | ||
@@ -72,10 +72,10 @@ | ||
#ADD_DEFINITIONS( -Wall -O0 -ggdb ) | ||
#ADD_DEFINITIONS( -Wfatal-errors -Wformat=2 -Werror=format-security ) | ||
|
||
-target_link_libraries(domoticz ${Boost_LIBRARIES} ${SQLITE3_LIBRARY} ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} pthread lua mqtt ${CMAKE_DL_LIBS}) | ||
+target_link_libraries(domoticz ${Boost_LIBRARIES} ${SQLITE3_LIBRARY} ${ZLIB_LIBRARIES} ${CURL_LIBRARIES} pthread lua mqtt ${CMAKE_DL_LIBS} -lrt) | ||
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") | ||
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc -static-libstdc++") | ||
- SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc -static-libstdc++") | ||
- SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc -static-libstdc++") | ||
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc") | ||
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc") | ||
+ SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc") | ||
+ SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc") | ||
|
||
ADD_PRECOMPILED_HEADER(domoticz "main/stdafx.h") | ||
GET_FILENAME_COMPONENT(_name ${_input} NAME) | ||
SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}") | ||
@@ -266,8 +266,6 @@ | ||
|
||
## Link libraries | ||
|
||
-option(USE_STATIC_BOOST "Build with static BOOST libraries" YES) | ||
-set(Boost_USE_STATIC_LIBS ${USE_STATIC_BOOST}) | ||
set(Boost_USE_MULTITHREADED ON) | ||
unset(Boost_INCLUDE_DIR CACHE) | ||
unset(Boost_LIBRARY_DIRS CACHE) | ||
@@ -353,39 +351,6 @@ | ||
target_link_libraries(domoticz ${OpenZWave}) | ||
include_directories(${CMAKE_SOURCE_DIR}/hardware/openzwave) | ||
add_definitions(-DWITH_OPENZWAVE) | ||
- # open-zwave needs libudev | ||
- IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin") | ||
- set(IOKIT_LIBRARY "-framework IOKit -framework CoreFoundation" CACHE FILEPATH "IOKit framework" FORCE) | ||
- target_link_libraries(domoticz ${IOKIT_LIBRARY}) | ||
- else() | ||
- IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") | ||
- MESSAGE(STATUS "Building on FreeBSD, libudev not needed!") | ||
- FIND_PATH(ICONV_INCLUDE_DIR iconv.h) | ||
- FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c) | ||
- IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) | ||
- SET(ICONV_FOUND TRUE) | ||
- #target_link_libraries(domoticz ${ICONV_INCLUDE_DIR}) | ||
- target_link_libraries(domoticz ${ICONV_LIBRARIES} -lrt) | ||
- message(STATUS ${ICONV_LIBRARIES}) | ||
- else() | ||
- MESSAGE(FATAL_ERROR "libiconv not found on your system") | ||
- ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES) | ||
- else() | ||
- find_library(UDEV NAMES libudev.a) | ||
- IF(UDEV) | ||
- message(STATUS ${UDEV}) | ||
- target_link_libraries(domoticz ${UDEV} -lrt) | ||
- else() | ||
- find_library(UDEV NAMES libudev.so) | ||
- IF(UDEV) | ||
- message(STATUS ${UDEV}) | ||
- target_link_libraries(domoticz ${UDEV} -lrt) | ||
- else() | ||
- MESSAGE(FATAL_ERROR "LIB UDEV not found on your system, see install.txt how to get them installed.\nsudo apt-get install libudev-dev") | ||
- ENDIF(UDEV) | ||
- ENDIF(UDEV) | ||
- ENDIF() | ||
- ENDIF() | ||
else() | ||
MESSAGE(STATUS "==== OpenZWave not found, support disabled!") | ||
ENDIF(OpenZWave) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
PKG_NAME = openzwave | ||
PKG_VERS = 1.3.328 | ||
PKG_EXT = tar.gz | ||
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT) | ||
PKG_DIST_SITE = http://old.openzwave.com/snapshots | ||
PKG_DIR = open-zwave-read-only | ||
|
||
HOMEPAGE = http://www.openzwave.com/ | ||
COMMENT = A Open Source implementation of the ZWave Serial API | ||
LICENSE = GPL | ||
|
||
ENV += CROSS_COMPILE=$(TC_PATH)$(TC_PREFIX) NOLIBUDEV=true | ||
|
||
POST_EXTRACT_TARGET = myPostExtract | ||
CONFIGURE_TARGET = nope | ||
INSTALL_TARGET = myInstall | ||
|
||
include ../../mk/spksrc.cross-cc.mk | ||
|
||
.PHONY: myPostExtract | ||
myPostExtract: | ||
mv $(WORK_DIR)/$(PKG_NAME)-$(PKG_VERS) $(WORK_DIR)/$(PKG_DIR) | ||
|
||
.PHONY: myInstall | ||
myInstall: | ||
$(RUN) make install DESTDIR=$(INSTALL_DIR) PREFIX=$(INSTALL_PREFIX) NOLIBUDEV=true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lib:lib/libopenzwave.so | ||
lib:lib/libopenzwave.so.1.3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
openzwave-1.3.328.tar.gz SHA1 2c866b7923900a2a8f5c37afe3da3cfa1f03b250 | ||
openzwave-1.3.328.tar.gz SHA256 f2bc215a5a1f1829674c38ade68c9990a1d49ed0f10c7b1e805fbbc6ef13afbd | ||
openzwave-1.3.328.tar.gz MD5 a3c1d3acc1dd42f4ac903589eb609494 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
diff --git a/cpp/build/Makefile b/cpp/build/Makefile | ||
index d3aef7a..56f538d 100644 | ||
--- cpp/build/Makefile | ||
+++ cpp/build/Makefile | ||
@@ -47,20 +45,30 @@ LDFLAGS+= -shared -lusb | ||
|
||
else | ||
LDFLAGS += -shared -Wl,-soname,libopenzwave.so.$(VERSION) | ||
+ifndef NOLIBUDEV | ||
LIBS += -ludev | ||
+else | ||
+CFLAGS += -DNOLIBUDEV | ||
+endif | ||
endif | ||
|
||
#where to put the temporary library | ||
LIBDIR ?= $(top_builddir) | ||
|
||
+ifndef NOLIBUDEV | ||
INCLUDES := -I $(top_srcdir)/cpp/src -I $(top_srcdir)/cpp/tinyxml/ -I $(top_srcdir)/cpp/hidapi/hidapi/ | ||
+else | ||
+INCLUDES := -I $(top_srcdir)/cpp/src -I $(top_srcdir)/cpp/tinyxml/ | ||
+endif | ||
|
||
ifeq ($(UNAME),Darwin) | ||
SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/mac | ||
else ifeq ($(UNAME),FreeBSD) | ||
SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/libusb | ||
-else | ||
+else ifndef NOLIBUDEV | ||
SOURCES_HIDAPI =$(top_srcdir)/cpp/hidapi/linux | ||
+else | ||
+SOURCES_HIDAPI:= | ||
endif | ||
|
||
|
||
@@ -82,8 +90,14 @@ endif | ||
|
||
cclasses := $(notdir $(wildcard $(top_srcdir)/cpp/src/command_classes/*.cpp)) | ||
vclasses := $(notdir $(wildcard $(top_srcdir)/cpp/src/value_classes/*.cpp)) | ||
+ifndef NOLIBUDEV | ||
pform := $(notdir $(wildcard $(top_srcdir)/cpp/src/platform/*.cpp)) \ | ||
$(notdir $(wildcard $(top_srcdir)/cpp/src/platform/unix/*.cpp)) | ||
+else | ||
+pform := $(filter-out HidController.cpp, $(notdir $(wildcard $(top_srcdir)/cpp/src/platform/*.cpp))) \ | ||
+ $(notdir $(wildcard $(top_srcdir)/cpp/src/platform/unix/*.cpp)) | ||
+endif | ||
+ | ||
indep := $(notdir $(filter-out $(top_srcdir)/cpp/src/vers.cpp, $(wildcard $(top_srcdir)/cpp/src/*.cpp))) | ||
aes := $(notdir $(wildcard $(top_srcdir)/cpp/src/aes/*.c)) | ||
|
||
@@ -98,7 +112,9 @@ printversion: | ||
|
||
|
||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(tinyxml)) | ||
+ifndef NOLIBUDEV | ||
-include $(patsubst %.c,$(DEPDIR)/%.d,$(hidapi)) | ||
+endif | ||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(cclasses)) | ||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(vclasses)) | ||
-include $(patsubst %.cpp,$(DEPDIR)/%.d,$(pform)) | ||
@@ -117,6 +133,7 @@ $(top_srcdir)/cpp/src/vers.cpp: | ||
|
||
#$(OBJDIR)/vers.o: $(top_builddir)/vers.cpp | ||
|
||
+ifndef NOLIBUDEV | ||
$(LIBDIR)/libopenzwave.a: $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \ | ||
$(patsubst %.c,$(OBJDIR)/%.o,$(hidapi)) \ | ||
$(patsubst %.c,$(OBJDIR)/%.o,$(aes)) \ | ||
@@ -125,10 +142,19 @@ $(LIBDIR)/libopenzwave.a: $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \ | ||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(pform)) \ | ||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(indep)) \ | ||
$(OBJDIR)/vers.o | ||
+else | ||
+$(LIBDIR)/libopenzwave.a: $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \ | ||
+ $(patsubst %.c,$(OBJDIR)/%.o,$(aes)) \ | ||
+ $(patsubst %.cpp,$(OBJDIR)/%.o,$(cclasses)) \ | ||
+ $(patsubst %.cpp,$(OBJDIR)/%.o,$(vclasses)) \ | ||
+ $(patsubst %.cpp,$(OBJDIR)/%.o,$(pform)) \ | ||
+ $(patsubst %.cpp,$(OBJDIR)/%.o,$(indep)) \ | ||
+ $(OBJDIR)/vers.o | ||
+endif | ||
@echo "Linking Static Library" | ||
@$(AR) $@ $+ | ||
@$(RANLIB) $@ | ||
- | ||
+ifndef NOLIBUDEV | ||
$(LIBDIR)/$(SHARED_LIB_NAME): $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \ | ||
$(patsubst %.c,$(OBJDIR)/%.o,$(hidapi)) \ | ||
$(patsubst %.c,$(OBJDIR)/%.o,$(aes)) \ | ||
@@ -137,6 +163,15 @@ $(LIBDIR)/$(SHARED_LIB_NAME): $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \ | ||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(pform)) \ | ||
$(patsubst %.cpp,$(OBJDIR)/%.o,$(indep)) \ | ||
$(OBJDIR)/vers.o | ||
+else | ||
+$(LIBDIR)/$(SHARED_LIB_NAME): $(patsubst %.cpp,$(OBJDIR)/%.o,$(tinyxml)) \ | ||
+ $(patsubst %.c,$(OBJDIR)/%.o,$(aes)) \ | ||
+ $(patsubst %.cpp,$(OBJDIR)/%.o,$(cclasses)) \ | ||
+ $(patsubst %.cpp,$(OBJDIR)/%.o,$(vclasses)) \ | ||
+ $(patsubst %.cpp,$(OBJDIR)/%.o,$(pform)) \ | ||
+ $(patsubst %.cpp,$(OBJDIR)/%.o,$(indep)) \ | ||
+ $(OBJDIR)/vers.o | ||
+endif | ||
@echo "Linking Shared Library" | ||
@$(LD) $(LDFLAGS) -o $@ $+ $(LIBS) | ||
@ln -sf $(SHARED_LIB_NAME) $(LIBDIR)/$(SHARED_LIB_UNVERSIONED) | ||
diff --git a/cpp/src/Driver.cpp b/cpp/src/Driver.cpp | ||
index 3613746..a55a776 100644 | ||
--- cpp/src/Driver.cpp | ||
+++ cpp/src/Driver.cpp | ||
@@ -37,7 +37,9 @@ | ||
#include "platform/Event.h" | ||
#include "platform/Mutex.h" | ||
#include "platform/SerialController.h" | ||
+#ifndef NOLIBUDEV | ||
#include "platform/HidController.h" | ||
+#endif | ||
#include "platform/Thread.h" | ||
#include "platform/Log.h" | ||
#include "platform/TimeStamp.h" | ||
@@ -217,7 +219,7 @@ m_nonceReportSentAttempt( 0 ) | ||
// Initilize the Network Keys | ||
|
||
initNetworkKeys(false); | ||
- | ||
+#ifndef NOLIBUDEV | ||
if( ControllerInterface_Hid == _interface ) | ||
{ | ||
m_controller = new HidController(); | ||
@@ -226,6 +228,9 @@ m_nonceReportSentAttempt( 0 ) | ||
{ | ||
m_controller = new SerialController(); | ||
} | ||
+#else | ||
+ m_controller = new SerialController(); | ||
+#endif | ||
m_controller->SetSignalThreshold( 1 ); | ||
|
||
Options::Get()->GetOptionAsBool( "NotifyTransactions", &m_notifytransactions ); | ||
diff --git a/cpp/src/platform/unix/SerialControllerImpl.cpp b/cpp/src/platform/unix/SerialControllerImpl.cpp | ||
index d95f848..005902b 100644 | ||
--- cpp/src/platform/unix/SerialControllerImpl.cpp | ||
+++ cpp/src/platform/unix/SerialControllerImpl.cpp | ||
@@ -33,7 +33,7 @@ | ||
#include "SerialControllerImpl.h" | ||
#include "platform/Log.h" | ||
|
||
-#ifdef __linux__ | ||
+#if defined (__linux__) && ! defined (NOLIBUDEV) | ||
#include <libudev.h> | ||
#endif | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Patch looks good, can you submit it upstream? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. already done: OpenZWave/open-zwave#600 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
PKG_NAME = pl2303 | ||
PKG_DIR = $(PKG_NAME) | ||
|
||
DOWNLOAD_TARGET = kernel | ||
|
||
REQ_KERNEL = 1 | ||
|
||
HOMEPAGE = http://sourceforge.net/projects/dsgpl/ | ||
COMMENT = pl2303 USB to UART Bridge VCP Drivers | ||
LICENSE = GNU GPL | ||
|
||
CONFIGURE_TARGET = nope | ||
COMPILE_TARGET = myCompile | ||
INSTALL_TARGET = myInstall | ||
|
||
include ../../mk/spksrc.cross-cc.mk | ||
|
||
.PHONY: myCompile | ||
myCompile: | ||
@mkdir -p $(WORK_DIR)/$(PKG_DIR) | ||
@echo "obj-m += pl2303.o" > $(WORK_DIR)/$(PKG_DIR)/Makefile | ||
@cp $(KERNEL_DIR)/drivers/usb/serial/pl2303.c $(WORK_DIR)/$(PKG_DIR)/ | ||
@cp $(KERNEL_DIR)/drivers/usb/serial/pl2303.h $(WORK_DIR)/$(PKG_DIR)/ | ||
CPPFLAGS="" CFLAGS="" LDFLAGS="" \ | ||
make -C $(KERNEL_DIR) SUBDIRS=$(WORK_DIR)/$(PKG_DIR) modules | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
|
||
.PHONY: myInstall | ||
myInstall: | ||
mkdir -p $(STAGING_INSTALL_PREFIX)/modules | ||
install -m 755 $(WORK_DIR)/$(PKG_DIR)/$(PKG_NAME).ko $(STAGING_INSTALL_PREFIX)/modules/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rsc:modules/pl2303.ko |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't seem like cross compilation to me. Does that work on arm/ppc? Can you explain?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know exactly how this works, I copied it from @Decipher. This was tested for multiple archs as discussed in #1478.