From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +IgZFUrxu2EvMgEAgWs5BA (envelope-from ) for ; Fri, 17 Dec 2021 03:09:14 +0100 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 6PCxEErxu2FIbgAAbx9fmQ (envelope-from ) for ; Fri, 17 Dec 2021 02:09:14 +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 aspmx2.migadu.com (Postfix) with ESMTPS id D73D53599C for ; Fri, 17 Dec 2021 03:09:13 +0100 (CET) Received: from localhost ([::1]:59678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1my2gL-0001DL-2a for larch@yhetil.org; Thu, 16 Dec 2021 21:09:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1my2dN-0004Oh-9H for guix-patches@gnu.org; Thu, 16 Dec 2021 21:06:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1my2dM-00081Q-V3 for guix-patches@gnu.org; Thu, 16 Dec 2021 21:06:08 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1my2dM-0005DK-PH for guix-patches@gnu.org; Thu, 16 Dec 2021 21:06:08 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v5 28/45] gnu: Add node-addon-api. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 17 Dec 2021 02:06:08 +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.163970676119902 (code B ref 51838); Fri, 17 Dec 2021 02:06:08 +0000 Received: (at 51838) by debbugs.gnu.org; 17 Dec 2021 02:06:01 +0000 Received: from localhost ([127.0.0.1]:37354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1my2dE-0005Ap-Sp for submit@debbugs.gnu.org; Thu, 16 Dec 2021 21:06:01 -0500 Received: from mail-qt1-f181.google.com ([209.85.160.181]:33655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1my2d0-00059b-Kc for 51838@debbugs.gnu.org; Thu, 16 Dec 2021 21:05:46 -0500 Received: by mail-qt1-f181.google.com with SMTP id n15so1264905qta.0 for <51838@debbugs.gnu.org>; Thu, 16 Dec 2021 18:05:46 -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=kFG9UmTY34FL2o455TQzKeJyYhqM2Uws405NMCYUxMw=; b=bMa3IeGw8vZkhDOFlE5qLM9gYpKifBQtCLcio9T1Ft0lM7onp5cDhvv2N39rZw9g+w 8sG9TksLs+cPXDV/l2wR55cpEnJ+8BWPZgG5YJY1AdxldcHFJDJKGFDHee2uHYLH9Oel sSgASygWJpfzPgE0fRHEnfvWpqW1L2j1XJjl4fQvgtiW0RC0nvBj+o19K8gVafoNvcS2 5Fo5Mwhwofsj61Ufk5woPyV9sHxuYLkOAiqdOXwk96I9ouAHtfBecTMaEXzUcDpjtxN0 ky73h5BODRtDm15xjGKR1tAj7Pt4q28Hsv4IzvtGQXjiDpiK8VrkehAvTwkyZ3J/WJbK os6Q== 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=kFG9UmTY34FL2o455TQzKeJyYhqM2Uws405NMCYUxMw=; b=G9WoVfrmX1lQ3oZ4WVUiSLvBUCqERMZW2nrDGFmj5vRPE2g8p/VglFEqKq8Of+/fCx snOhm6njGBbpZPCMaGpoFf3RRc3BA3fb43g5Zofh1iYuAPUnddbWCh8quD3tSBdzwgPR HIUZdgP0bjrTPyd0CsA67pxxEqv1QRT69XC33fRTZVOYaVWVBmKIkgJ4p0dGmG8YGoX2 cUj/mMnUbmrCQD/qWl0MAaw9Ws0FrKTn1Oz9Xw66N/GhUyTm7UxUHYDbjhuDHk3Wt0a5 C2zajBxOIsh8yOdTk5f809qEhL6buhvQl8NhQ97NUqSrhibecV36aI6WUyZWJnqEly5r i8RQ== X-Gm-Message-State: AOAM531LRwmhNFDyucRLNowCsjPZHbS1WFUQzMIdGfL7h1sG6L7CQqXx iHByA2gHB9Ymg8YwPiprqX8TaU78zpk/8isksLk= X-Google-Smtp-Source: ABdhPJwXVM/751B52kVoWXKx3AFn4ZLah55O7loAH4rCaJ5nAaRlg/Oon8NmykeiTT17qOEfSWbMpA== X-Received: by 2002:a05:622a:216:: with SMTP id b22mr730052qtx.148.1639706741314; Thu, 16 Dec 2021 18:05:41 -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 l15sm5890257qtx.77.2021.12.16.18.05.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Dec 2021 18:05:41 -0800 (PST) From: Philip McGrath Date: Thu, 16 Dec 2021 21:03:08 -0500 Message-Id: <20211217020325.520821-29-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211217020325.520821-1-philip@philipmcgrath.com> References: <20211213060107.129223-1-philip@philipmcgrath.com> <20211217020325.520821-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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639706954; 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=kFG9UmTY34FL2o455TQzKeJyYhqM2Uws405NMCYUxMw=; b=lisAaUsZxYhe5eNoRZzlnkIOti8g4QfA7dvcrDvIQ6wBxDCKg/3AZv7TEeJe3v//6iUblV pYwy2xauTPNM7ycATS20RtEryGb+Pv5NjTP8U0FY76VN2U6JFHKqLJxgYmvrJDN+RRy8Fg FINQeHhbXNVQJ478RaNavtd9YyE6mS0fdfh++eA3LkxPUI4QxDb5YAlhAdhIvB1FDVVEep Ph5eHIYzSYBHnk4QBtE/EtvoZ3nupDV0lwo8S41vyQhW/OK6mPOKtd5bj5oc4LYmkx6beR +dFkopBt+zvMHRMmnhefmofdjfQa1qUjlFbekmxJ/96sSADNK4v3TTlZfhjijg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639706954; a=rsa-sha256; cv=none; b=PThO507l8mZaQI0+OtY/ce4Y4Pur5/8bwIMwcijopJXH0KtJltT65pmPtvYAHQ9fLiJDyq Oml402piDzNle5Fbx0vORKOQKXDmIilikLg7sN0pHZny9WctCfxwCpY80+ZVBzHsIAThtl /WWGJHzlTRYG6ouBCLxM9C3QR17ItUGWKVoYy0dqUTkQe6V/qEM+Nj2OQ22E30QEz4SKTz pmna0Vy9Q8asLa6VS+vbyVH38LXTp9FM1XHgF54Bqr177HdoV5+VvChw5lS7esDNCXO4OF 7XqxbrwcjZbJzCEir9452jvd7wzz9HziaSqwCjhSQLFWER3weODeI/l5lP9G0g== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=bMa3IeGw; dmarc=none; spf=pass (aspmx2.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.01 Authentication-Results: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=bMa3IeGw; dmarc=none; spf=pass (aspmx2.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: D73D53599C X-Spam-Score: 1.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: ow2cxkEQitsN * gnu/packages/node-xyz.scm (node-addon-api): New variable. --- gnu/packages/node-xyz.scm | 62 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm index d8ce7248f8..beebac7a40 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)) @@ -588,3 +591,62 @@ (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 + (list python 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