zwave.scm 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. (define-module (gnu packages zwave)
  19. #:use-module (guix packages)
  20. #:use-module ((guix licenses) #:prefix license:)
  21. #:use-module (guix git-download)
  22. #:use-module (guix build-system gnu)
  23. #:use-module (gnu packages)
  24. #:use-module (gnu packages base)
  25. #:use-module (gnu packages libusb)
  26. #:use-module (gnu packages linux)
  27. #:use-module (gnu packages perl)
  28. #:use-module (gnu packages pkg-config)
  29. #:use-module (gnu packages xml))
  30. (define-public open-zwave
  31. (package
  32. (name "open-zwave")
  33. (version "1.6")
  34. (source (origin
  35. (method git-fetch)
  36. (uri (git-reference
  37. (url "https://github.com/OpenZWave/open-zwave/")
  38. (commit (string-append "v" version))))
  39. (file-name (git-file-name name version))
  40. (sha256
  41. (base32
  42. "0xgs4mmr0480c269wx9xkk67ikjzxkh8xcssrdx0f5xcl1lyd333"))
  43. (patches (search-patches "open-zwave-hidapi.patch"))
  44. (modules '((guix build utils)))
  45. (snippet
  46. '(begin
  47. ;; Set RUNPATH on the 'MinOZW' executable.
  48. (substitute* "cpp/examples/MinOZW/Makefile"
  49. (("\\$\\(LDFLAGS\\)")
  50. "$(LDFLAGS) -Wl,-rpath=$(PREFIX)/lib"))
  51. ;; XXX: There's a bundled TinyXML under cpp/tinyxml. Keep
  52. ;; it because using our own TinyXML leads to double-free
  53. ;; down the road.
  54. ;; Delete the bundled HIDAPI.
  55. (delete-file-recursively "cpp/hidapi")
  56. #t))))
  57. (build-system gnu-build-system)
  58. (arguments
  59. '(#:phases (modify-phases %standard-phases
  60. (delete 'configure)) ;no 'configure' script
  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. ;; "make check" and "make fulltest" are only concerned with checking
  68. ;; the device XML database and it's not entirely clear what to get from
  69. ;; them.
  70. #:tests? #f))
  71. (native-inputs `(("which" ,which)
  72. ("pkg-config" ,pkg-config)
  73. ("perl" ,perl) ;for tests
  74. ("perl-xml-simple" ,perl-xml-simple)))
  75. (inputs `(("hidapi" ,hidapi)
  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
  81. PC controllers. It allows developers to create applications that manipulate
  82. and respond to devices on a Z-Wave network, without requiring in-depth
  83. knowledge of the Z-Wave protocol.")
  84. (license license:lgpl3+)))