From patchwork Sun May 28 23:44:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fredrik Salomonsson X-Patchwork-Id: 50406 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2C57027BBEA; Mon, 29 May 2023 00:45:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 257FE27BBE9 for ; Mon, 29 May 2023 00:45:25 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q3Q4W-0005Da-Bd; Sun, 28 May 2023 19:45:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q3Q4T-0005D3-65 for guix-patches@gnu.org; Sun, 28 May 2023 19:45:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q3Q4S-0004fD-Tc for guix-patches@gnu.org; Sun, 28 May 2023 19:45:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q3Q4P-0006sv-P9 for guix-patches@gnu.org; Sun, 28 May 2023 19:45:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42682] [PATCH v3 7/9] gnu: Add python-hid. Resent-From: Fredrik Salomonsson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 28 May 2023 23:45:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42682 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42682@debbugs.gnu.org Cc: Fredrik Salomonsson Received: via spool by 42682-submit@debbugs.gnu.org id=B42682.168531749626354 (code B ref 42682); Sun, 28 May 2023 23:45:05 +0000 Received: (at 42682) by debbugs.gnu.org; 28 May 2023 23:44:56 +0000 Received: from localhost ([127.0.0.1]:56626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3Q4G-0006qy-CD for submit@debbugs.gnu.org; Sun, 28 May 2023 19:44:56 -0400 Received: from mout02.posteo.de ([185.67.36.66]:38455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q3Q4B-0006qF-0B for 42682@debbugs.gnu.org; Sun, 28 May 2023 19:44:52 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7A134240101 for <42682@debbugs.gnu.org>; Mon, 29 May 2023 01:44:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1685317485; bh=QWMH0DiCqqUXF682zK6sTpyPQ8wxv2fVG8eLHryyT5U=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=aPvvqRx6toMgxoAYjtbzCyAQzNbPmOg1obi218HEIZ2l0c4UJy2gkmxvj1hu3byEq g3Jwedxc41qX+Bb8uRqSTqnkH9U9O/PqouQSAJMF62exxf1E9po9jBdpPvGUt3Xvkh zCZ7FwmpTFZlv4NqLYVSxlc/S4VByP14Yrtwue4kRIe2ahOeCZTa5kLYKOEOFg4e9N WuUfFV03OkhU37kzIWyv6r2Ln5iCLXiPwxI+38VskRMirse2k3csKfoiO/HLFlzwc2 Z+j/FtEfxERnt0qYzoVQQfPIS4yu8Y8tfmnOR0GoUACXgRlXbw/LHzoE8ebzUYkIzX 12yBQB8yTEQrA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4QTwHc5zktz9rxF; Mon, 29 May 2023 01:44:44 +0200 (CEST) From: Fredrik Salomonsson Date: Sun, 28 May 2023 23:44:05 +0000 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/libusb.scm (python-hid): New variable. --- gnu/packages/libusb.scm | 56 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm index d0837c8a91..8e81b0c1a9 100644 --- a/gnu/packages/libusb.scm +++ b/gnu/packages/libusb.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2022 Jacob Hrbek ;;; Copyright © 2023 Sharlatan Hellseher +;;; Copyright © 2023 Fredrik Salomonsson ;;; ;;; This file is part of GNU Guix. ;;; @@ -44,6 +45,7 @@ (define-module (gnu packages libusb) #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (gnu packages autotools) + #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages curl) #:use-module (gnu packages gnupg) @@ -54,6 +56,7 @@ (define-module (gnu packages libusb) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-build) + #:use-module (gnu packages python-check) #:use-module (gnu packages python-xyz) #:use-module (gnu packages readline) #:use-module (gnu packages tls) @@ -650,6 +653,59 @@ (define-public hidapi license:bsd-3 (license:non-copyleft "file://LICENSE-orig.txt"))))) +(define-public python-hid + (package + (name "python-hid") + (version "1.0.5") + (source (origin + (method url-fetch) + (uri (pypi-uri "hid" version)) + (sha256 + (base32 + "1s5hvfbmnlmifswr5514f4xxn5rcd429bdcdqzgwkdxrg9zlx58y")))) + (build-system python-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-library-paths + (lambda* (#:key inputs #:allow-other-keys) + (substitute* '("hid/__init__.py") + (("'libhidapi-hidraw.so'") + (string-append + "'" (search-input-file inputs "/lib/libhidapi-hidraw.so") "'")) + (("'libhidapi-libusb.so'") + (string-append + "'" (search-input-file inputs "/lib/libhidapi-libusb.so") "'")) + ;; Nuke the rest of the library_paths + (("[[:blank:]]+'libhidapi-hidraw.so.0',\n") + "") + (("[[:blank:]]+'libhidapi-libusb.so.0',\n") + "") + (("[[:blank:]]+'libhidapi-iohidmanager.so',\n") + "") + (("[[:blank:]]+'libhidapi-iohidmanager.so.0',\n") + "") + (("[[:blank:]]+'libhidapi.dylib',\n") + "") + (("[[:blank:]]+'hidapi.dll',\n") + "") + (("[[:blank:]]+'hidapi-0.dll',\n") + ""))))))) + (native-inputs + (list + python-nose + python-tox)) + (inputs + (list + hidapi)) + (home-page "https://github.com/apmorton/pyhidapi") + (synopsis "Ctypes bindings for hidapi") + (description "This package provides ctypes bindings in Python for the @code{hidapi} +package. Note that this package conflicts with the +@code{python-hidapi} package as they occupy the same Python namespace.") + (license license:expat))) + (define-public python-hidapi (package (name "python-hidapi")