gnu: Add gdb-arm-none-eabi.
[jackhill/guix/guix.git] / gnu / packages / libusb.scm
CommitLineData
233e7676
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
75be6b7c 3;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
e0477b73 4;;; Copyright © 2015 Andy Wingo <wingo@igalia.com>
fac34dfe 5;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
50637966 6;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
3b48f78c 7;;;
233e7676 8;;; This file is part of GNU Guix.
3b48f78c 9;;;
233e7676 10;;; GNU Guix is free software; you can redistribute it and/or modify it
3b48f78c
NK
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.
14;;;
233e7676 15;;; GNU Guix is distributed in the hope that it will be useful, but
3b48f78c
NK
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.
19;;;
20;;; You should have received a copy of the GNU General Public License
233e7676 21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
3b48f78c 22
1ffa7090 23(define-module (gnu packages libusb)
59a43334 24 #:use-module (gnu packages)
3b48f78c
NK
25 #:use-module (guix licenses)
26 #:use-module (guix packages)
e0477b73 27 #:use-module (guix utils)
3b48f78c 28 #:use-module (guix download)
75be6b7c 29 #:use-module (guix build-system gnu)
3d3caf1f 30 #:use-module (guix build-system glib-or-gtk)
fac34dfe 31 #:use-module (guix build-system python)
75be6b7c 32 #:use-module (gnu packages gnupg)
3d3caf1f 33 #:use-module (gnu packages gtk)
034e0d50 34 #:use-module (gnu packages linux)
3d3caf1f
RW
35 #:use-module (gnu packages mp3)
36 #:use-module (gnu packages pkg-config)
fac34dfe 37 #:use-module (gnu packages python)
3d3caf1f 38 #:use-module (gnu packages xiph))
3b48f78c
NK
39
40(define-public libusb
41 (package
42 (name "libusb")
034e0d50 43 (version "1.0.19")
3b48f78c
NK
44 (source
45 (origin
46 (method url-fetch)
47 (uri (string-append "mirror://sourceforge/libusb/libusb-1.0/"
48 "libusb-" version "/libusb-" version ".tar.bz2"))
49 (sha256
50 (base32
034e0d50 51 "0h38p9rxfpg9vkrbyb120i1diq57qcln82h5fr7hvy82c20jql3c"))))
3b48f78c 52 (build-system gnu-build-system)
034e0d50
LC
53
54 ;; XXX: Enabling udev is now recommended, but eudev indirectly depends on
55 ;; libusb.
56 (arguments `(#:configure-flags '("--disable-udev")))
57 ;; (inputs `(("eudev" ,eudev)))
58
3b48f78c 59 (home-page "http://www.libusb.org")
35b9e423 60 (synopsis "User-space USB library")
3b48f78c
NK
61 (description
62 "Libusb is a library that gives applications easy access to USB
63devices on various operating systems.")
75be6b7c
AE
64 (license lgpl2.1+)))
65
e0477b73
AW
66(define-public libusb-compat
67 (package
68 (name "libusb-compat")
69 (version "0.1.5")
70 (source
71 (origin
72 (method url-fetch)
73 (uri (string-append "mirror://sourceforge/libusb/"
74 name "-" (version-major+minor version) "/"
75 name "-" version "/"
76 name "-" version ".tar.bz2"))
77 (sha256
78 (base32
79 "0nn5icrfm9lkhzw1xjvaks9bq3w6mjg86ggv3fn7kgi4nfvg8kj0"))))
80 (build-system gnu-build-system)
81 (native-inputs
82 `(("pkg-config" ,pkg-config)))
83 (inputs
84 `(("libusb" ,libusb)))
85 (home-page "http://www.libusb.org")
86 (synopsis "Compatibility shim for libusb")
87 (description
88 "Libusb-compat provides a shim allowing applications based on older
89version of libusb to run with newer libusb.")
90 (license lgpl2.1+)))
91
fac34dfe
RW
92(define-public python-pyusb
93 (package
94 (name "python-pyusb")
a0b15f5e 95 (version "1.0.0")
fac34dfe
RW
96 (source
97 (origin
98 (method url-fetch)
a0b15f5e 99 (uri (pypi-uri "PyUSB" version))
fac34dfe
RW
100 (sha256
101 (base32
a0b15f5e 102 "0s2k4z06fapd5vp1gnrlf8a9sjpc03p9974lzw5k6ky39akzyd2v"))))
fac34dfe
RW
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
75be6b7c
AE
135(define-public libmtp
136 (package
137 (name "libmtp")
0e6ee10c 138 (version "1.1.11")
75be6b7c
AE
139 (source (origin
140 (method url-fetch)
de67e922 141 (uri (string-append "mirror://sourceforge/libmtp/libmtp/" version
75be6b7c
AE
142 "/libmtp-" version ".tar.gz"))
143 (sha256
0e6ee10c
RW
144 (base32
145 "1sc768q2cixwanlwrz95mp389iaadl4s95486caavxx4g7znvn8m"))))
75be6b7c
AE
146 (build-system gnu-build-system)
147 (native-inputs
148 `(("pkg-config" ,pkg-config)))
cff77d48
SB
149 (propagated-inputs
150 ;; libmtp.pc refers to all these.
75be6b7c
AE
151 `(("libgcrypt" ,libgcrypt)
152 ("libusb" ,libusb)))
153 (arguments
154 `(#:configure-flags
155 (list (string-append "--with-udev="
156 (assoc-ref %outputs "out")
157 "/lib/udev"))))
158 (home-page "http://libmtp.sourceforge.net/")
159 (synopsis "Library implementing the Media Transfer Protocol")
160 (description "Libmtp implements an MTP (Media Transfer Protocol)
161initiator, which means that it initiates MTP sessions with devices. The
162devices responding are known as MTP responders. Libmtp runs on devices
163with a USB host controller interface. It implements MTP Basic, which was
164proposed for standardization.")
165 ;; COPYING contains lgpl2.1, while files headers give
166 ;; "GNU Lesser General Public License as published by the Free Software
167 ;; Foundation; either version 2 of the License, or (at your option) any
168 ;; later version."
169 (license lgpl2.1+)))
3d3caf1f
RW
170
171(define-public gmtp
172 (package
173 (name "gmtp")
50637966 174 (version "1.3.10")
3d3caf1f
RW
175 (source (origin
176 (method url-fetch)
de67e922 177 (uri (string-append "mirror://sourceforge/gmtp/gMTP-" version
3d3caf1f
RW
178 "/gmtp-" version ".tar.gz"))
179 (sha256
180 (base32
50637966 181 "0fyi3pdl2g57vr0p46ip2wwzyap3l0by7iqaqygv0yxfcs79l6xj"))))
3d3caf1f
RW
182 (build-system glib-or-gtk-build-system)
183 (arguments
184 '(#:configure-flags
185 (let ((libid3tag (assoc-ref %build-inputs "libid3tag")))
186 (list
187 ;; libid3tag provides no .pc file, so pkg-config fails to find them.
188 (string-append "ID3TAG_CFLAGS=-I" libid3tag "/include")
189 (string-append "ID3TAG_LIBS=-L" libid3tag "/lib -lid3tag -lz")))))
190 (inputs
191 `(("gtk+" ,gtk+)
192 ("flac" ,flac)
193 ("libvorbis" ,libvorbis)
194 ("libid3tag" ,libid3tag)
195 ("libmtp" ,libmtp)))
196 (native-inputs
197 `(("pkg-config" ,pkg-config)))
198 (home-page "http://gmtp.sourceforge.net/")
199 (synopsis "Simple graphical MTP client")
200 (description "gMTP is a simple graphical client for the Media Transfer Protocol
201 (MTP), which allows media files to be transferred to and from many portable
202devices.")
203 (license bsd-3)))