[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/04: gnu: open-zwave: Unbundle hidapi.
From: |
guix-commits |
Subject: |
01/04: gnu: open-zwave: Unbundle hidapi. |
Date: |
Mon, 17 Jun 2019 06:36:20 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 123b9c02dddd21b61858fbf01fb356c14f220f21
Author: Ludovic Courtès <address@hidden>
Date: Sun Jun 16 15:22:15 2019 +0200
gnu: open-zwave: Unbundle hidapi.
* gnu/packages/patches/open-zwave-hidapi.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/zwave.scm (open-zwave)[source](patches): New field.
(snippet): Delete 'cpp/hidapi'.
[native-inputs]: Add PKG-CONFIG.
[inputs]: Add HIDAPI.
---
gnu/local.mk | 1 +
gnu/packages/patches/open-zwave-hidapi.patch | 15 +++++++++++++++
gnu/packages/zwave.scm | 9 +++++++++
3 files changed, 25 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index da3245e..74d2baf 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1130,6 +1130,7 @@ dist_patch_DATA =
\
%D%/packages/patches/openssl-1.1-c-rehash-in.patch \
%D%/packages/patches/openssl-c-rehash-in.patch \
%D%/packages/patches/openssl-CVE-2019-1559.patch \
+ %D%/packages/patches/open-zwave-hidapi.patch \
%D%/packages/patches/orpheus-cast-errors-and-includes.patch \
%D%/packages/patches/osip-CVE-2017-7853.patch \
%D%/packages/patches/ots-no-include-missing-file.patch \
diff --git a/gnu/packages/patches/open-zwave-hidapi.patch
b/gnu/packages/patches/open-zwave-hidapi.patch
new file mode 100644
index 0000000..fc50bfe
--- /dev/null
+++ b/gnu/packages/patches/open-zwave-hidapi.patch
@@ -0,0 +1,15 @@
+Build against the system's HIDAPI instead of the bundled one.
+
+--- open-zwave-1.6-checkout/cpp/build/support.mk 2019-06-16
15:15:34.258331628 +0200
++++ open-zwave-1.6-checkout/cpp/build/support.mk 2019-06-16
15:15:54.698249462 +0200
+@@ -86,6 +86,10 @@ endif
+ endif
+ SED := sed
+
++# Build against the system's HIDAPI.
++CPPFLAGS += $(shell pkg-config hidapi-libusb --cflags)
++LDFLAGS += $(shell pkg-config hidapi-libusb --libs)
++
+ #determine if we are release or debug Build and set appropriate flags
+ ifeq ($(BUILD), release)
+ CFLAGS += -c $(RELEASE_CFLAGS)
diff --git a/gnu/packages/zwave.scm b/gnu/packages/zwave.scm
index 43d1747..f07367d 100644
--- a/gnu/packages/zwave.scm
+++ b/gnu/packages/zwave.scm
@@ -21,9 +21,12 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
+ #:use-module (gnu packages)
#:use-module (gnu packages base)
+ #:use-module (gnu packages libusb)
#:use-module (gnu packages linux)
#:use-module (gnu packages perl)
+ #:use-module (gnu packages pkg-config)
#:use-module (gnu packages xml))
(define-public open-zwave
@@ -39,6 +42,7 @@
(sha256
(base32
"0xgs4mmr0480c269wx9xkk67ikjzxkh8xcssrdx0f5xcl1lyd333"))
+ (patches (search-patches "open-zwave-hidapi.patch"))
(modules '((guix build utils)))
(snippet
'(begin
@@ -52,6 +56,9 @@
(substitute* "cpp/build/Makefile"
(("LIBS \\+= -ludev")
"LIBS += -ludev -ltinyxml "))
+
+ ;; Delete the bundled HIDAPI.
+ (delete-file-recursively "cpp/hidapi")
#t))))
(build-system gnu-build-system)
(arguments
@@ -70,9 +77,11 @@
;; them.
#:tests? #f))
(native-inputs `(("which" ,which)
+ ("pkg-config" ,pkg-config)
("perl" ,perl) ;for tests
("perl-xml-simple" ,perl-xml-simple)))
(inputs `(("tinyxml" ,tinyxml)
+ ("hidapi" ,hidapi)
("eudev" ,eudev)))
(home-page "http://www.openzwave.net/")
(synopsis "Access Z-Wave devices from C++ programs")