From patchwork Thu Jul 27 12:57:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jean-Pierre De Jesus DIAZ X-Patchwork-Id: 52242 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 1AB3727BBE9; Thu, 27 Jul 2023 15:02:50 +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=unavailable 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 5017327BBE2 for ; Thu, 27 Jul 2023 15:02:46 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qP0ZA-0000C1-I7; Thu, 27 Jul 2023 08:58:04 -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 1qP0Z8-0000BN-G8 for guix-patches@gnu.org; Thu, 27 Jul 2023 08:58:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qP0Z8-0002Vs-7r for guix-patches@gnu.org; Thu, 27 Jul 2023 08:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qP0Z8-00039f-3Y for guix-patches@gnu.org; Thu, 27 Jul 2023 08:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64896] [PATCH 1/8] gnu: Add python-hid. References: <20230727125446.8208-1-jean@foundationdevices.com> In-Reply-To: <20230727125446.8208-1-jean@foundationdevices.com> Resent-From: Jean-Pierre De Jesus DIAZ Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 27 Jul 2023 12:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64896 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64896@debbugs.gnu.org Cc: Jean-Pierre De Jesus DIAZ Received: via spool by 64896-submit@debbugs.gnu.org id=B64896.169046267912119 (code B ref 64896); Thu, 27 Jul 2023 12:58:02 +0000 Received: (at 64896) by debbugs.gnu.org; 27 Jul 2023 12:57:59 +0000 Received: from localhost ([127.0.0.1]:40893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP0Z5-00039O-0c for submit@debbugs.gnu.org; Thu, 27 Jul 2023 08:57:59 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:51253) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qP0Z1-000399-MU for 64896@debbugs.gnu.org; Thu, 27 Jul 2023 08:57:57 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3174aac120aso961537f8f.2 for <64896@debbugs.gnu.org>; Thu, 27 Jul 2023 05:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundationdevices.com; s=google; t=1690462669; x=1691067469; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=75hhbhcU9bw0ke9iRtCWh+p8a32YXOjcBqZZAXriuE0=; b=EEbccEMKrLtSLr+jpSuMnEOLTfAGrfRS57UqKdx0CnN9vCaXDc/COlsONj17wUVmPj 6K+zzQ4COGNFlO5SOHqm6QngyJvw6r65NGi8JGmaHacXaTmLLlAnKi87yTmHQCrdO662 fM2D3ij3KWIsjAfQH7b0PNAxrAkzlEQOlYjisjKdkuaR87LqQrbSyXWRzX5Nmkxj4O6Q G/glJYhsCJZiIPA2KxiDMFD2PcX8l2BkFRht0ebpQyAf62jM0iVdu111KBYxDePK+Jnx MOZnleMTXd2exw9+qqMnr/zZEcW5ifPV3QGkQfTia5Yye+NCUFO/XXl9zxhCYGhHAxXy EpLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690462669; x=1691067469; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=75hhbhcU9bw0ke9iRtCWh+p8a32YXOjcBqZZAXriuE0=; b=JEXOheHTJca0r2VUNyNLsA/ORZjIlwZd7VXw40jIKzCe/kehwBS7CLegBVg5Z2tJe6 crfxzmh/YhN4ugUhi9nLMQQEwQklsbezvf0Vlj7M+1pZzWuRY+9u/P2To4u9bh290OWw x3f/WMI0ixLBvJKz5MB8rafvrpvXttFNZpsHUnUKpay0kgveIjmpCHw28dK6pctj4QMf 0Gr6lWJiGli+J7Xw8iB1zmq69a11CFWlhGap0eTk2uy1QCaJpowp4QFFdAxCpPEuEaJA NTAkIj6bnMgsnF1iHunSHU4hGQDUSadm6RMGMHgN+RRlrJBrAlamZ9FPygToY0wDpyD9 A0qQ== X-Gm-Message-State: ABy/qLa6DztRu5a6fyTA0W3sLJNZkrNH5DEwubZgmyc5F23L7Mrmkscp w2+eBBcARy5vyNVr3JOUYOVM3rSvoo5zghSy91bm/w== X-Google-Smtp-Source: APBJJlF3BsueBcar8vRvHheVNW5qBVzsWZpLeKv6VNOG8fQyB4ervLX0w6bSayANs7r1zgxMFKDNQg== X-Received: by 2002:adf:dcd0:0:b0:317:636b:fcb1 with SMTP id x16-20020adfdcd0000000b00317636bfcb1mr1595925wrm.27.1690462669451; Thu, 27 Jul 2023 05:57:49 -0700 (PDT) Received: from omen15.home ([89.131.29.87]) by smtp.gmail.com with ESMTPSA id v15-20020a5d4a4f000000b003143b7449ffsm2049800wrs.25.2023.07.27.05.57.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 05:57:49 -0700 (PDT) Date: Thu, 27 Jul 2023 14:57:34 +0200 Message-Id: <20230727125741.8766-1-jean@foundationdevices.com> X-Mailer: git-send-email 2.34.1 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: , Reply-to: Jean-Pierre De Jesus DIAZ X-ACL-Warn: , Jean-Pierre De Jesus DIAZ via Guix-patches X-Patchwork-Original-From: Jean-Pierre De Jesus DIAZ via Guix-patches via From: Jean-Pierre De Jesus DIAZ 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. Signed-off-by: Jean-Pierre De Jesus DIAZ --- gnu/packages/libusb.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/gnu/packages/libusb.scm b/gnu/packages/libusb.scm index 13090d30ab..c80e7061ad 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 Foundation Devices, Inc. ;;; ;;; This file is part of GNU Guix. ;;; @@ -653,6 +654,42 @@ (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 pyproject-build-system) + (arguments + ;; No tests present on the source tree, without this compilation fails + ;; because it "requires" the python-nose package, but it is not really + ;; necessary. + (list #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'add-extra-library-paths + (lambda _ + (let ((libhidapi-hidraw.so + #$(file-append hidapi "/lib/libhidapi-hidraw.so")) + (libhidapi-libusb.so + #$(file-append hidapi "/lib/libhidapi-libusb.so"))) + (substitute* "hid/__init__.py" + (("library_paths = \\(.*$" all) + (string-append + all + " '" libhidapi-hidraw.so "',\n" + " '" libhidapi-libusb.so "',\n"))))))))) + (inputs (list hidapi)) + (home-page "https://github.com/apmorton/pyhidapi") + (synopsis "Python @code{ctypes} bindings for HIDAPI library") + (description "Python @code{ctypes} bindings for HIDAPI library.") + (license license:expat))) + (define-public python-hidapi (package (name "python-hidapi")