From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gBLnNYjwu2EeMwEAgWs5BA (envelope-from ) for ; Fri, 17 Dec 2021 03:06:00 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SNKpMYjwu2HvcQAAB5/wlQ (envelope-from ) for ; Fri, 17 Dec 2021 02:06:00 +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 9DCBE352C2 for ; Fri, 17 Dec 2021 03:06:00 +0100 (CET) Received: from localhost ([::1]:50862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1my2dD-0003Cj-QL for larch@yhetil.org; Thu, 16 Dec 2021 21:05:59 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54496) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1my2cL-00037l-DI for guix-patches@gnu.org; Thu, 16 Dec 2021 21:05:14 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53987) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1my2cI-0007YH-RU for guix-patches@gnu.org; Thu, 16 Dec 2021 21:05:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1my2cI-00055P-ME for guix-patches@gnu.org; Thu, 16 Dec 2021 21:05:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v5 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: Fri, 17 Dec 2021 02:05:02 +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.163970665519346 (code B ref 51838); Fri, 17 Dec 2021 02:05:02 +0000 Received: (at 51838) by debbugs.gnu.org; 17 Dec 2021 02:04:15 +0000 Received: from localhost ([127.0.0.1]:37269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1my2bX-00051x-6R for submit@debbugs.gnu.org; Thu, 16 Dec 2021 21:04:15 -0500 Received: from mail-qt1-f170.google.com ([209.85.160.170]:33531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1my2bQ-00051Q-VS for 51838@debbugs.gnu.org; Thu, 16 Dec 2021 21:04:09 -0500 Received: by mail-qt1-f170.google.com with SMTP id n15so1261817qta.0 for <51838@debbugs.gnu.org>; Thu, 16 Dec 2021 18:04:08 -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=pAjgFEXwjFWIf/Xl/G42tFKyq9sxXqZV9/ZAN/eqYGI=; b=FehbZ2xqRw5sgrY4a2m34n8XWEXvXOBSYVNoWyry+wByHEyReD/Gb2Bh1LBdmdig7k axjrMPLIVvFG15zD7jThqvZoWpc04qB0shzGW1o28VkqeDDBq3/SBM+z8qyCsA4l5oOl 9rm9BImCyz3lKZJPJoRC3uaPxh9ArjX/7na45/gGsCE8AvjobQM1K/cNdsHLIrECDDMY EkujuTdyS2voOGmC1savCWGD12xTTEK3E5AWGlFZjRC6rSEi+jAWjbaUK6BkhCYOAr6p YLfgJzhB9LHeILb0wYP7YK5wroR3Fj5wVk27kn13TyxyLeaKgsnaXaujFgpzzYme9OK5 UrPQ== 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=pAjgFEXwjFWIf/Xl/G42tFKyq9sxXqZV9/ZAN/eqYGI=; b=QpBJDwnw5BGqpoqqLnCzEC4mUZEQ3oXK3FiFegY/zlZjrjDRJir4aMoZCkGQqRAxME miaj4X7wNlGdvTaoZ3RN47VjTXQ/yzwZ+SLuXAwRZzDEi+oaKEEB0oWXTsa6Wope2Kv4 5tbux4VSOOwopMDe1Nqd8tT4BB+Aa5rQHlyUiREREj2/CoNr7FWViv4xM1lNEbhNEpab Vwtsm8YGYMTTB8nq9Z4P465VUN5U4HNyYYZ1aHZtlikSD8tX3OR8tri8tk5j2SwjX3BC ZHGUP5ZYrs3SnSS5/tqREPD5qLj79k3txCf2ZOjmR8cL+JeOVd/UQ0tbDI2GBr0nbsbY IOtw== X-Gm-Message-State: AOAM5336vf1svQa3xcHthotRIAE7JYnrEp2XKSkiQ50VHLf1SwevfsPI ZQcaEdmm9/SGVrSFn/DEb/GVmQKzUEfEO0lKRDc= X-Google-Smtp-Source: ABdhPJxCp23oKqgT7XXdhhdjEPu+OcUZASrDLwmZv4wMZcI65WgCtwMIVevq+CjU3mFCVa2OKYWWYQ== X-Received: by 2002:ac8:5d89:: with SMTP id d9mr695913qtx.49.1639706643538; Thu, 16 Dec 2021 18:04:03 -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 x16sm3913299qko.15.2021.12.16.18.04.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 16 Dec 2021 18:04:03 -0800 (PST) From: Philip McGrath Date: Thu, 16 Dec 2021 21:02:44 -0500 Message-Id: <20211217020325.520821-5-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=1639706760; 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=pAjgFEXwjFWIf/Xl/G42tFKyq9sxXqZV9/ZAN/eqYGI=; b=ilMLPUWVhKi7iAs6kA4sN2oetlN3GY2sJyhS8A+gTj1dg9aaFClN+90+dhKreI/ch8cl2m qIDRt1g56O7tUuWu5go7ifXgqjDIiCLtDMAHV+Hq3WoblUG+qLcsemXw/07ImPvTkUmzSb nFec8DRNjx9xPQy97RCalA3la4W2DuylU+hUWaCQcpyJ8JQwe2sdjtIJnt6WOrQ44RUaZ5 u06gCeoFQGSNo0NPko/Du5S49hohTX1+elzgyg3U7M1IIhXndXykV6B2OfIzmXE6fFjQC9 0ZIeHPBXxKYNPhDKp2kP7sx3984ps02wOJlJd3ljs3rQ7lIxk/pwdWT93n+xQg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639706760; a=rsa-sha256; cv=none; b=eUp8XxnAOvS8kR4FfuJMPV1IkTeSSiX9UTbsSH1G4m/AT+XtT9fjM34uAarFlECK2SWCT4 h3scgiTY3av66HGhUf66oXdiAQDV3RomqXI9HqJD3XduYq4C64ppWvjzMQvDiGlZZ6CO4J Pn+29dByFTWfjQthfjiBNhYwNplMSJxRiOcxDfXgFCtMJK5st9+4UohfiJhTpsugV1ujl+ xQ6YzJkS4aE3WvgbJxF7ogdnxC8iDVrvmYfiZgAay0I8ivJtiOHwELl0VD8zD8kz7r25V6 1O+ZFrU0RrY2Gd4uu4Dl4XBNp5kOcECqp48tYL0BZrovqoCt4tqSSxBbfu4SzQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=FehbZ2xq; 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.49 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=FehbZ2xq; 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: 9DCBE352C2 X-Spam-Score: -0.49 X-Migadu-Scanner: scn0.migadu.com X-TUID: JnExcsDv++s1 * 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 3bd98c715e..51a393caab 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -261,7 +261,24 @@ (define-public node (find-files (search-input-directory outputs "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) @@ -822,4 +839,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