From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AOm9HDxwzWH/CgEAgWs5BA (envelope-from ) for ; Thu, 30 Dec 2021 09:39:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id qEL7GTxwzWHJ/wAA9RJhRA (envelope-from ) for ; Thu, 30 Dec 2021 09:39:24 +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 1B8EAD341 for ; Thu, 30 Dec 2021 09:39:24 +0100 (CET) Received: from localhost ([::1]:37254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2qCS-00080G-K8 for larch@yhetil.org; Thu, 30 Dec 2021 02:50:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2qBQ-0006Ki-96 for guix-patches@gnu.org; Thu, 30 Dec 2021 02:49:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39677) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2qBP-0006MJ-Vk for guix-patches@gnu.org; Thu, 30 Dec 2021 02:49:07 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n2qBP-00076H-Ve for guix-patches@gnu.org; Thu, 30 Dec 2021 02:49:07 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v7 24/41] gnu: Add node-addon-api. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 30 Dec 2021 07:49:07 +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.164085051727135 (code B ref 51838); Thu, 30 Dec 2021 07:49:07 +0000 Received: (at 51838) by debbugs.gnu.org; 30 Dec 2021 07:48:37 +0000 Received: from localhost ([127.0.0.1]:51208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2qAu-00073W-Mj for submit@debbugs.gnu.org; Thu, 30 Dec 2021 02:48:37 -0500 Received: from mail-ua1-f47.google.com ([209.85.222.47]:43950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n2q9e-0006vg-I2 for 51838@debbugs.gnu.org; Thu, 30 Dec 2021 02:47:18 -0500 Received: by mail-ua1-f47.google.com with SMTP id i5so26221957uaq.10 for <51838@debbugs.gnu.org>; Wed, 29 Dec 2021 23:47:18 -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=H9te0wN9k/RYF8QQEbAWRKvtpPSKgu4d3zvempoTTFQ=; b=CreXZwIrI7tMFG//NHEaHBlmeQ30j8QcdsAP1dLsXAWCjWTU7T3u8DmnVgWfC6qF34 1M3lPPo2/vovvZwvBO2Ut65u1pabVSIihH44UF0lF6e7/LKxcrgA/bncd4oC1HyrhTwI 4vOXUVId/EQvNqtqfTRWAI2JzA8bJbFRmIVvCthMOoASxkYH81GB5Wg9dnKEkLvkSSv6 8eMh/3DWWZzAl4F+9LDHaeaC8dru8CFzFluXrcnW2ThncxLiYg5wTMW6KuOGXidaYArz gk0CoGO92nlXoUSyWKMCAlnvwh9fwIHkfUOtKe6rDCjUrGBuvbnFl/vj9fGBGWGaJbgu iq3g== 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=H9te0wN9k/RYF8QQEbAWRKvtpPSKgu4d3zvempoTTFQ=; b=VuU2MfQgtD9xM8nxTK2eE2uzN3zIJ+0fmoNSTPpnQ7TIQGm50weiGDizj3XmcoliFl KoVJvYQyzS/BYaehTF0igUrCVvq2dfpt+TSfqIhYkMQp271PmrbwHJg6PT0MfT8+vReY +ZXmwkhT3334OAGVXwU8/mPoMDyQrwohUnDQT1oHpzrPusNBirjF34KaTZpxkFdJA4hV DZXStgwC7y5Iapc4snPJMgU/50nZuXcyU/MqBYfmIvJI6O3qgMiprLDXSWCBcLTnOXp3 4dfdnGsBqe8JhLMsBLUeUHIpz9bRFFeQohSwv2XtVt4Ov2aInruWlmeFI38jYEnKzczC l1Gg== X-Gm-Message-State: AOAM530DAvb1sVMiBww/EfPS6Tce3s0bWpRF7M0a8lQOl23cpn/f2tMX 9Ltgva8T4QTo2y7xsiPn9A0T1kiuloLFwDHC X-Google-Smtp-Source: ABdhPJyCkp+dIBPUKBB/HxYANcmKV7Eqoi8p7M+Rs60alCiAVdQQGV/db5zQMadndaX0PVGxJlW1jQ== X-Received: by 2002:a67:b208:: with SMTP id b8mr8420005vsf.77.1640850433105; Wed, 29 Dec 2021 23:47:13 -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 l28sm5215804vkn.45.2021.12.29.23.47.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Dec 2021 23:47:12 -0800 (PST) From: Philip McGrath Date: Thu, 30 Dec 2021 02:44:39 -0500 Message-Id: <20211230074456.33433-25-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211230074456.33433-1-philip@philipmcgrath.com> References: <20211230073919.30327-1-philip@philipmcgrath.com> <20211230074456.33433-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=1640853564; 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=H9te0wN9k/RYF8QQEbAWRKvtpPSKgu4d3zvempoTTFQ=; b=IX6r7xUGK8dvVwCG+xZ+GoeFuqrNT5ECIOjouKOB/3+W5xytDHESNl7cKcz8IYztKGtqrn RrvmdX5s8yWM6A8OHNr9z57Uyqr39gAreR92G1UIeuPho1PI4lJ9PXH1TJd7lK3v4AA5bx 4pEeP3eSz2qxZNkKP3besbv0Ddz717PKlvskhuH1fQjdD8z3/Qxk1pWdOtkee+JhD0zGhl mHhoWkzgrH+6aYVZaGtaxhlNplQQCUc8Ja6xNVOT9Tuu7+6G7IA5KNtF140qD3qsZwyg9H xdap1QXarBl/bSw4GViGhHpw43t25xl43ZNcTLljUWgwBrGfsYuQhzbl2w/Q5A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640853564; a=rsa-sha256; cv=none; b=kSVQodUJg5qA00QRSyfY2ZXWOy6BX/KZSjuo+WgM1c45CBCGg8D6mncBOZOycvFom6grrF JxCjnWatF7x3watNO2GOFWBWpVYtE/eyHHMpAIK+tBey/HSZqcPGH4l2iugh0YRV+HYdgp EglWCGUBLmgR6VcbH0PvP8XFgjnwm7xONfhXdqsrATSeIwIkB3dYOxGvAJOEyXXR+EDTQj As6FV7lW1Bi6J3W12XegYqwlamh49oV2Z/QKNiI1/Tx33+7higIhuT09r53qVfAQtWFy95 eWDF6oE3WLUCuMpvgSBdCFRggoK20SoNfp34eFx1gPGRRIb+zkSebOC50NRTAQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=CreXZwIr; 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.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=CreXZwIr; 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: 1B8EAD341 X-Spam-Score: 0.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: syTeLBjKpSeo * gnu/packages/node-xyz.scm (node-addon-api): New variable. --- gnu/packages/node-xyz.scm | 83 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm index d8ce7248f8..91a007b55c 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,83 @@ (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") + #:modules + ((guix build node-build-system) + (srfi srfi-1) + (ice-9 match) + (guix build utils)) + #: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 + (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