From patchwork Thu Dec 30 07:39:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 35793 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 DF16227BBEA; Thu, 30 Dec 2021 07:46:49 +0000 (GMT) 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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, 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 6501427BBE9 for ; Thu, 30 Dec 2021 07:46:49 +0000 (GMT) Received: from localhost ([::1]:59284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2q9A-0003S7-HO for patchwork@mira.cbaines.net; Thu, 30 Dec 2021 02:46:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2q6c-0001Nw-2r for guix-patches@gnu.org; Thu, 30 Dec 2021 02:44:10 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2q6b-0001wS-Ov for guix-patches@gnu.org; Thu, 30 Dec 2021 02:44:09 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2q6b-0006kS-OU for guix-patches@gnu.org; Thu, 30 Dec 2021 02:44:09 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v6 34/41] gnu: Add node-serialport-bindings. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Dec 2021 07:44:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51838 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51838@debbugs.gnu.org Cc: Timothy Sample , Pierre Langlois , Jelle Licht , Philip McGrath , Liliana Marie Prikler Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.164085020725711 (code B ref 51838); Thu, 30 Dec 2021 07:44:09 +0000 Received: (at 51838) by debbugs.gnu.org; 30 Dec 2021 07:43:27 +0000 Received: from localhost ([127.0.0.1]:51070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2q5v-0006gX-6Y for submit@debbugs.gnu.org; Thu, 30 Dec 2021 02:43:27 -0500 Received: from mail-qk1-f180.google.com ([209.85.222.180]:33338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2q5Z-0006cw-Nu for 51838@debbugs.gnu.org; Thu, 30 Dec 2021 02:43:06 -0500 Received: by mail-qk1-f180.google.com with SMTP id de30so22051352qkb.0 for <51838@debbugs.gnu.org>; Wed, 29 Dec 2021 23:43:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mwZWa7x8qRS2TTsQ9loz8Iqp+6b2AUfase9op7CjaYM=; b=CvrdAWRT9wXSmy1MNcyizuxrJa1vL/sm3zreMrRCELp/sB1h+P52LrzKe4oTbP5Jbx 4AOaeV5KrWNx2gRrzPYKhzS8r8Y+mkydywtRTNCMUOM2fawZA1LRlWiAVADHm+Vre/DN QkEYQzZxVxPhOAW2O0vc/rEFkZe6VALqinkQ4N/oK4R1nMuVNLfHWfc5lMuiNsGqbuZ8 12RP9wxvHc2leYYz6kjjAk17J0XtuxZR9wb6U5VmIfiZ5WdxRS3ac0XQmdi0fTqE6qts 7YtXsmY5cSr/X1hs/Xt/lbbQYYYLLqrXXVcY1ftc1UmzxPRWPsJMRlsm41Tpi9n99S/H S1xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mwZWa7x8qRS2TTsQ9loz8Iqp+6b2AUfase9op7CjaYM=; b=cnvulbk1tXP/ymZXwH63LQYEFxIDWfGWjP2l5eyPWZFv150zTuP36ATum3IOXuzyJS CrMctOnEuFXnxRri4c3JopAfRfX78ydbiGm8oywoauuLafJ+tJfVbrvjpa12w6V52JJS BSCzqlF1HEpsqxsVgQPndzPscqoK1EI5RtU+3FX3ZeUmfz/eJp+3uAjVjS5z9Q8+6W6d 1AxEWMWtC0EvAdwJAMHEG/NvbA6dp8qA2B8LJwBeNF3fxb3HTQDWmFj3VAJgnMbGpvBZ T6tqZWF06akPyZaQm+LdnrbME3PmsN8FVaKUmRWG0qNeGtKMRHEEAtWLEEOZTfyu5fIr Dy1Q== X-Gm-Message-State: AOAM531F8oTOoVgaI8UbpBauyAYeBjNL10YUd7KkD6AOmkFnz/sgBhl3 Zm4JtSpV3B2HZstrniQ32jM2p54hvRec0xxc X-Google-Smtp-Source: ABdhPJwKQQAPafKD6Q1PB1T/uO/CRgpxfYerREqZx4kotF4nxSaasL6EYWoNJpLqSJ5/KRHuIuRNNg== X-Received: by 2002:a05:620a:754:: with SMTP id i20mr20669695qki.312.1640850180253; Wed, 29 Dec 2021 23:43:00 -0800 (PST) Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242]) by smtp.gmail.com with UTF8SMTPSA id p67sm16401774qkf.49.2021.12.29.23.42.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Dec 2021 23:43:00 -0800 (PST) From: Philip McGrath Date: Thu, 30 Dec 2021 02:39:12 -0500 Message-Id: <20211230073919.30327-35-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211230073919.30327-1-philip@philipmcgrath.com> References: <082a81964a43ae5f735ad2ca433d0dfe00859c35.camel@gmail.com> <20211230073919.30327-1-philip@philipmcgrath.com> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/node-xyz.scm (node-serialport-bindings): New variable. --- gnu/packages/node-xyz.scm | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm index e33a35a0a0..fe1a2d4e5f 100644 --- a/gnu/packages/node-xyz.scm +++ b/gnu/packages/node-xyz.scm @@ -1149,3 +1149,59 @@ (define-public node-serialport-parser-readline Parsers are used to take raw binary data and transform them into usable messages. This package provides @code{Readline}, a parser that emits data after a (configurable) newline delimiter is received."))) + +(define-public node-serialport-bindings + (package + (inherit node-serialport-binding-abstract) + (name "node-serialport-bindings") + (version "9.2.7") + (native-inputs + (list python)) + (inputs + (list node-nan node-bindings node-serialport-binding-abstract + node-serialport-parser-readline node-debug)) + (arguments + `(#:modules + ((guix build node-build-system) + (srfi srfi-1) + (ice-9 match) + (guix build utils)) + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda args + (chdir "packages/bindings"))) + (add-after 'patch-dependencies 'delete-dependencies + (lambda args + (with-atomic-json-file-replacement "package.json" + (lambda (pkg-meta) + (delete-dependencies pkg-meta `("prebuild-install" + ;; devDependencies + "@serialport/binding-mock" + "node-abi")))))) + (add-after 'chdir 'avoid-prebuild-install + (lambda args + (with-atomic-json-file-replacement "package.json" + (match-lambda + (('@ . pkg-meta-alist) + (cons '@ (map (match-lambda + (("scripts" @ . scripts-alist) + `("scripts" @ ,@(filter (match-lambda + (("install" . _) + #f) + (_ + #t)) + scripts-alist))) + (other + other)) + pkg-meta-alist)))))))) + #:tests? #f)) + (synopsis "Abstract base class for Node SerialPort bindings") + (description "Node SerialPort is a modular suite of Node.js packages for +accessing serial ports. The Guix package @code{node-serialport} provides the +recommended high-level interface. + +This package provides the @code{Binding} class, which uses a native addon to +talk to the underlying system. You never have to use @code{Binding} objects +directly. There is also a @code{MockBinding} available (but not yet packaged +for Guix) to assist with testing.")))