From patchwork Mon Dec 13 06:01:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 35193 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 ED60127BBEA; Mon, 13 Dec 2021 06:08:42 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 7ECA227BBE9 for ; Mon, 13 Dec 2021 06:08:42 +0000 (GMT) Received: from localhost ([::1]:48596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mweVt-0007SH-LH for patchwork@mira.cbaines.net; Mon, 13 Dec 2021 01:08:41 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mweTK-0005HG-MZ for guix-patches@gnu.org; Mon, 13 Dec 2021 01:06:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42303) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mweTK-000823-74 for guix-patches@gnu.org; Mon, 13 Dec 2021 01:06:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mweTK-0002hU-2R for guix-patches@gnu.org; Mon, 13 Dec 2021 01:06:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v4 38/45] gnu: Add node-serialport-bindings. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 Dec 2021 06:06:02 +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.163937551610250 (code B ref 51838); Mon, 13 Dec 2021 06:06:02 +0000 Received: (at 51838) by debbugs.gnu.org; 13 Dec 2021 06:05:16 +0000 Received: from localhost ([127.0.0.1]:53831 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mweSZ-0002fE-Kp for submit@debbugs.gnu.org; Mon, 13 Dec 2021 01:05:16 -0500 Received: from mail-ua1-f51.google.com ([209.85.222.51]:42633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mweSK-0002b3-0n for 51838@debbugs.gnu.org; Mon, 13 Dec 2021 01:05:02 -0500 Received: by mail-ua1-f51.google.com with SMTP id t13so27289072uad.9 for <51838@debbugs.gnu.org>; Sun, 12 Dec 2021 22:05:00 -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=8oER+gIbu7c1NWgvvO8xEY5e/UgWsdRQk4z4YK3kxwU=; b=XNl0dNdTIa/FpJ6cQmTvLkxBKSgC53N8fm4i6g8p3WGrMTWS81blw+uvrlxz2K1Sgv ymYDhAC/ADDQxpebPXgglNZGM1Q9ZTQt5nTUS/9szIryh+weEJXG2VinmkH4H4xT0MnS dp5SX9A1sJb2W4pSkipSjEBpL6jRzQi6VtJTuKkkXCMdLbRegUvhCwyuHIxPkQgOxzCY w+pSaPqCakttC/8Zbr4UklQRCiW+M84+1r+f3pkK4+mivVdUWm/m6ejab6PvSNEj2oSQ G4qb+bXfxCLPSj+VltCETjdovhdJiOSLqWNebRsm+lUi4OP+yOyHwBQ8YhnSXbAy9r17 CqTQ== 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=8oER+gIbu7c1NWgvvO8xEY5e/UgWsdRQk4z4YK3kxwU=; b=Hu8BX2Y2hlpqMAzdOf+hyq9haC4VxkwYS1yTMqYBQ959THwwKC0edjMxrPPKElgV4b EDJLsFU7AhIdH8fKEOsTyGV52fEEmXKMU9X06bMKffAqDa8TW9bfVKTxJKVLCRu+C2hd yh0+r8SEIYAQO0Q1Y2Mf6Psc72f7U6kBk9VC6J0OuBcCBsDC2L9aGhIjWCR5W8ln5A5B aqQpV36gfGVSInPm+roZZe3WFeztDye7/vBSCxquF9xHBLhL06M8l3V6aRozoDXJox+L 6+RIk7NyhinrAWjgJGtq6RJYqSimeWL6YKkVp1n0hfiTQ7Ta9FhE2Oi1UAwD2XvPHkt8 E6ng== X-Gm-Message-State: AOAM5332xDxsRMlYwxyvqbnZAXvoaFSEAhKJ5W+7fhcko+uOa1rTpdG9 p5v1meCN2fQzdycWFJzrPuNmZ9YBmtgwWBT6qUs= X-Google-Smtp-Source: ABdhPJx17lJPiFEByEFtcnV9ied58zZ1rKuNFd2+VKtiPetKNwPXDn3amx0bos05jVp6o1KhnJenow== X-Received: by 2002:ab0:6c44:: with SMTP id q4mr41230298uas.72.1639375494689; Sun, 12 Dec 2021 22:04:54 -0800 (PST) Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242]) by smtp.gmail.com with ESMTPSA id y7sm3850520uac.3.2021.12.12.22.04.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Dec 2021 22:04:54 -0800 (PST) From: Philip McGrath Date: Mon, 13 Dec 2021 01:01:00 -0500 Message-Id: <20211213060107.129223-39-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211213060107.129223-1-philip@philipmcgrath.com> References: <46a042bc08eb72a068b1e8c69bfe28cf2d4b2e53.camel@gmail.com> <20211208202838.752542-1-philip@philipmcgrath.com> <20211208202838.752542-5-philip@philipmcgrath.com> <877dc924h7.fsf@gmx.com> <5c62c3ce-dd50-5dcd-00ed-ff1524be4e0b@philipmcgrath.com> <20211213060107.129223-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 873e0f9a39..9ee33c7402 100644 --- a/gnu/packages/node-xyz.scm +++ b/gnu/packages/node-xyz.scm @@ -1063,3 +1063,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 + `(("python" ,python))) + (inputs + `(("node-nan" ,node-nan) + ("node-bindings" ,node-bindings) + ("node-serialport-binding-abstract" ,node-serialport-binding-abstract) + ("node-serialport-parser-readline" ,node-serialport-parser-readline) + ("node-debug" ,node-debug))) + (arguments + `(#:absent-dependencies + `("prebuild-install" + ;; devDependencies + "@serialport/binding-mock" + "node-abi") + #:modules + ((guix build node-build-system) + (guix build json) + (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 'chdir 'avoid-prebuild-install + (lambda args + (with-atomic-file-replacement "package.json" + (lambda (in out) + (match (read-json in) + (('@ . meta-alist) + (match (assoc-ref meta-alist "scripts") + (('@ . scripts-alist) + (write-json + (cons '@ (assoc-set! + meta-alist + "scripts" + (cons '@ (assoc-remove! scripts-alist + "install")))) + out)))))))))) + #: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.")))