1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
3 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
5 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
6 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages libusb)
24 #:use-module (gnu packages)
25 #:use-module (guix licenses)
26 #:use-module (guix packages)
27 #:use-module (guix utils)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system glib-or-gtk)
31 #:use-module (guix build-system python)
32 #:use-module (gnu packages gnupg)
33 #:use-module (gnu packages gtk)
34 #:use-module (gnu packages linux)
35 #:use-module (gnu packages mp3)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages python)
38 #:use-module (gnu packages xiph))
47 (uri (string-append "mirror://sourceforge/libusb/libusb-1.0/"
48 "libusb-" version "/libusb-" version ".tar.bz2"))
51 "0h38p9rxfpg9vkrbyb120i1diq57qcln82h5fr7hvy82c20jql3c"))))
52 (build-system gnu-build-system)
54 ;; XXX: Enabling udev is now recommended, but eudev indirectly depends on
56 (arguments `(#:configure-flags '("--disable-udev")))
57 ;; (inputs `(("eudev" ,eudev)))
59 (home-page "http://www.libusb.org")
60 (synopsis "User-space USB library")
62 "Libusb is a library that gives applications easy access to USB
63 devices on various operating systems.")
66 (define-public libusb-compat
68 (name "libusb-compat")
73 (uri (string-append "mirror://sourceforge/libusb/"
74 name "-" (version-major+minor version) "/"
76 name "-" version ".tar.bz2"))
79 "0nn5icrfm9lkhzw1xjvaks9bq3w6mjg86ggv3fn7kgi4nfvg8kj0"))))
80 (build-system gnu-build-system)
82 `(("pkg-config" ,pkg-config)))
84 `(("libusb" ,libusb)))
85 (home-page "http://www.libusb.org")
86 (synopsis "Compatibility shim for libusb")
88 "Libusb-compat provides a shim allowing applications based on older
89 version of libusb to run with newer libusb.")
92 (define-public python-pyusb
99 (uri (pypi-uri "pyusb" version))
102 "07cjq11qhngzjd746k7688s6y2x7lpj669fxqfsiy985rg0jsn7j"))))
103 (build-system python-build-system)
105 `(#:tests? #f ;no tests
106 #:modules ((srfi srfi-26)
108 (guix build python-build-system))
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\\)")
117 (car (find-files (assoc-ref inputs "libusb")
119 (and ((file-name-predicate
120 "^libusb-.*\\.so\\..*") file stat)
121 (not (symbolic-link? file))))))
125 `(("libusb" ,libusb)))
126 (home-page "http://walac.github.io/pyusb/")
127 (synopsis "Python bindings to the libusb library")
129 "PyUSB aims to be an easy to use Python module to access USB devices.")
132 (define-public python2-pyusb
133 (package-with-python2 python-pyusb))
135 (define-public libmtp
141 (uri (string-append "mirror://sourceforge/libmtp/" version
142 "/libmtp-" version ".tar.gz"))
145 "12dinqic0ljnhrwx3rc61jc7q24ybr0mckc2ya5kh1s1np0d7w93"))
146 (patches (search-patches "libmtp-devices.patch"))))
147 (build-system gnu-build-system)
149 `(("pkg-config" ,pkg-config)))
151 ;; libmtp.pc refers to all these.
152 `(("libgcrypt" ,libgcrypt)
156 (list (string-append "--with-udev="
157 (assoc-ref %outputs "out")
159 (home-page "http://libmtp.sourceforge.net/")
160 (synopsis "Library implementing the Media Transfer Protocol")
161 (description "Libmtp implements an MTP (Media Transfer Protocol)
162 initiator, which means that it initiates MTP sessions with devices. The
163 devices responding are known as MTP responders. Libmtp runs on devices
164 with a USB host controller interface. It implements MTP Basic, which was
165 proposed for standardization.")
166 ;; COPYING contains lgpl2.1, while files headers give
167 ;; "GNU Lesser General Public License as published by the Free Software
168 ;; Foundation; either version 2 of the License, or (at your option) any
178 (uri (string-append "mirror://sourceforge/gmtp/" version
179 "/gmtp-" version ".tar.gz"))
182 "0fyi3pdl2g57vr0p46ip2wwzyap3l0by7iqaqygv0yxfcs79l6xj"))))
183 (build-system glib-or-gtk-build-system)
186 (let ((libid3tag (assoc-ref %build-inputs "libid3tag")))
188 ;; libid3tag provides no .pc file, so pkg-config fails to find them.
189 (string-append "ID3TAG_CFLAGS=-I" libid3tag "/include")
190 (string-append "ID3TAG_LIBS=-L" libid3tag "/lib -lid3tag -lz")))))
194 ("libvorbis" ,libvorbis)
195 ("libid3tag" ,libid3tag)
198 `(("pkg-config" ,pkg-config)))
199 (home-page "http://gmtp.sourceforge.net/")
200 (synopsis "Simple graphical MTP client")
201 (description "gMTP is a simple graphical client for the Media Transfer Protocol
202 (MTP), which allows media files to be transferred to and from many portable