From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 0CGzGfU/MmTC3gAASxT56A (envelope-from ) for ; Sun, 09 Apr 2023 06:32:53 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id EC7RGPU/MmRbFAEAG6o9tA (envelope-from ) for ; Sun, 09 Apr 2023 06:32:53 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 07ADC3C49A for ; Sun, 9 Apr 2023 06:32:52 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plMix-0006l9-7f; Sun, 09 Apr 2023 00:32:19 -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 1plMil-0006kR-6P for guix-patches@gnu.org; Sun, 09 Apr 2023 00:32:07 -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 1plMij-0008Pc-2i for guix-patches@gnu.org; Sun, 09 Apr 2023 00:32:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1plMii-0004iX-TP for guix-patches@gnu.org; Sun, 09 Apr 2023 00:32:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42682] [PATCH v2 7/9] gnu: Add python-hid. Resent-From: Fredrik Salomonsson Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 09 Apr 2023 04:32:04 +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.168101472018058 (code B ref 42682); Sun, 09 Apr 2023 04:32:04 +0000 Received: (at 42682) by debbugs.gnu.org; 9 Apr 2023 04:32:00 +0000 Received: from localhost ([127.0.0.1]:60037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plMie-0004hC-1j for submit@debbugs.gnu.org; Sun, 09 Apr 2023 00:32:00 -0400 Received: from mout02.posteo.de ([185.67.36.66]:46969) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plMib-0004gW-81 for 42682@debbugs.gnu.org; Sun, 09 Apr 2023 00:31:58 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B4FAC240183 for <42682@debbugs.gnu.org>; Sun, 9 Apr 2023 06:31:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681014711; bh=Tn49zcHe29//V2i6nzpuV7t8bHWg4NuDrjWL9gheIBQ=; h=From:To:Cc:Subject:Date:From; b=ZUhU4FYqsuXRgQawLUVLjbjONvCa2pDuzL16RkgBqqFyok8eSyOvYJiQAsy//0/zj hYqIFWYGWXa2gbtyQtq5lu7RnaN97qN46krVnxvKm0w/v4t9pMZxF2sJONzVD2jHqh QGt00z/sRjE4xvbI6Zwidggx4SFCKebJtF3en7ZIb2tTGpcbF2GGIc1IyV/TM50aVf lmgWetnISd+G+aZy9Ael+gRTB09wlmbZwVDWMjzvMox+F5bzRwfsxNQBznx6muFQRN CU3Er5SSU0pFBh9iKiK8ZFZzFRcEiKtBvPoE0Wijv4I9JTSO+eGHl4H1S45h/8QzNI BM1mLhaaWeQSw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PvK1z0MZfz6tx0; Sun, 9 Apr 2023 06:31:50 +0200 (CEST) From: Fredrik Salomonsson Date: Sun, 9 Apr 2023 04:31:14 +0000 Message-Id: <20230409043116.13244-8-plattfot@posteo.net> In-Reply-To: <20230409043116.13244-1-plattfot@posteo.net> References: <20230409043116.13244-1-plattfot@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681014773; a=rsa-sha256; cv=none; b=Szo5JEvpvqRL3nienSFLSF3WNVV8HaBZnxRqCCpOz9Jg+v7/pG5P09eojGfDOT4O/d/jUu TxDXmtlOP2gx9HMlKBHCfZy1HvDU93SEjvCiqQRhVwBY6eny2NYu9fhNhoT7VqARHgHT7H 2btmp/yraN+ccAGIRSy5p+eGPxb04OriTXy5Pvl4LBf50/kFSLyUoSEj1n3tRHTuemX5hY GRSGGr9YColANLGHs5FUKI7HQtPolteSku8XKe+AmtMe6KADPKJOG1qvelRK5hnVvz4Moo V5B6MdIi3tvuLuHT9L8kgvnRVgw3nozWtLAEcdwgqLiHzQAwFxMJlzCLjjBgVg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=ZUhU4FYq; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681014773; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=rU9shZgqMmOB5mj3Ve59+ywoWRmRq7wz9BDz77a7Sn0=; b=tea6laiLL2Gx22YvEUIBaZ5ncDiPmUqNWz+0CZDTS1bus8rsctpPPjQx7XmlTJi96Gb8Xb T7eJUvktYmmtxlW5J7m37lPghkgC/VPDfqS/9jRX5ibNbQq/h4sPJhEOzRH1siAAv28+0I Yg7agSUXYIShPdWlbFAtlJIYsiJd3lgENEHJY7yRO/R2FULpETyZSrwD5BDMfXi0SEeiKC CcxVfksq2N3D4QrI1l0fNb4E0dOFwfL62SPl2FbV8vbhdz8ajNkjEXeGINYE9kEaTa3aRE X3P+oBqjt9nKxH1+hlClR/RvKh5EQ//rNcZluyx8yRcoyaMY+ZK25kydv7kvgA== X-Migadu-Spam-Score: 8.08 X-Spam-Score: 8.08 X-Migadu-Queue-Id: 07ADC3C49A X-Migadu-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=ZUhU4FYq; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn1.migadu.com X-Spam: Yes X-TUID: 5jE8updf6wZf * 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 c009c78e88..266ab459a1 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") -- 2.39.2