Commit | Line | Data |
---|---|---|
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) | |
123b9c02 | 24 | #:use-module (gnu packages) |
758ffc23 | 25 | #:use-module (gnu packages base) |
123b9c02 | 26 | #:use-module (gnu packages libusb) |
758ffc23 LC |
27 | #:use-module (gnu packages linux) |
28 | #:use-module (gnu packages perl) | |
123b9c02 | 29 | #:use-module (gnu packages pkg-config) |
758ffc23 LC |
30 | #:use-module (gnu packages xml)) |
31 | ||
32 | (define-public open-zwave | |
33 | (package | |
34 | (name "open-zwave") | |
35 | (version "1.6") | |
36 | (source (origin | |
37 | (method git-fetch) | |
38 | (uri (git-reference | |
39 | (url "https://github.com/OpenZWave/open-zwave/") | |
40 | (commit (string-append "v" version)))) | |
41 | (file-name (git-file-name name version)) | |
42 | (sha256 | |
43 | (base32 | |
44 | "0xgs4mmr0480c269wx9xkk67ikjzxkh8xcssrdx0f5xcl1lyd333")) | |
123b9c02 | 45 | (patches (search-patches "open-zwave-hidapi.patch")) |
758ffc23 LC |
46 | (modules '((guix build utils))) |
47 | (snippet | |
48 | '(begin | |
49 | ;; Set RUNPATH on the 'MinOZW' executable. | |
50 | (substitute* "cpp/examples/MinOZW/Makefile" | |
51 | (("\\$\\(LDFLAGS\\)") | |
52 | "$(LDFLAGS) -Wl,-rpath=$(PREFIX)/lib")) | |
53 | ||
e8fc56a3 LC |
54 | ;; XXX: There's a bundled TinyXML under cpp/tinyxml. Keep |
55 | ;; it because using our own TinyXML leads to double-free | |
56 | ;; down the road. | |
123b9c02 LC |
57 | |
58 | ;; Delete the bundled HIDAPI. | |
59 | (delete-file-recursively "cpp/hidapi") | |
758ffc23 LC |
60 | #t)))) |
61 | (build-system gnu-build-system) | |
62 | (arguments | |
63 | '(#:phases (modify-phases %standard-phases | |
64 | (delete 'configure)) ;no 'configure' script | |
65 | ||
66 | #:make-flags (list "BUILD=debug" | |
67 | (string-append "PREFIX=" | |
68 | (assoc-ref %outputs "out")) | |
69 | (string-append "pkgconfigdir=" | |
70 | (assoc-ref %outputs "out") | |
71 | "/lib/pkgconfig")) | |
72 | ||
73 | ;; "make check" and "make fulltest" are only concerned with checking | |
74 | ;; the device XML database and it's not entirely clear what to get from | |
75 | ;; them. | |
76 | #:tests? #f)) | |
77 | (native-inputs `(("which" ,which) | |
123b9c02 | 78 | ("pkg-config" ,pkg-config) |
758ffc23 LC |
79 | ("perl" ,perl) ;for tests |
80 | ("perl-xml-simple" ,perl-xml-simple))) | |
e8fc56a3 | 81 | (inputs `(("hidapi" ,hidapi) |
758ffc23 LC |
82 | ("eudev" ,eudev))) |
83 | (home-page "http://www.openzwave.net/") | |
84 | (synopsis "Access Z-Wave devices from C++ programs") | |
85 | (description | |
86 | "OpenZWave (or OZW) is a C++ library that interfaces with selected Z-Wave | |
87 | PC controllers. It allows developers to create applications that manipulate | |
88 | and respond to devices on a Z-Wave network, without requiring in-depth | |
89 | knowledge of the Z-Wave protocol.") | |
90 | (license license:lgpl3+))) |