From patchwork Mon Dec 13 06:00:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 35178 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 0B84D27BBEA; Mon, 13 Dec 2021 06:06:05 +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 21D9727BBE9 for ; Mon, 13 Dec 2021 06:06:04 +0000 (GMT) Received: from localhost ([::1]:44928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mweTL-0004pE-7n for patchwork@mira.cbaines.net; Mon, 13 Dec 2021 01:06:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mweSO-0003ca-FL for guix-patches@gnu.org; Mon, 13 Dec 2021 01:05:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42269) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mweSO-0007YZ-77 for guix-patches@gnu.org; Mon, 13 Dec 2021 01:05:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mweSO-0002dE-2Z for guix-patches@gnu.org; Mon, 13 Dec 2021 01:05:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v4 28/45] gnu: Add node-addon-api. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 Dec 2021 06:05:04 +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.16393754649899 (code B ref 51838); Mon, 13 Dec 2021 06:05:04 +0000 Received: (at 51838) by debbugs.gnu.org; 13 Dec 2021 06:04:24 +0000 Received: from localhost ([127.0.0.1]:53781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mweRk-0002Za-Fp for submit@debbugs.gnu.org; Mon, 13 Dec 2021 01:04:24 -0500 Received: from mail-ua1-f47.google.com ([209.85.222.47]:45612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mweRf-0002Yy-Kt for 51838@debbugs.gnu.org; Mon, 13 Dec 2021 01:04:19 -0500 Received: by mail-ua1-f47.google.com with SMTP id ay21so27252175uab.12 for <51838@debbugs.gnu.org>; Sun, 12 Dec 2021 22:04:19 -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=I1oJY3wEWEJBJRIbnxgfEGPFrQ9yStZqSgBvISDkYWo=; b=ejaUuQp9wO2+fOIirJ+p8aEpiifDPseFeQZsIBimkXTCNylWM5TOQjSGnTBrzmiqRi uRiIZ4uWxR8Y/clDf8Y7CWhzIHA1NrbQH9BwW7JuOqBTpEwcCH0WulIg9vJIZ5/9Odv/ nCHftE18ZGYpTgMVyI/1A6FveFdV7SCEoDekjrP3VdqvFQG3cSFUCwJn+YHtxo97QyCP XmjFVlC/oDBX39LjCm4x7LpzkFju0LY595vgrRdWE6HjNuMEbrSEE57fAtDrEBgpKUwj c/xzNQnt4skz5g3FNRgvY3w523u8K/P8x3dpsi+uxEV8JqXsPya4ohiyUBDIODQaUiIk lkdg== 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=I1oJY3wEWEJBJRIbnxgfEGPFrQ9yStZqSgBvISDkYWo=; b=5Z3qQ82oELJ1qAiUPl4cnvuV3le815SR4Hrs/IvKDHB0ji3PIWmgO4MP0tOXDO4WTV QgKr9NKRQJ6/rOnZYGJt7eFbCb7fU5nn47atmbKvx0F+ZDqxj7m3nblB9Ei/Qfc3sGg3 7JUwDV19aGmUuAklft1uhecgDEEN2R3mhfOtXRl6f3SyPEOyXo+xRU8u2oQ2f042wwNR mvN98T//KsvLUkSabrjrb9QDhxysZdS+X4P1wl/ImzX0wV/i8ukPWTBUAhYE+RSERN0j eDBGE1px8y1+EtdeCfHcNfuYIMFGCBB+clBgjNLOtdr9aS1caCYdkE8spJcSOUvjCAqG XSwQ== X-Gm-Message-State: AOAM530XuMGNnbwA7MWD6XtfmASsGJ8LbjJqgg49pVZVOdXZGGxxegOE QnuUW0lYYHLkVi2ybXT+jUL3iVDDVHYGP4+5ouE= X-Google-Smtp-Source: ABdhPJw/XMDkon/nrs+5unoLGoNXmAU1sQgUAWD9xmd1OhXO4Asl/Fp6iKarlKz/8rX/kTdYPcNclg== X-Received: by 2002:ab0:378b:: with SMTP id d11mr39304941uav.61.1639375454266; Sun, 12 Dec 2021 22:04:14 -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 j145sm3716404vke.47.2021.12.12.22.04.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Dec 2021 22:04:14 -0800 (PST) From: Philip McGrath Date: Mon, 13 Dec 2021 01:00:50 -0500 Message-Id: <20211213060107.129223-29-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-addon-api): New variable. --- gnu/packages/node-xyz.scm | 63 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm index 43cf9fe660..c7bc660134 100644 --- a/gnu/packages/node-xyz.scm +++ b/gnu/packages/node-xyz.scm @@ -22,6 +22,9 @@ (define-module (gnu packages node-xyz) #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages python) + #:use-module (guix gexp) #:use-module (guix packages) #:use-module (guix git-download) #:use-module (guix build-system node)) @@ -592,3 +595,63 @@ (define-public node-nan This project also contains some helper utilities that make addon development a bit more pleasant.") (license license:expat))) + +(define-public node-addon-api + (package + (name "node-addon-api") + (version "4.2.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/nodejs/node-addon-api") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1bhvfi2m9nxfz418s619914vmidcnrzbjv6l9nid476c3zlpazch")))) + (inputs + `(("python" ,python) + ("node-safe-buffer" ,node-safe-buffer))) + (build-system node-build-system) + (arguments + `(#:absent-dependencies + `("benchmark" + "bindings" + "clang-format" + "eslint" + "eslint-config-semistandard" + "eslint-config-standard" + "eslint-plugin-import" + "eslint-plugin-node" + "eslint-plugin-promise" + "fs-extra" + "path" + "pre-commit") + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'skip-js-tests + ;; We can't run the js-based tests, + ;; but we can still do the C++ parts + (lambda args + (substitute* "package.json" + (("\"test\": \"node test\"") + "\"test\": \"echo stopping after pretest on Guix\""))))))) + (home-page "https://github.com/nodejs/node-addon-api") + (synopsis "Node.js API (Node-API) header-only C++ wrappers") + (description "This module contains header-only C++ wrapper classes which +simplify the use of the C based Node-API provided by Node.js when using C++. +It provides a C++ object model and exception handling semantics with low +overhead. + +Node-API is an ABI stable C interface provided by Node.js for building native +addons. It is intended to insulate native addons from changes in the +underlying JavaScript engine and allow modules compiled for one version to run +on later versions of Node.js without recompilation. The @code{node-addon-api} +module, which is not part of Node.js, preserves the benefits of the Node-API +as it consists only of inline code that depends only on the stable API +provided by Node-API. + +It is important to remember that @emph{other} Node.js interfaces such as +@code{libuv} (included in a project via @code{#include }) are not +ABI-stable across Node.js major versions.") + (license license:expat)))