From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KAjjDzTitmHMTwEAgWs5BA (envelope-from ) for ; Mon, 13 Dec 2021 07:03:32 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qOuhCzTitmEmPAAA1q6Kng (envelope-from ) for ; Mon, 13 Dec 2021 06:03:32 +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 aspmx1.migadu.com (Postfix) with ESMTPS id 0D2CC2C26A for ; Mon, 13 Dec 2021 07:03:32 +0100 (CET) Received: from localhost ([::1]:40084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mweQt-0001J5-5x for larch@yhetil.org; Mon, 13 Dec 2021 01:03:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mweQR-0000pd-S5 for guix-patches@gnu.org; Mon, 13 Dec 2021 01:03:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:42159) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mweQR-00074p-IV for guix-patches@gnu.org; Mon, 13 Dec 2021 01:03:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mweQR-0002RZ-F0 for guix-patches@gnu.org; Mon, 13 Dec 2021 01:03:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v4 04/45] gnu: node: Add an npmrc file to set nodedir. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 Dec 2021 06:03:03 +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.16393753659283 (code B ref 51838); Mon, 13 Dec 2021 06:03:03 +0000 Received: (at 51838) by debbugs.gnu.org; 13 Dec 2021 06:02:45 +0000 Received: from localhost ([127.0.0.1]:53688 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mweQ8-0002Pf-LI for submit@debbugs.gnu.org; Mon, 13 Dec 2021 01:02:44 -0500 Received: from mail-ua1-f45.google.com ([209.85.222.45]:35738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mweQ5-0002PE-GD for 51838@debbugs.gnu.org; Mon, 13 Dec 2021 01:02:42 -0500 Received: by mail-ua1-f45.google.com with SMTP id l24so27361166uak.2 for <51838@debbugs.gnu.org>; Sun, 12 Dec 2021 22:02:41 -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=oMJBdwZ4+Xn21yGOr6RykspdCfJ7NdoBqQsI1LH/rLk=; b=WdOp41oMYvsBwTUTW2LNrgHvGiXZBSKg29/mSB5WHhHNB/+6UaXDSpWeFYx9BQJcTs 93lnKEy9iw722yKG5ppWaYS7kpOihMkGatKIV6io6F3vBO7bPmBrqqXlF4907NunBFae jpqPwfKV2vFP4tQ6AIg6WUvCgeIL0nQl/jByEDmkkuSuPnxoRQZepyzklWgIH+fFjGrV cMZKRZtWQSvh/2FYNASQFZlfov5nb57E3hia2+5O4YOfLFshdSOoXYtFs75L9ZwsHpUt Fo56y4i7ZnNQ07N8UcfnSSR4LRdrNp9dnbtJ0g0Cnv+0Mde13mLeFVh/tKPt/ISDhLHO bAAQ== 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=oMJBdwZ4+Xn21yGOr6RykspdCfJ7NdoBqQsI1LH/rLk=; b=7fUS09Gjm8GtJzywJY4AIEGKnM9CgEhf0MBG3igBGXrXIwjHo0lLt03XHcf7wxlgnd N0zNX58SxlG/1OYnJpWBVPLYFXnDLTTko+aEfvrVf9EgDK3R/KGanM/Vhaq1Sb2ENc5Q z+SsHWVRiW4usNWie8d+Dx8mshoUe2AtcWEBUfmh+Vxp3yO75ouxxIMfELFcQ7kk8Nk1 c4BcaiK8IDQwjJu8j4N4FD5pqeVJMXYeQ1Q4WPwlKSZiDrs9RT8KWJ7gKTzO7bBszOaR ZzuKQO9x6b/B2arb1KBeVVhcDQLCuZlvfqQPqPgEhShWyxIavpjUZ6uh6jHw9NPUQ92v /NIA== X-Gm-Message-State: AOAM532D4uIQ3cAhwGD5/6wMAnacNIyRip65tQKwofnqqx3aDrzNdyK9 lMKCTvpA/HYKCd35xCqdg/NsQWxwWyN08Hgoi58= X-Google-Smtp-Source: ABdhPJwraxH+4DXzcohl/mBEuYq7EBQPUpo2Rj1xBxZxtCjGl5veq6ltZuD+fr1vIUxfQlbKUF5jhw== X-Received: by 2002:a67:1ac1:: with SMTP id a184mr24057470vsa.22.1639375355970; Sun, 12 Dec 2021 22:02:35 -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 92sm3759120uar.19.2021.12.12.22.02.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Dec 2021 22:02:35 -0800 (PST) From: Philip McGrath Date: Mon, 13 Dec 2021 01:00:26 -0500 Message-Id: <20211213060107.129223-5-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211213060107.129223-1-philip@philipmcgrath.com> References: <46a042bc08eb72a068b1e8c69bfe28cf2d4b2e53.camel@gmail.com> <20211208202838.752542-1-philip@philipmcgrath.com> <20211208202838.752542-5-philip@philipmcgrath.com> <877dc924h7.fsf@gmx.com> <5c62c3ce-dd50-5dcd-00ed-ff1524be4e0b@philipmcgrath.com> <20211213060107.129223-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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1639375412; 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=oMJBdwZ4+Xn21yGOr6RykspdCfJ7NdoBqQsI1LH/rLk=; b=k5vyDXHGy6Ii9lulwAcN3t20IJ9/1eKLjbTN88/WTX0jpB4xp6pVrcm/hsbbkly6oaondT r27BAoIbFjEZzE72vZF0h2xC1pVJqZtTet9G2Ti6z3RE1cwXb5zjX4eog7oitPwLX+nBCM kuaKL6HqUtKBkEbQm6z9tj02FCUsXHb4207xO7gzPwmrqNMEGlDLR7X/RLt/8GvxjZliV8 zvRafWazuHAHUyQc4/aQKMUXrwzp9NJOW4oft0jw4DLqa09jM2e2tE9H3RLomm1iXtusnV UIIOrBp+QK1ti/3wlriw92rReFy7ICsn250rKFBw7ijhCpmQdjfh2eHmQ7QTBw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639375412; a=rsa-sha256; cv=none; b=BVSrK7MdekL7291uGwcbDxuK3dcxgjGkRGuLbR6CjGOVa1yaTqFXzwhdy/fdCqi1HLtwAq H4+H1jxDK3vbmtm2ho6FqVXrSx71737S4ngLCDDIw+c2nyahROzAR5mQ4YvybGEnEdK9G0 NWl4Pvll6RRm46yLoC5HM1B4NjbDtK3W+/CLE146jhIgq85tcrJiABfCP4PIHE4GyNDfFG VGf1vOcegG2k7xDLGnIRMKRl0eKwwyegXWGqhaq/mPxQmmSt6fgQgP14ZqhbIJFnN79OuF HWSbAmJIVmnjeVbhg2XOryH4sz5A56qwFlvvWN1Ha4D7LNTf8SucTk0txXr2dg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=WdOp41oM; 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: 1.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=WdOp41oM; 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: 0D2CC2C26A X-Spam-Score: 1.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: fHwTqoibUjke * gnu/packages/node.scm (node, node-lts)[arguments]: Add a phase 'install-npmrc to create a "built-in" npmrc file that configures "nodedir" to point to the output store path. (libnode)[arguments]: Delete the 'install-npmrc phase. --- gnu/packages/node.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index a57a74fb81..346cbd488d 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -250,7 +250,24 @@ (define-public node (find-files (string-append prefix "/lib/node_modules") (lambda (file stat) (executable-file? file)) - #:stat lstat)))))))) + #:stat lstat))))) + (add-after 'install 'install-npmrc + ;; Note: programs like node-gyp only receive these values if + ;; they are started via `npm` or `npx`. + ;; See: https://github.com/nodejs/node-gyp#npm-configuration + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (with-output-to-file + ;; Use the config file "primarily for distribution + ;; maintainers" rather than "{prefix}/etc/npmrc", + ;; especially because node-build-system uses --prefix + ;; to install things to their store paths: + (string-append out "/lib/node_modules/npm/npmrc") + (lambda () + ;; Tell npm (mostly node-gyp) where to find our + ;; installed headers so it doesn't try to + ;; download them from the internet: + (format #t "nodedir=~a\n" out))))))))) (native-inputs `(;; Runtime dependencies for binaries used as a bootstrap. ("c-ares" ,c-ares) @@ -818,4 +835,5 @@ (define-public libnode `(cons* "--shared" "--without-npm" ,flags)) ((#:phases phases '%standard-phases) `(modify-phases ,phases + (delete 'install-npmrc) (delete 'patch-nested-shebangs))))))) -- 2.32.0