diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2016-03-29 09:06:09 +0200 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2016-04-17 21:48:51 +0200 |
| commit | fac34dfe2a576907bf9f612d8ed8f4e9dee826be (patch) | |
| tree | f584eab701cf6746ea9e80cf6547650c12f5c194 | |
| parent | d99f6ffb4caa66fd070297838fdb6593b5c80e2d (diff) | |
gnu: Add python-pyusb.
* gnu/packages/libusb.scm (python-pyusb, python2-pyusb): New variables.
| -rw-r--r-- | gnu/packages/libusb.scm | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm index 61136791d36..1e72442c734 100644 --- a/gnu/packages/libusb.scm +++ b/gnu/packages/libusb.scm | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> | 2 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> |
| 3 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> | 3 | ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr> |
| 4 | ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> | 4 | ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com> |
| 5 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | 5 | ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net> |
| 6 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> | 6 | ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> |
| 7 | ;;; | 7 | ;;; |
| 8 | ;;; This file is part of GNU Guix. | 8 | ;;; This file is part of GNU Guix. |
| @@ -28,11 +28,13 @@ | |||
| 28 | #:use-module (guix download) | 28 | #:use-module (guix download) |
| 29 | #:use-module (guix build-system gnu) | 29 | #:use-module (guix build-system gnu) |
| 30 | #:use-module (guix build-system glib-or-gtk) | 30 | #:use-module (guix build-system glib-or-gtk) |
| 31 | #:use-module (guix build-system python) | ||
| 31 | #:use-module (gnu packages gnupg) | 32 | #:use-module (gnu packages gnupg) |
| 32 | #:use-module (gnu packages gtk) | 33 | #:use-module (gnu packages gtk) |
| 33 | #:use-module (gnu packages linux) | 34 | #:use-module (gnu packages linux) |
| 34 | #:use-module (gnu packages mp3) | 35 | #:use-module (gnu packages mp3) |
| 35 | #:use-module (gnu packages pkg-config) | 36 | #:use-module (gnu packages pkg-config) |
| 37 | #:use-module (gnu packages python) | ||
| 36 | #:use-module (gnu packages xiph)) | 38 | #:use-module (gnu packages xiph)) |
| 37 | 39 | ||
| 38 | (define-public libusb | 40 | (define-public libusb |
| @@ -87,6 +89,49 @@ devices on various operating systems.") | |||
| 87 | version of libusb to run with newer libusb.") | 89 | version of libusb to run with newer libusb.") |
| 88 | (license lgpl2.1+))) | 90 | (license lgpl2.1+))) |
| 89 | 91 | ||
| 92 | (define-public python-pyusb | ||
| 93 | (package | ||
| 94 | (name "python-pyusb") | ||
| 95 | (version "1.0.0rc1") | ||
| 96 | (source | ||
| 97 | (origin | ||
| 98 | (method url-fetch) | ||
| 99 | (uri (pypi-uri "pyusb" version)) | ||
| 100 | (sha256 | ||
| 101 | (base32 | ||
| 102 | "07cjq11qhngzjd746k7688s6y2x7lpj669fxqfsiy985rg0jsn7j")))) | ||
| 103 | (build-system python-build-system) | ||
| 104 | (arguments | ||
| 105 | `(#:tests? #f ;no tests | ||
| 106 | #:modules ((srfi srfi-26) | ||
| 107 | (guix build utils) | ||
| 108 | (guix build python-build-system)) | ||
| 109 | #:phases | ||
| 110 | (modify-phases %standard-phases | ||
| 111 | (add-after 'unpack 'fix-libusb-reference | ||
| 112 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 113 | (substitute* "usb/libloader.py" | ||
| 114 | (("lib = locate_library\\(candidates, find_library\\)") | ||
| 115 | (string-append | ||
| 116 | "lib = \"" | ||
| 117 | (car (find-files (assoc-ref inputs "libusb") | ||
| 118 | (lambda (file stat) | ||
| 119 | (and ((file-name-predicate | ||
| 120 | "^libusb-.*\\.so\\..*") file stat) | ||
| 121 | (not (symbolic-link? file)))))) | ||
| 122 | "\""))) | ||
| 123 | #t))))) | ||
| 124 | (inputs | ||
| 125 | `(("libusb" ,libusb))) | ||
| 126 | (home-page "http://walac.github.io/pyusb/") | ||
| 127 | (synopsis "Python bindings to the libusb library") | ||
| 128 | (description | ||
| 129 | "PyUSB aims to be an easy to use Python module to access USB devices.") | ||
| 130 | (license bsd-3))) | ||
| 131 | |||
| 132 | (define-public python2-pyusb | ||
| 133 | (package-with-python2 python-pyusb)) | ||
| 134 | |||
| 90 | (define-public libmtp | 135 | (define-public libmtp |
| 91 | (package | 136 | (package |
| 92 | (name "libmtp") | 137 | (name "libmtp") |
