From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6MIXJAxQ2WF5UwAAgWs5BA (envelope-from ) for ; Sat, 08 Jan 2022 09:49:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SMnSIAxQ2WF6oQAAauVa8A (envelope-from ) for ; Sat, 08 Jan 2022 09:49:16 +0100 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 EABA9433D5 for ; Sat, 8 Jan 2022 09:49:15 +0100 (CET) Received: from localhost ([::1]:47162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n67PX-0007vp-3r for larch@yhetil.org; Sat, 08 Jan 2022 03:49:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45122) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n67MS-0003nk-Rc for guix-patches@gnu.org; Sat, 08 Jan 2022 03:46:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n67MS-0004cs-JU for guix-patches@gnu.org; Sat, 08 Jan 2022 03:46:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n67MS-0000vR-IX for guix-patches@gnu.org; Sat, 08 Jan 2022 03:46:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v9 24/41] gnu: Add node-addon-api. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 08 Jan 2022 08:46: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 , Philip McGrath , Pierre Langlois , Liliana Marie Prikler , Leo Famulari , Jelle Licht Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.16416315373373 (code B ref 51838); Sat, 08 Jan 2022 08:46:04 +0000 Received: (at 51838) by debbugs.gnu.org; 8 Jan 2022 08:45:37 +0000 Received: from localhost ([127.0.0.1]:46374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n67Ly-0000s7-LZ for submit@debbugs.gnu.org; Sat, 08 Jan 2022 03:45:36 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:44631) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n67Lt-0000rX-BZ for 51838@debbugs.gnu.org; Sat, 08 Jan 2022 03:45:29 -0500 Received: by mail-qt1-f171.google.com with SMTP id a1so8029614qtx.11 for <51838@debbugs.gnu.org>; Sat, 08 Jan 2022 00:45:29 -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=ttKqu7t8pz/l2Bi7uwfhFDCEAg0CfvRdi1dwA2f1lKQ=; b=jw2p9PztPsi1ZrE/Mfz15kCsFSZfvJlK5UQQiAujA1I+qGVceL5ujG5JiGMbwrZmOK RrRO5V2Emx60jrokmmDpPbu6bS/NZkNZziegynAjsCTJP/+9bHt+GDhgtJRzZY3T3UIi tl6x5GRtaohjWPPCJaWy8AUhXImpa8TD5vtcSgmJ2mVBP6lH/DJH2SLXhZ1rrZMtvaeC Ec9JZnsIKEznlOJtjWoS0NKxKV9W1l0fi9sbU6OjyVR9JIueyKu2kyDUQ1aXjfQb0w2H 1JXkvFzcrz6QDMza5tsJoJbM9vGorhn4it12PUVWI5Wm9eJ7QcyEZNocFsYAN7mgST4j +2Rw== 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=ttKqu7t8pz/l2Bi7uwfhFDCEAg0CfvRdi1dwA2f1lKQ=; b=mfRqtnC/1rFsg+aYO23aiWEtfuBp3Zfx4HpIC7xtnVzI5xg4TOs6o8WyPJbs4axrds FI49M8qWQ+A5wNL4n3WIQwBuylllPfHh6qgkFG3yx/UNmMKL5XaNhfX2wJMtJWgSXMNN BV+2zvqtJfaGewCl9AyFW1rTCiPTxWFmHv5Njqbcnn0Qp+Xsw4dasttYko+h+qdFRIF0 rIzKQV7gnbBWjSTditju4axWLATApOU3apKHvTsGLgDJcwanHHiYnMrJKmwM/ZoutM5V 9XLo5EGLu+jb8TMz9Y5YZFJvOsPamf8nSu3GZv4cjbDpnZqAKeBj1GER+VJ5hX0VEYRd 9J8g== X-Gm-Message-State: AOAM533ZVWNqkCNmNS8Rlq/od/UhuDAR9+snPoR5x4WzDcHyICrgfdKV d2q7TUKgySSaNuKM+fjBxbw2VUV0ZwPDNn1D X-Google-Smtp-Source: ABdhPJzqXxjpSVSwsL+DNpq2WgNrQpXf8zzl2yBSAWrPwXzGkKWD0dKbEeNIRRmS7UqJ2mUP64GeNg== X-Received: by 2002:a05:622a:1745:: with SMTP id l5mr59078265qtk.663.1641631523798; Sat, 08 Jan 2022 00:45:23 -0800 (PST) Received: from localhost (c-73-125-89-242.hsd1.fl.comcast.net. [73.125.89.242]) by smtp.gmail.com with UTF8SMTPSA id v12sm670703qtx.80.2022.01.08.00.45.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 08 Jan 2022 00:45:23 -0800 (PST) From: Philip McGrath Date: Sat, 8 Jan 2022 03:42:12 -0500 Message-Id: <20220108084229.362642-25-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220108084229.362642-1-philip@philipmcgrath.com> References: <64e08d3a1838ed8507f33fae895545372960522f.camel@gmail.com> <7b04af28bbd57c67093ce8f33a648efec89693bd.camel@gmail.com> <441bfeb0-eb6e-81f6-488b-cdf1b09a78ef@philipmcgrath.com> <20220108084229.362642-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=1641631756; 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=ttKqu7t8pz/l2Bi7uwfhFDCEAg0CfvRdi1dwA2f1lKQ=; b=N78P8I+TnfXriCfxHIjBDvuil7hEJ3IZEPAnYZff2Xqfzxh5tRq2MJomMfCEXyWpGop4d2 Kfn8kBB2iR38TLuZDHZbVHYaznHqDHDBFfLPgOSbMbEVxJ5oOJvLEX36G0QYzAvzst4kXC tmAmsaL4aiaIxDkWXf/3/DHpp3s7kFqEGKwuV4IxbvQz/TNb1MXv6h4dr03JniK+PFn7to lg3bzFkT0/+Qefk6MHDumWhpkji/JtQpaKVifubV4JAuXUswNm/Q93ayr5k74/XLteRKY/ D9MRSpKozfQQK0ZDMQpZ66Nl/DFdu5wIYcvwFIyXzbczKpq7rBUm+ppmw8x1mw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641631756; a=rsa-sha256; cv=none; b=rqEXT3KlL2zMX72n1A1Xp9IZcQVqXTDx2qO2iRQk9ONeL7a6MnCFAV4qnvtP+Ym9XB+n0P agbN4jtBPglumSNr9197bQOaO4MapAmpG5S0MkygmUJHQVtgX8l0Ob1yv1bcFqZala4tye RXIfJYGnHzM2czXkmE3RPgg1qngtUK1JLeSh5DYLS1PhJk2A02yXcHcs75cNbVqIfAYbWI LJRGGeNSQnK7iQhXhJomT4oTUNRn8MbZoY70yuc1kVkrry3Jn2cDpd8aPNI4BvxYwpInwx AK1gYkSa8cLppDhHNEwye3MaWeaPN6g5ehLNj2hkp6Pl7xdNqcI+pZ42ooikGw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=jw2p9Pzt; 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: 0.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=jw2p9Pzt; 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: EABA9433D5 X-Spam-Score: 0.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: 8Jk01g7EG47j * gnu/packages/node-xyz.scm (node-addon-api): New variable. --- gnu/packages/node-xyz.scm | 85 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm index 0e05e938bf..637f116c3d 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)) @@ -614,3 +617,85 @@ (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 + `(#:modules + ((guix build node-build-system) + (srfi srfi-1) + (ice-9 match) + (guix build utils)) + #:phases + (modify-phases %standard-phases + (add-after 'patch-dependencies 'delete-dependencies + (lambda args + (delete-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")))) + (add-after 'unpack 'skip-js-tests + ;; We can't run the js-based tests, + ;; but we can still do the C++ parts + (lambda args + (define new-test-script + "echo stopping after pretest on Guix") + (with-atomic-json-file-replacement "package.json" + (match-lambda + (('@ . pkg-meta-alist) + (cons + '@ + (map (match-lambda + (("scripts" '@ . scripts-alist) + `("scripts" @ ,@(map (match-lambda + (("test" . _) + (cons "test" + new-test-script)) + (other + other)) + scripts-alist))) + (other + other)) + pkg-meta-alist)))))))))) + (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