summaryrefslogtreecommitdiff
path: root/gnu/packages/libusb.scm
diff options
context:
space:
mode:
authorNicolas Graves <ngraves@ngraves.fr>2025-11-23 21:51:34 +0100
committerSharlatan Hellseher <sharlatanus@gmail.com>2025-11-27 19:41:28 +0000
commit4af4a7f9af8bbdcd327d012e9beb2ea98a8ed3be (patch)
treef33a4b0dda4dc2cfc173ab1d6d879e2212c65ff5 /gnu/packages/libusb.scm
parent8a3cb943dafc2854c5445f0864340abc956700bd (diff)
gnu: python-libusb1: Switch to pyproject.
* gnu/packages/libusb.scm (python-libusb1): [build-system]: Switch to pyproject-build-system. [arguments]: Improve style. <modules>: Use (guix build pyproject-build-system). <#:test-backend, #:test-flags>: Set them to run tests. <#:phases>: Add phase 'remove-installed-tests. [native-inputs]: Add python-setuptools. [description]: Improve style. Change-Id: I82a5d5d13df391b6844e692344a2a4e27f3e881e Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu/packages/libusb.scm')
-rw-r--r--gnu/packages/libusb.scm58
1 files changed, 33 insertions, 25 deletions
diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm
index c8753c3b17e..0132c255393 100644
--- a/gnu/packages/libusb.scm
+++ b/gnu/packages/libusb.scm
@@ -273,36 +273,44 @@ implementing @code{javax.usb} (JSR-80).")
273 (method url-fetch) 273 (method url-fetch)
274 (uri (pypi-uri "libusb1" version)) 274 (uri (pypi-uri "libusb1" version))
275 (sha256 275 (sha256
276 (base32 276 (base32 "0f45rjgkq4wgyav6dz57ggj34p2l00c9n3d4639ia3z4zvgak4jp"))))
277 "0f45rjgkq4wgyav6dz57ggj34p2l00c9n3d4639ia3z4zvgak4jp")))) 277 (build-system pyproject-build-system)
278 (build-system python-build-system)
279 (arguments 278 (arguments
280 '(#:modules ((srfi srfi-1) 279 (list
280 #:modules '((srfi srfi-1)
281 (guix build utils) 281 (guix build utils)
282 (guix build python-build-system)) 282 (guix build pyproject-build-system))
283 #:phases 283 #:test-backend #~'custom
284 (modify-phases %standard-phases 284 #:test-flags #~(list "-m" "usb1.testUSB1")
285 (add-before 'install-license-files 'remove-incorrect-license 285 #:phases
286 (lambda* (#:key out #:allow-other-keys) 286 #~(modify-phases %standard-phases
287 ;; Was relicensed to LGPL 2.1+, but old COPYING file still left 287 (add-before 'install-license-files 'remove-incorrect-license
288 ;; in source. Remove it so it does not get installed. 288 (lambda _
289 (delete-file "COPYING"))) 289 ;; Was relicensed to LGPL 2.1+, but old COPYING file still left
290 (add-after 'unpack 'fix-libusb-reference 290 ;; in source. Remove it so it does not get installed.
291 (lambda* (#:key inputs #:allow-other-keys) 291 (delete-file "COPYING")))
292 (substitute* "usb1/_libusb1.py" 292 (add-after 'unpack 'fix-libusb-reference
293 (("libusb_path = ctypes\\.util\\.find_library\\(base_name\\)") 293 (lambda* (#:key inputs #:allow-other-keys)
294 (string-append 294 (substitute* "usb1/_libusb1.py"
295 "libusb_path = \"" 295 (("libusb_path = ctypes\\.util\\.find_library\\(base_name\\)")
296 (find (negate symbolic-link?) 296 (string-append "libusb_path = \""
297 (find-files (assoc-ref inputs "libusb") 297 (find (negate symbolic-link?)
298 "^libusb.*\\.so\\..*")) 298 (find-files (assoc-ref inputs "libusb")
299 "\"")))))))) 299 "^libusb.*\\.so\\..*"))
300 "\"")))))
301 (add-after 'check 'remove-installed-tests
302 (lambda* (#:key inputs outputs #:allow-other-keys)
303 (with-directory-excursion (site-packages inputs outputs)
304 (delete-file "usb1/__pyinstaller/test_libusb1_packaging.py")
305 (delete-file "usb1/testUSB1.py")))))))
306 (native-inputs (list python-setuptools))
300 (propagated-inputs (list libusb)) 307 (propagated-inputs (list libusb))
301 (home-page "https://github.com/vpelletier/python-libusb1") 308 (home-page "https://github.com/vpelletier/python-libusb1")
302 (synopsis "Pure-python wrapper for libusb-1.0") 309 (synopsis "Pure-python wrapper for libusb-1.0")
303 (description "Libusb is a library that gives applications easy access to 310 (description
304USB devices on various operating systems. This package provides a Python 311 "Libusb is a library that gives applications easy access to USB devices
305wrapper for accessing libusb-1.0.") 312on various operating systems. This package provides a Python wrapper for
313accessing libusb-1.0.")
306 (license license:lgpl2.1+))) 314 (license license:lgpl2.1+)))
307 315
308(define-public python-pyusb 316(define-public python-pyusb