gnu: python-pandas: Fix build on 32-bit.
[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>
3d74f12e 7;;; Copyright © 2016 Theodoros Foradis <theodoros.for@openmailbox.org>
3b48f78c 8;;;
233e7676 9;;; This file is part of GNU Guix.
3b48f78c 10;;;
233e7676 11;;; GNU Guix is free software; you can redistribute it and/or modify it
3b48f78c
NK
12;;; under the terms of the GNU General Public License as published by
13;;; the Free Software Foundation; either version 3 of the License, or (at
14;;; your option) any later version.
15;;;
233e7676 16;;; GNU Guix is distributed in the hope that it will be useful, but
3b48f78c
NK
17;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19;;; GNU General Public License for more details.
20;;;
21;;; You should have received a copy of the GNU General Public License
233e7676 22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
3b48f78c 23
1ffa7090 24(define-module (gnu packages libusb)
59a43334 25 #:use-module (gnu packages)
3b48f78c
NK
26 #:use-module (guix licenses)
27 #:use-module (guix packages)
e0477b73 28 #:use-module (guix utils)
3b48f78c 29 #:use-module (guix download)
75be6b7c 30 #:use-module (guix build-system gnu)
3d3caf1f 31 #:use-module (guix build-system glib-or-gtk)
fac34dfe 32 #:use-module (guix build-system python)
3d74f12e 33 #:use-module (gnu packages autotools)
75be6b7c 34 #:use-module (gnu packages gnupg)
3d3caf1f 35 #:use-module (gnu packages gtk)
034e0d50 36 #:use-module (gnu packages linux)
3d3caf1f
RW
37 #:use-module (gnu packages mp3)
38 #:use-module (gnu packages pkg-config)
fac34dfe 39 #:use-module (gnu packages python)
3d3caf1f 40 #:use-module (gnu packages xiph))
3b48f78c
NK
41
42(define-public libusb
43 (package
44 (name "libusb")
034e0d50 45 (version "1.0.19")
3b48f78c
NK
46 (source
47 (origin
48 (method url-fetch)
49 (uri (string-append "mirror://sourceforge/libusb/libusb-1.0/"
50 "libusb-" version "/libusb-" version ".tar.bz2"))
51 (sha256
52 (base32
034e0d50 53 "0h38p9rxfpg9vkrbyb120i1diq57qcln82h5fr7hvy82c20jql3c"))))
3b48f78c 54 (build-system gnu-build-system)
034e0d50
LC
55
56 ;; XXX: Enabling udev is now recommended, but eudev indirectly depends on
57 ;; libusb.
58 (arguments `(#:configure-flags '("--disable-udev")))
59 ;; (inputs `(("eudev" ,eudev)))
60
3b48f78c 61 (home-page "http://www.libusb.org")
35b9e423 62 (synopsis "User-space USB library")
3b48f78c
NK
63 (description
64 "Libusb is a library that gives applications easy access to USB
65devices on various operating systems.")
75be6b7c
AE
66 (license lgpl2.1+)))
67
e0477b73
AW
68(define-public libusb-compat
69 (package
70 (name "libusb-compat")
71 (version "0.1.5")
72 (source
73 (origin
74 (method url-fetch)
75 (uri (string-append "mirror://sourceforge/libusb/"
76 name "-" (version-major+minor version) "/"
77 name "-" version "/"
78 name "-" version ".tar.bz2"))
79 (sha256
80 (base32
81 "0nn5icrfm9lkhzw1xjvaks9bq3w6mjg86ggv3fn7kgi4nfvg8kj0"))))
82 (build-system gnu-build-system)
83 (native-inputs
84 `(("pkg-config" ,pkg-config)))
85 (inputs
86 `(("libusb" ,libusb)))
87 (home-page "http://www.libusb.org")
88 (synopsis "Compatibility shim for libusb")
89 (description
90 "Libusb-compat provides a shim allowing applications based on older
91version of libusb to run with newer libusb.")
92 (license lgpl2.1+)))
93
fac34dfe
RW
94(define-public python-pyusb
95 (package
96 (name "python-pyusb")
a0b15f5e 97 (version "1.0.0")
fac34dfe
RW
98 (source
99 (origin
100 (method url-fetch)
a0b15f5e 101 (uri (pypi-uri "PyUSB" version))
fac34dfe
RW
102 (sha256
103 (base32
a0b15f5e 104 "0s2k4z06fapd5vp1gnrlf8a9sjpc03p9974lzw5k6ky39akzyd2v"))))
fac34dfe
RW
105 (build-system python-build-system)
106 (arguments
107 `(#:tests? #f ;no tests
67a3b2dd
RW
108 #:modules ((srfi srfi-1)
109 (srfi srfi-26)
fac34dfe
RW
110 (guix build utils)
111 (guix build python-build-system))
112 #:phases
113 (modify-phases %standard-phases
114 (add-after 'unpack 'fix-libusb-reference
115 (lambda* (#:key inputs #:allow-other-keys)
116 (substitute* "usb/libloader.py"
117 (("lib = locate_library\\(candidates, find_library\\)")
118 (string-append
119 "lib = \""
67a3b2dd
RW
120 (find (negate symbolic-link?)
121 (find-files (assoc-ref inputs "libusb")
122 "^libusb-.*\\.so\\..*"))
fac34dfe
RW
123 "\"")))
124 #t)))))
125 (inputs
126 `(("libusb" ,libusb)))
127 (home-page "http://walac.github.io/pyusb/")
128 (synopsis "Python bindings to the libusb library")
129 (description
130 "PyUSB aims to be an easy to use Python module to access USB devices.")
131 (license bsd-3)))
132
133(define-public python2-pyusb
134 (package-with-python2 python-pyusb))
135
75be6b7c
AE
136(define-public libmtp
137 (package
138 (name "libmtp")
0e6ee10c 139 (version "1.1.11")
75be6b7c
AE
140 (source (origin
141 (method url-fetch)
de67e922 142 (uri (string-append "mirror://sourceforge/libmtp/libmtp/" version
75be6b7c
AE
143 "/libmtp-" version ".tar.gz"))
144 (sha256
0e6ee10c
RW
145 (base32
146 "1sc768q2cixwanlwrz95mp389iaadl4s95486caavxx4g7znvn8m"))))
75be6b7c
AE
147 (build-system gnu-build-system)
148 (native-inputs
149 `(("pkg-config" ,pkg-config)))
cff77d48
SB
150 (propagated-inputs
151 ;; libmtp.pc refers to all these.
75be6b7c
AE
152 `(("libgcrypt" ,libgcrypt)
153 ("libusb" ,libusb)))
154 (arguments
155 `(#:configure-flags
156 (list (string-append "--with-udev="
157 (assoc-ref %outputs "out")
158 "/lib/udev"))))
159 (home-page "http://libmtp.sourceforge.net/")
160 (synopsis "Library implementing the Media Transfer Protocol")
161 (description "Libmtp implements an MTP (Media Transfer Protocol)
162initiator, which means that it initiates MTP sessions with devices. The
163devices responding are known as MTP responders. Libmtp runs on devices
164with a USB host controller interface. It implements MTP Basic, which was
165proposed 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
169 ;; later version."
170 (license lgpl2.1+)))
3d3caf1f
RW
171
172(define-public gmtp
173 (package
174 (name "gmtp")
50637966 175 (version "1.3.10")
3d3caf1f
RW
176 (source (origin
177 (method url-fetch)
de67e922 178 (uri (string-append "mirror://sourceforge/gmtp/gMTP-" version
3d3caf1f
RW
179 "/gmtp-" version ".tar.gz"))
180 (sha256
181 (base32
50637966 182 "0fyi3pdl2g57vr0p46ip2wwzyap3l0by7iqaqygv0yxfcs79l6xj"))))
3d3caf1f
RW
183 (build-system glib-or-gtk-build-system)
184 (arguments
185 '(#:configure-flags
186 (let ((libid3tag (assoc-ref %build-inputs "libid3tag")))
187 (list
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")))))
191 (inputs
192 `(("gtk+" ,gtk+)
193 ("flac" ,flac)
194 ("libvorbis" ,libvorbis)
195 ("libid3tag" ,libid3tag)
196 ("libmtp" ,libmtp)))
197 (native-inputs
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
203devices.")
204 (license bsd-3)))
3d74f12e
TF
205
206(define-public hidapi
207 (package
208 (name "hidapi")
209 (version "0.8.0-rc1")
210 (source (origin
211 (method url-fetch)
212 (uri (string-append "https://github.com/signal11/hidapi/archive/hidapi-"
213 version ".tar.gz"))
214 (sha256
215 (base32
216 "0qdgyj9rgb7n0nk3ghfswrhzzknxqn4ibn3wj8g4r828pw07451w"))))
217 (build-system gnu-build-system)
218 (arguments
219 '(#:phases
220 (modify-phases %standard-phases
221 (add-before 'configure 'bootstrap
222 (lambda _
223 (zero? (system* "autoreconf" "-vfi")))))))
224 (inputs
225 `(("libusb" ,libusb)
226 ("udev" ,eudev)))
227 (native-inputs
228 `(("autoconf" ,autoconf)
229 ("automake" ,automake)
230 ("libtool" ,libtool)
231 ("pkg-config" ,pkg-config)))
232 (home-page "http://www.signal11.us/oss/hidapi/")
233 (synopsis "HID API library")
234 (description
235 "HIDAPI is a library which allows an application to interface with USB and Bluetooth
236HID-Class devices.")
237 ;; HIDAPI can be used under one of three licenses.
238 (license (list gpl3
239 bsd-3
28791c1c 240 (non-copyleft "file://LICENSE-orig.txt")))))