From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MCCkKZM012GwMAAAgWs5BA (envelope-from ) for ; Thu, 06 Jan 2022 19:27:31 +0100 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GPLnJpM012GMggAA9RJhRA (envelope-from ) for ; Thu, 06 Jan 2022 19:27:31 +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 aspmx2.migadu.com (Postfix) with ESMTPS id 128895FBA for ; Thu, 6 Jan 2022 19:27:31 +0100 (CET) Received: from localhost ([::1]:45100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n5XU2-0001NU-6C for larch@yhetil.org; Thu, 06 Jan 2022 13:27:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n5XSm-0007Tw-M7 for guix-patches@gnu.org; Thu, 06 Jan 2022 13:26:16 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n5XSk-00013Y-Kg for guix-patches@gnu.org; Thu, 06 Jan 2022 13:26:12 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n5XSk-00057E-Ij for guix-patches@gnu.org; Thu, 06 Jan 2022 13:26:10 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v8 24/41] gnu: Add node-addon-api. References: <20211114124151.36743-1-philip@philipmcgrath.com> In-Reply-To: <20211114124151.36743-1-philip@philipmcgrath.com> Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 06 Jan 2022 18:26:10 +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: Philip McGrath Cc: 51838@debbugs.gnu.org, Timothy Sample , Pierre Langlois , Jelle Licht , Leo Famulari Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.164149351719293 (code B ref 51838); Thu, 06 Jan 2022 18:26:10 +0000 Received: (at 51838) by debbugs.gnu.org; 6 Jan 2022 18:25:17 +0000 Received: from localhost ([127.0.0.1]:42239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5XRt-000510-5N for submit@debbugs.gnu.org; Thu, 06 Jan 2022 13:25:17 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42799) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n5XRJ-0004uJ-AV for 51838@debbugs.gnu.org; Thu, 06 Jan 2022 13:24:41 -0500 Received: by mail-wr1-f65.google.com with SMTP id w20so6471401wra.9 for <51838@debbugs.gnu.org>; Thu, 06 Jan 2022 10:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:subject:to:cc:content-transfer-encoding:message-id :mime-version; bh=GFOcojuJHAXghnIVrq5k1VVXU4bocim1vyybjshe5b4=; b=eZItN79yOVGv/3Jz/ipi1sGbzSpz+ylTgIlg00qGQxrxsScWVoHnwT5ClgN3cGzWWh estRKGvTHUc28czbqyWX2LWH4YJtswoFFd7mCNKm1fEew5/ny6vlfuavS4N3Ihhl+njO QQgMKhb960TFeytr94Q/QGU4qB92Bxa+ccBbEEoK38FFJWr1wmEjV1XFDeHJaJIPB7vb 0UXBm3WsYCur2VNwfz+YC0Tu9muyS50p1kq8vzP0SakBjZpQDse8YL0Yz/WyzX8hG/qc 2a5MN+aattZC/ZmhzHO8JmxsTnLxk0AqoWKMxG7CFpTIAPRySrrpAqF1zFJpPTZP384H 9A8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:subject:to:cc :content-transfer-encoding:message-id:mime-version; bh=GFOcojuJHAXghnIVrq5k1VVXU4bocim1vyybjshe5b4=; b=W/hGWalEM2c9/lqGY1fnCETF7TmU0RrwMl30KFssCC40+BoRSznzy9KQlohYlS890a h7vAz748DV0kM9tyo1Zr4EnImRf+nLCOXoVUuajlg5Jh3i1cMxRj5ZieWc0nNY5z8Fc7 sW7r1ybs0tLnerp7MXIhp+Zm5YEtgnr7CH9otvlLcuN1l+hSOJ6WKWnzFT3IFxFtjjXa Wze4cjueN5BEPSkYcCUOhmGBcym/EcJhdKmqN2qrybWb/YDzW2ptImdRj3WEOTQEVL6o XvccMa2rH0dqtYCm6f3aaKL92pfbAXXNyaTUCdX/dHmdqZn44F1e04c3IY7V4nH8JkW/ CP5g== X-Gm-Message-State: AOAM531mfcka9qEZrhMntxP9QIUsR+nOahAHVfWGHzWoCAEI9TGp1qBb 4NcJV0vpCibQNZ9A8uZQkoU= X-Google-Smtp-Source: ABdhPJzg+rYrui874SUH7Z6JM9rBfAiLlo3L3zcsZ9PBH0ybKqm/cTfMj2KS+7xsjgIUx2gGilXeyw== X-Received: by 2002:a5d:5985:: with SMTP id n5mr52063310wri.63.1641493475840; Thu, 06 Jan 2022 10:24:35 -0800 (PST) Received: from nijino.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id b17sm2693311wrq.91.2022.01.06.10.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 10:24:35 -0800 (PST) From: Liliana Marie Prikler Date: Thu, 30 Dec 2021 02:39:02 -0500 Content-Transfer-Encoding: 7bit Message-ID: <957e71aeaac9f5a91648d57c10cd81b59efc608c.camel@gmail.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+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=1641493651; 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=GFOcojuJHAXghnIVrq5k1VVXU4bocim1vyybjshe5b4=; b=dzWwyPnjlwuMBu8kiHQeig1HpdnRJJuD6xbg3ljOph78m1iGzBEBLrpys6bb2VxeNY8bOm y0Eb7eP9Vyu3Opb7O2QzrIKTug3bxFrfUV8ByiUktD/qBBIr7v1fvoeby17N0z7gGYqaZP K2c9zPnZzHnPxAR3mNWFKe7pKpNaOGJO1r+DY6VOtEzqbDKFIpZkOQZGZOI3hdFFd3Qjju R3MNWrM9m5nzGR/HO6fGVU8ZCnJdaQ3yJr3BWRDK4nk27vWy4ePR9paNl2dMX6xnWCzOS5 IgWyxj7oLrt/ssxEo/2NNN9tTcNGrbxrCoorj7/qCToXavFPzSY7v2OGltX70Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641493651; a=rsa-sha256; cv=none; b=UJx4956wvzU0GKccL72sn017LKkUOqI4rM1TtvN5R6PPg2n/3KrVxsV+lh9vnK4ywCUC0B i+4ot7uryLe/L2sf3Az9Z9sRZDV7TLaykOCFLyIFmL8JFa9QLcfCCzy/KL+uTnkJK+c0l5 DcnjAGv34Poq2ucJOy72nwm3xkSbrrR+lAE+zPrzTJiqcsWy2ulMUlkXAumaIl5hvOAqiN jkRMXz95uyMGJCal4h3GM+o8qPSSuIPw67YpF471/aApaeSJN3meRYBR16plPNQGnwQ+FI e5ezxRKPQDY0Ej+6Pnxon7WepaZKj4yt9cGKNzTwuoF6nQR4BMXFfHJNjUQsoQ== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=eZItN79y; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: -2.30 Authentication-Results: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=eZItN79y; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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: 128895FBA X-Spam-Score: -2.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: HMW9eXJIi1xK * gnu/packages/node-xyz.scm (node-addon-api): New variable. Signed-off-by: Liliana Marie Prikler --- gnu/packages/node-xyz.scm | 77 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/gnu/packages/node-xyz.scm b/gnu/packages/node-xyz.scm index c689c3e3c2..325424f8ca 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)) @@ -610,3 +613,77 @@ (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" + "^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.34.0