[packages/vrpn] - added modbus patch (libmodbus detection and usage fixes), enabled modbus support

qboosh qboosh at pld-linux.org
Sat Dec 27 21:54:08 CET 2014


commit 61bf55c68891329de5c3c53d3e1177f857a61e0b
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Dec 27 21:55:14 2014 +0100

    - added modbus patch (libmodbus detection and usage fixes), enabled modbus support

 vrpn-modbus.patch | 40 ++++++++++++++++++++++++++++++++++++++++
 vrpn.spec         |  7 ++++++-
 2 files changed, 46 insertions(+), 1 deletion(-)
---
diff --git a/vrpn.spec b/vrpn.spec
index 46f073b..c1fd7b0 100644
--- a/vrpn.spec
+++ b/vrpn.spec
@@ -1,9 +1,10 @@
-# TODO: modbus, system hidapi, openhaptics, ghost, wiiuse(GPL v3), libnifalcon, intersense, nidaqmx, viewpoint, phasespace, libfreespace
+# TODO: openhaptics, ghost, wiiuse(GPL v3), libnifalcon, intersense, nidaqmx, viewpoint, phasespace, libfreespace
 # NATIONAL_INSTRUMENTS, NIDAQ, USDIGITAL, MICROSCRIBE, MONITONNODE, TRIVISIOCOLIBRI ???
 #
 # Conditional build:
 %bcond_without	apidocs		# do not build and package API docs
 %bcond_without	gpm		# GPM Linux mouse interface support (GPL v2+)
+%bcond_without	modbus		# Modbus support
 %bcond_with	mpi		# MPI support
 %bcond_without	java		# Java binding
 #
@@ -20,6 +21,7 @@ Source0:	http://www.cs.unc.edu/Research/vrpn/downloads/%{name}_%{fver}.zip
 # Source0-md5:	6cb32e51e6420385f2006f1aae58b457
 Patch0:		%{name}-install.patch
 Patch1:		%{name}-jsoncpp.patch
+Patch2:		%{name}-modbus.patch
 URL:		http://www.cs.unc.edu/Research/vrpn/
 BuildRequires:	cmake >= 2.8.3
 %{?with_apidocs:BuildRequires:	doxygen}
@@ -27,6 +29,7 @@ BuildRequires:	cmake >= 2.8.3
 BuildRequires:	hidapi-devel >= 0.7.0
 BuildRequires:	jdk
 BuildRequires:	jsoncpp-devel >= 0.7.0
+%{?with_modbus:BuildRequires:	libmodbus-devel}
 BuildRequires:	libstdc++-devel
 BuildRequires:	libusb-devel >= 1.0
 %{?with_mpi:BuildRequires:	mpi-devel}
@@ -118,6 +121,7 @@ Wiązania Pythona do bibliotek VRPN.
 %setup -q -n %{name}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 install -d build
@@ -128,6 +132,7 @@ cd build
 	-DVRPN_USE_GPM_MOUSE=%{?with_gpm:ON}%{!?with_gpm:OFF} \
 	-DVRPN_USE_LOCAL_HIDAPI=OFF \
 	-DVRPN_USE_LOCAL_JSONCPP=OFF \
+	%{?with_modbus:-DVRPN_USE_MODBUS=ON} \
 	-DVRPN_USE_MPI=%{?with_mpi:ON}%{!?with_mpi:OFF} \
 	-DVRPN_BUILD_PYTHON=ON
 
diff --git a/vrpn-modbus.patch b/vrpn-modbus.patch
new file mode 100644
index 0000000..86a5cd0
--- /dev/null
+++ b/vrpn-modbus.patch
@@ -0,0 +1,40 @@
+--- vrpn/cmake/FindModbus.cmake.orig	2014-11-15 20:29:36.000000000 +0100
++++ vrpn/cmake/FindModbus.cmake	2014-12-27 20:17:25.953165184 +0100
+@@ -46,6 +46,7 @@
+ 	"${MODBUS_ROOT_DIR}"
+ 	PATH_SUFFIXES
+ 	include
++	include/modbus
+ 	PATHS
+ 	"${_progfiles}/libmodbus"
+ 	C:/usr/local
+@@ -54,6 +55,7 @@
+ # Look for the library.
+ find_library(MODBUS_LIBRARY
+ 	NAMES
++	modbus
+ 	libmodbus.lib
+ 	libmodbus.a
+ 	HINTS
+--- vrpn/vrpn_OmegaTemperature.h.orig	2014-11-15 20:29:37.000000000 +0100
++++ vrpn/vrpn_OmegaTemperature.h	2014-12-27 21:09:49.579699911 +0100
+@@ -31,7 +31,7 @@
+ #	2	Turn temperature control on/off (0 = off, otherwise on)
+ */
+ 
+-#if defined(VRPN_USE_MODBUS) && defined(VRPN_USE_WINSOCK2)
++#if defined(VRPN_USE_MODBUS)
+ #include <modbus.h>
+ 
+ class VRPN_API vrpn_OmegaTemperature: public vrpn_Serial_Analog,
+--- vrpn/vrpn_OmegaTemperature.C.orig	2014-11-15 20:29:37.000000000 +0100
++++ vrpn/vrpn_OmegaTemperature.C	2014-12-27 21:09:12.179701499 +0100
+@@ -72,7 +72,7 @@
+ 
+ VRPN_SUPPRESS_EMPTY_OBJECT_WARNING()
+ 
+-#if defined(VRPN_USE_MODBUS) && defined(VRPN_USE_WINSOCK2)
++#if defined(VRPN_USE_MODBUS)
+ 
+ #undef VERBOSE
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/vrpn.git/commitdiff/61bf55c68891329de5c3c53d3e1177f857a61e0b



More information about the pld-cvs-commit mailing list