From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eTbmx-0000jQ-TZ for guix-patches@gnu.org; Mon, 25 Dec 2017 18:04:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eTbms-0004Q7-Vd for guix-patches@gnu.org; Mon, 25 Dec 2017 18:04:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:43544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eTbms-0004Q3-RI for guix-patches@gnu.org; Mon, 25 Dec 2017 18:04:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eTbms-00073R-JY for guix-patches@gnu.org; Mon, 25 Dec 2017 18:04:02 -0500 Subject: [bug#29850] [PATCH] gnu: Add python-hidapi. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eTbmR-0000ac-3m for guix-patches@gnu.org; Mon, 25 Dec 2017 18:03:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eTbmM-0004BD-6W for guix-patches@gnu.org; Mon, 25 Dec 2017 18:03:35 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:40996) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eTbmM-00049y-06 for guix-patches@gnu.org; Mon, 25 Dec 2017 18:03:30 -0500 Received: from localhost (77.118.177.251.wireless.dyn.drei.com [77.118.177.251]) by dd26836.kasserver.com (Postfix) with ESMTPSA id CE5FF336220D for ; Tue, 26 Dec 2017 00:03:24 +0100 (CET) Date: Tue, 26 Dec 2017 00:03:19 +0100 From: Danny Milosavljevic Message-ID: <20171226000319.6b5c478f@scratchpost.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 29850@debbugs.gnu.org * gnu/packages/libusb.scm (python-hidapi, python2-hidapi): New variables. --- gnu/packages/libusb.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm index 31c7dfa44..404ae8659 100644 --- a/gnu/packages/libusb.scm +++ b/gnu/packages/libusb.scm @@ -352,3 +352,40 @@ HID-Class devices.") (license (list gpl3 bsd-3 (non-copyleft "file://LICENSE-orig.txt"))))) + +(define-public python-hidapi + (package + (name "python-hidapi") + (version "0.7.99.post21") + (source + (origin + (method url-fetch) + (uri (pypi-uri "hidapi" version)) + (sha256 + (base32 + "15ws59zdrxahf3k7z5rcrwc4jgv1307anif8ixm2cyb9ask1mgp0")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-configuration + (lambda* (#:key inputs #:allow-other-keys) + (substitute* "setup.py" + (("'/usr/include/libusb-1.0'") + (string-append "'" (assoc-ref inputs "libusb") + "/include/libusb-1.0'"))) + #t))))) + (inputs + `(("libusb" ,libusb) + ("eudev" ,eudev))) + (native-inputs + `(("python-cython" ,python-cython))) + (home-page "https://github.com/trezor/cython-hidapi") + (synopsis "Cython interface to hidapi") + (description "A Cython interface to the hidapi.") + ;; The library can be used under either of these licenses. + ;; TODO cython-hidapi DIY license. + (license (list gpl3 bsd-3)))) + +(define-public python2-hidapi + (package-with-python2 python-hidapi))