From patchwork Wed Dec 8 20:28:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 35044 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 64E6C27BBE9; Wed, 8 Dec 2021 20:31:29 +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 DDBF227BBE9 for ; Wed, 8 Dec 2021 20:31:28 +0000 (GMT) Received: from localhost ([::1]:48624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mv3b6-0000oi-1I for patchwork@mira.cbaines.net; Wed, 08 Dec 2021 15:31:28 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mv3a0-0006lK-2K for guix-patches@gnu.org; Wed, 08 Dec 2021 15:30:21 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58371) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mv3Zu-0000Rd-0A for guix-patches@gnu.org; Wed, 08 Dec 2021 15:30:19 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mv3Zt-00061U-SI for guix-patches@gnu.org; Wed, 08 Dec 2021 15:30:13 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v3 28/43] gnu: Add node-addon-api. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Dec 2021 20:30:13 +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 Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.163899539222829 (code B ref 51838); Wed, 08 Dec 2021 20:30:13 +0000 Received: (at 51838) by debbugs.gnu.org; 8 Dec 2021 20:29:52 +0000 Received: from localhost ([127.0.0.1]:41629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mv3ZX-0005w3-JW for submit@debbugs.gnu.org; Wed, 08 Dec 2021 15:29:51 -0500 Received: from mail-vk1-f171.google.com ([209.85.221.171]:37761) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mv3Yx-0005rC-MX for 51838@debbugs.gnu.org; Wed, 08 Dec 2021 15:29:17 -0500 Received: by mail-vk1-f171.google.com with SMTP id e27so2373638vkd.4 for <51838@debbugs.gnu.org>; Wed, 08 Dec 2021 12:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=GOfT5efxp3W1RoTTbqJYi7kpaw3hg0vmi3aqGO2Gvjc=; b=KS53zaKW5f94ZvY1AiNVCnP3Kq085sGH5chTFxx5f9OXbRZsiMqxJSBw/Xe6Nn5vAX Dw+8qK5wNL5zSPQ+a18R1GuEjbwcfao6qsP4txSviM9tv+bvDSjh98r71eUDH7UktVhv EQ5wXlAO0DobuKtBJ3A43/ELj1Ch+j5dKRztzOKnuK/GaIB34uBFTdhWQn0vHoLjYML3 OGfI2ZAUB2yfKyEoixoYZRex7DuLFxdXk9Yeht1gAdA684+vIvXknWVPc8htMIbhKdak a/CPfjAtJGjjA3Uu+isPQac8FBC2RXcYvTXCrwj4Y3FGCK51PouCL5pZKtcuvaAkdUUJ VT1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GOfT5efxp3W1RoTTbqJYi7kpaw3hg0vmi3aqGO2Gvjc=; b=TscqsSDhhr9nZ3uaXSPctFmbQ+R23snJfyLkXtnXFkekH+S1UYSmnZU0T6Yar1cW9V sRNmUySesGCbxC/y+Ndg1iVKDdiEAYcaSnAGzqkX7x1Y5dHMRHeXQncDheEoio+YZkop kYNIPJJLBtBUwRhDB/q0dplKufPXbCj7nf5kTWUozuAvpYU/IwhugfJdOAAeq559CGQZ vfAmFLWy3YOjUU0PNMP/IO1Eo9FozP5Y8AhSafLVMq8oqJOtbmT+cRk3svQ7lKNbHuiq irWOYRlgS2A/gHlcn7uAHR+MlzQzTKOqNO4LoYQSQhOK/oqKPmdBErov2k1ToL0ryE7X Q5NA== X-Gm-Message-State: AOAM531INIrvaXIXr6++WuoZ0yLgMMj7IiuKeOkuDE12u/VYC4xzdkj6 JQSIA+ZIc9UsrEuuz5ZrnyCfJh3q/Nc3WFDQarE= X-Google-Smtp-Source: ABdhPJxwDHrFH36FbQUjOY+VTBnvPLZqa/pHjrktHwb+trcthoPx5Zer19aYIWUSgZRYVGmDopuaLw== X-Received: by 2002:a05:6122:54e:: with SMTP id y14mr1227203vko.24.1638995350156; Wed, 08 Dec 2021 12:29:10 -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 w11sm2494093vkm.14.2021.12.08.12.29.09 for <51838@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Dec 2021 12:29:10 -0800 (PST) From: Philip McGrath Date: Wed, 8 Dec 2021 15:28:23 -0500 Message-Id: <20211208202838.752542-29-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211208202838.752542-1-philip@philipmcgrath.com> References: <46a042bc08eb72a068b1e8c69bfe28cf2d4b2e53.camel@gmail.com> <20211208202838.752542-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 ed169c0778..60dbfc163c 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)) @@ -597,3 +600,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))) + (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" + "safe-buffer") + #: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)))