From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KHL1EMHitmE9UQEAgWs5BA (envelope-from ) for ; Mon, 13 Dec 2021 07:05:53 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id ADyoDMHitmHmWwAAbx9fmQ (envelope-from ) for ; Mon, 13 Dec 2021 06:05:53 +0000 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 E8664DEEE for ; Mon, 13 Dec 2021 07:05:52 +0100 (CET) Received: from localhost ([::1]:44928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mweTA-0004pE-16 for larch@yhetil.org; Mon, 13 Dec 2021 01:05:52 -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 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639375553; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=I1oJY3wEWEJBJRIbnxgfEGPFrQ9yStZqSgBvISDkYWo=; b=Am8NTI2aiLWXx8kTLNhScUxDLqAtRCK5qN6jESFahr7A+aVHa+BNephbvMWQ01jIUHb94y JwLeA0CEIqJQkMf4yDWDqOVPd5kEzhs7pZJWRm3uCGNLi/TJ7gmpPtQvTv6pIOJ4GnF64s bF0j/qXVOECvNw5gFpvRByr6eXXffa9Qv4p3yEKSvb1dTlofugJxP4oWjX+7zz49RLse2v UP9HGsRXk5L1zmkh51W+rj/xCVNUa0VQjSL28zGBr/q2PMAmTd6h3okrEcowT4dgzsy8YL a3To115G5jgFxdGcnrWcYx5VaSlN0ljXegLSRFZ8uwhJJ859iFHXXXr4bFcNjA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639375553; a=rsa-sha256; cv=none; b=TeemcP5khLt5Vjl3nBX6sFC3L/KRb2N32ZUOrKBIn7DkHJHj/6gkaUXxj/ZhitrvQzkuo9 Uo/23nOZOhVDjqSlhife2/XTyGWIeeNUDqfOsWPh6sxN6/1jPc1kgcjCslwAf069bEj4zY he68lKFJnH1dvoMS4++joUfJDCOimaQhJfR1Vexa2XaXLDbq5V+IrdXAB0S0KZOjqctBO6 sVbNeVGOytVPD9MwvHyRW0kVR/+dRNW8hMMPgBjw3p3BfUcaA4Kd1Ju4aPXv5KcsQqJZl2 ey6xXQe35dvr1wXyLAQ/npcSqpA11sTmty+scAVaJb+YkDSXBpBaII1k5TbOFg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=ejaUuQp9; dmarc=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-Spam-Score: 1.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=ejaUuQp9; dmarc=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-Queue-Id: E8664DEEE X-Spam-Score: 1.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: TPj0tTb/eKYH * 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))) -- 2.32.0