gnu: Add OpenZWave.
[jackhill/guix/guix.git] / gnu / packages / zwave.scm
CommitLineData
758ffc23
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2019 Ludovic Courtès <ludo@gnu.org>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages zwave)
20 #:use-module (guix packages)
21 #:use-module ((guix licenses) #:prefix license:)
22 #:use-module (guix git-download)
23 #:use-module (guix build-system gnu)
24 #:use-module (gnu packages base)
25 #:use-module (gnu packages linux)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages xml))
28
29(define-public open-zwave
30 (package
31 (name "open-zwave")
32 (version "1.6")
33 (source (origin
34 (method git-fetch)
35 (uri (git-reference
36 (url "https://github.com/OpenZWave/open-zwave/")
37 (commit (string-append "v" version))))
38 (file-name (git-file-name name version))
39 (sha256
40 (base32
41 "0xgs4mmr0480c269wx9xkk67ikjzxkh8xcssrdx0f5xcl1lyd333"))
42 (modules '((guix build utils)))
43 (snippet
44 '(begin
45 ;; Set RUNPATH on the 'MinOZW' executable.
46 (substitute* "cpp/examples/MinOZW/Makefile"
47 (("\\$\\(LDFLAGS\\)")
48 "$(LDFLAGS) -Wl,-rpath=$(PREFIX)/lib"))
49
50 ;; Delete the bundled TinyXML.
51 (delete-file-recursively "cpp/tinyxml")
52 (substitute* "cpp/build/Makefile"
53 (("LIBS \\+= -ludev")
54 "LIBS += -ludev -ltinyxml "))
55 #t))))
56 (build-system gnu-build-system)
57 (arguments
58 '(#:phases (modify-phases %standard-phases
59 (delete 'configure)) ;no 'configure' script
60
61 #:make-flags (list "BUILD=debug"
62 (string-append "PREFIX="
63 (assoc-ref %outputs "out"))
64 (string-append "pkgconfigdir="
65 (assoc-ref %outputs "out")
66 "/lib/pkgconfig"))
67
68 ;; "make check" and "make fulltest" are only concerned with checking
69 ;; the device XML database and it's not entirely clear what to get from
70 ;; them.
71 #:tests? #f))
72 (native-inputs `(("which" ,which)
73 ("perl" ,perl) ;for tests
74 ("perl-xml-simple" ,perl-xml-simple)))
75 (inputs `(("tinyxml" ,tinyxml)
76 ("eudev" ,eudev)))
77 (home-page "http://www.openzwave.net/")
78 (synopsis "Access Z-Wave devices from C++ programs")
79 (description
80 "OpenZWave (or OZW) is a C++ library that interfaces with selected Z-Wave
81PC controllers. It allows developers to create applications that manipulate
82and respond to devices on a Z-Wave network, without requiring in-depth
83knowledge of the Z-Wave protocol.")
84 (license license:lgpl3+)))