GNU bug report logs - #31957
[PATCH] gnu: Add python-libusb1.

Previous Next

Package: guix-patches;

Reported by: Vagrant Cascadian <vagrant <at> debian.org>

Date: Sun, 24 Jun 2018 20:05:02 UTC

Severity: normal

Tags: patch

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 31957 <at> debbugs.gnu.org (full text, mbox):

From: Vagrant Cascadian <vagrant <at> debian.org>
To: Marius Bakke <mbakke <at> fastmail.com>, 31957 <at> debbugs.gnu.org
Subject: Re: [bug#31957] [PATCH] gnu: Add python-libusb1.
Date: Mon, 25 Jun 2018 22:35:40 -0700
[Message part 1 (text/plain, inline)]
On 2018-06-25, Marius Bakke wrote:
> Vagrant Cascadian <vagrant <at> debian.org> writes:
>
>> Add new package definition for python-libusb1, needed to upgrade
>> python-trezor to newer versions.
>
> Thanks!  I have some minor nitpicks:
...
> Can you send an updated patch?  Thanks in advance!

Updated patch attached:

- Add myself to copyright headers
- Drop unused srfi-26
- Remove needless line break
- Flesh out description a bit...
- Remove COPYING file, which didn't match the licensing of the files

The removal of COPYING was pretty much a shotgun-style approach, but I
couldn't figure out how to do a more surgical removal, and there weren't
any other COPYING files in the source.

The description could probably be further improved... but that's as far
as I got for now... :)


live well,
  vagrant

[0001-gnu-Add-python-libusb1.patch (text/x-diff, inline)]
From 088c81c4ca3a95bf51f04aec836aaedee8ab9ba8 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant <at> debian.org>
Date: Tue, 26 Jun 2018 05:22:48 +0000
Subject: [PATCH] gnu: Add python-libusb1.

* gnu/packages/libusb.scm (python-libusb1): New variable.
---
 gnu/packages/libusb.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm
index 62c936c19..39814bc90 100644
--- a/gnu/packages/libusb.scm
+++ b/gnu/packages/libusb.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2016 Theodoros Foradis <theodoros <at> foradis.org>
 ;;; Copyright © 2017 Jonathan Brielmaier <jonathan.brielmaier <at> web.de>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
+;;; Copyright © 2018 Vagrant Cascadian <vagrant <at> debian.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -214,6 +215,49 @@ with usb4java.")
 implementing @code{javax.usb} (JSR-80).")
     (license expat)))
 
+(define-public python-libusb1
+  (package
+    (name "python-libusb1")
+    (version "1.6.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "libusb1" version))
+       (sha256
+        (base32
+         "03b7xrz8vqg8w0za5r503jhcmbd1ls5610jcja1rqz833nf0v4wc"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:modules ((srfi srfi-1)
+                  (guix build utils)
+                  (guix build python-build-system))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'install-license-files 'remove-incorrect-license
+           (lambda* (#:key out #:allow-other-keys)
+             ;; Was reliscensed to LGPL 2.1+, but old COPYING file still left
+             ;; in source. Remove it so it does not get installed.
+             (delete-file-recursively "COPYING")
+             #t))
+         (add-after 'unpack 'fix-libusb-reference
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "usb1/libusb1.py"
+               (("libusb_path = ctypes.util.find_library\\(base_name\\)")
+                (string-append
+                 "libusb_path = \""
+                 (find (negate symbolic-link?)
+                       (find-files (assoc-ref inputs "libusb")
+                                   "^libusb.*\\.so\\..*"))
+                 "\"")))
+             #t)))))
+    (inputs `(("libusb" ,libusb)))
+    (home-page "http://github.com/vpelletier/python-libusb1")
+    (synopsis "Pure-python wrapper for libusb-1.0")
+    (description "Libusb is a library that gives applications easy access to
+USB devices on various operating systems. This is a python wrapper for
+acessing libusb-1.0")
+    (license lgpl2.1+)))
+
 (define-public python-pyusb
   (package
     (name "python-pyusb")
-- 
2.11.0

[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 6 years and 325 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.