From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kMPYCqEVsWFXCQAAgWs5BA (envelope-from ) for ; Wed, 08 Dec 2021 21:29:21 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id CBOiBqEVsWF6EwAAB5/wlQ (envelope-from ) for ; Wed, 08 Dec 2021 20:29:21 +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 C999E9030 for ; Wed, 8 Dec 2021 21:29:20 +0100 (CET) Received: from localhost ([::1]:43930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mv3Z1-0005jw-W3 for larch@yhetil.org; Wed, 08 Dec 2021 15:29:20 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mv3Yk-0005Ll-TE for guix-patches@gnu.org; Wed, 08 Dec 2021 15:29:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:58244) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mv3Yk-0000B9-Lr for guix-patches@gnu.org; Wed, 08 Dec 2021 15:29:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mv3Yk-0005ph-Hi for guix-patches@gnu.org; Wed, 08 Dec 2021 15:29:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51838] [PATCH v3 03/43] gnu: node: Patch shebangs in node_modules. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 08 Dec 2021 20:29: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 Received: via spool by 51838-submit@debbugs.gnu.org id=B51838.163899533622337 (code B ref 51838); Wed, 08 Dec 2021 20:29:02 +0000 Received: (at 51838) by debbugs.gnu.org; 8 Dec 2021 20:28:56 +0000 Received: from localhost ([127.0.0.1]:41541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mv3Yd-0005oC-MV for submit@debbugs.gnu.org; Wed, 08 Dec 2021 15:28:55 -0500 Received: from mail-ua1-f44.google.com ([209.85.222.44]:44583) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mv3YW-0005mu-JD for 51838@debbugs.gnu.org; Wed, 08 Dec 2021 15:28:49 -0500 Received: by mail-ua1-f44.google.com with SMTP id p2so6849981uad.11 for <51838@debbugs.gnu.org>; Wed, 08 Dec 2021 12:28:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=vNLOSTWhsUvYl4zbQmT0Z6mwdgkAqlBATEO6lq8SgZA=; b=OCaN3+2LpdQqdE6Hs4Kefq9OVEHl3A4SOlWQ7ijfqT3ZNz706H9Cn9a5JO8MUOfW/9 x952Hp3MF/0nb9yFRnpodKPJKE8mBlqKadGPxxqwhWOvtTKY/pFe5Q8272etHT77ag3Z NjfGgr+98UDawyD02413LrkCnb/ln7x7f6FZ7L7w+MQbDHM5JAyNiS1+DCoHVHbHQVMT vh46sEdx75L5WIv1vRAUYg0X3Z0c2hQ5mOImuKhLrIO0TZi0vy81zs6/vvYX1eSbc+N9 giNXmn6yE+offTyuD3TcSoG3kaiVmNfoQP+MxkbD+cmbXfKx8M3N7/p6I4UQS+3Nbu1Q oPcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vNLOSTWhsUvYl4zbQmT0Z6mwdgkAqlBATEO6lq8SgZA=; b=ny5cdB6OLp5Lu5M0AeOjdZImUNNLJT9EJpQBseg4nwlGT8RaegG3rDcUvPgHBSszlR 0i9sJbj0sitSD6LDnJQkZtL2aeqrrOBJsLtSmv0V9fhUdlhODtU4KKPSPHG9o2KCRuaS Bps0XIoDzbzGYXuy0ekPNbJOjULhEXNMNjsykuQ5VVQP8PS1Wgh58R1mGPVsHlmRBVsX j3rFRxB872G2WFU1WrGvmNQqGVYAN8TrRM4Y5iaghMQSrBAsNnEmArEU38YfIg+lLEmD GldN9QuaYy6DFOXGuXc5ugnZjy9ICTyoiOJ06zV8E4SxI2Z7MDUNdnkDYjYEotsGOozs B5XQ== X-Gm-Message-State: AOAM532PS/+t2DR4l3lw5n9Bqx9ggd4XL/fCMCHBoTtZLFXzWpvFA2CU besAIH8dbL+dEU5DDSPoXUoOccFIpocZOXeTI5A= X-Google-Smtp-Source: ABdhPJwFid7i6ah0yHT38zV75S9K222oziLNTPoW22ahKFI6YhXSu9XipL4QUcoOCsJNUmmc6GzP+Q== X-Received: by 2002:ab0:383:: with SMTP id 3mr11255513uau.4.1638995322885; Wed, 08 Dec 2021 12:28:42 -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 bj50sm2512958vkb.7.2021.12.08.12.28.42 for <51838@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Dec 2021 12:28:42 -0800 (PST) From: Philip McGrath Date: Wed, 8 Dec 2021 15:27:58 -0500 Message-Id: <20211208202838.752542-4-philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211208202838.752542-1-philip@philipmcgrath.com> References: <46a042bc08eb72a068b1e8c69bfe28cf2d4b2e53.camel@gmail.com> <20211208202838.752542-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=1638995360; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=vNLOSTWhsUvYl4zbQmT0Z6mwdgkAqlBATEO6lq8SgZA=; b=rjNk2Xojqqj1XqJd3C/F2C/YPiW6Hk0hV9AHfqyaRcKyU2XqvjQ+dlN+P0hk57islaNpPd NX1k/YoXThEUFSdomPioYUUwrbHSY7Peja35wTho6nspE7uSfxiIQXEIDAB6U33xbrwXl0 W0+zDS2wGaDwfuNIPr1OqEpw6WG//wDkJRDxSDu0AtqP/FSbhnKgiwjqpuVG2q/IycfqA1 vDeA4/kHsLHYUTt9scIWWHwQIkfZBefI7bgopcmoMDsCRpbYOnzCMUh8PMhC2R22UXrcCn 9Bp9+NwLDts3nr6OLciL4MbJmeIVRrpezNTj1TEW5ssOWlQ5ZycpD/y3NIkxXA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638995360; a=rsa-sha256; cv=none; b=WdmpvPvQ9mRXDQ1cnEAzxxtJQQsoB8mUqB7RdmN03jQYCuZlG84D2WETrtkZdElC5KkOwb OnVH1kBQOyKqfrMmIpibg4PNWGBq7/A1FR7jkxBhgVBMj5LyWK8riiNOhBMxXpeAywJQvM KyLqNEApV+POsscK5n755wwjQj2OsOvCuLi/22wKIyQkXAF+pm1fvd17SKYCsWmyTEimAK fvMEBSSlvrYL+cdAXnHh6IvAMjhKvIsQ1g7ATvJYNQJDK7wR++FmSmls6P2nTCVQ8Z8BNJ DENMPboFdI0AkKHp3NAxrrOPlbg2ZG0wuoHLIV/Fc+yIIotvK9t5WysZPCFJ+Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=OCaN3+2L; 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.45 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=OCaN3+2L; 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: C999E9030 X-Spam-Score: -0.45 X-Migadu-Scanner: scn1.migadu.com X-TUID: aY/22IxbGvvG * gnu/packages/node.scm (node)[arguments]: Replace 'patch-npm-shebang and 'patch-node-shebang with a new 'patch-nested-shebangs that also handles node-gyp and other shebangs under "/lib/node_modules". [inputs]: Add Python for node-gyp as "python-for-target". (node-lts)[inputs]: Likewise. (libnode)[arguments]: Adjust to delete 'patch-nested-shebangs rather than 'patch-npm-shebang and 'patch-node-shebang. --- gnu/packages/node.scm | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm index 71b66774a6..a57a74fb81 100644 --- a/gnu/packages/node.scm +++ b/gnu/packages/node.scm @@ -237,21 +237,20 @@ (define-public node python (string-append python "3"))) "configure" flags)))) - (add-after 'patch-shebangs 'patch-npm-shebang - (lambda* (#:key outputs #:allow-other-keys) - (let* ((bindir (string-append (assoc-ref outputs "out") - "/bin")) - (npm (string-append bindir "/npm")) - (target (readlink npm))) - (with-directory-excursion bindir - (patch-shebang target (list bindir)))))) - (add-after 'install 'patch-node-shebang - (lambda* (#:key outputs #:allow-other-keys) - (let* ((bindir (string-append (assoc-ref outputs "out") - "/bin")) - (npx (readlink (string-append bindir "/npx")))) - (with-directory-excursion bindir - (patch-shebang npx (list bindir))))))))) + (add-after 'patch-shebangs 'patch-nested-shebangs + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((prefix (assoc-ref outputs "out")) + (path (map (lambda (dir) + (string-append dir "/bin")) + (list prefix + (assoc-ref inputs "python-for-target"))))) + (for-each + (lambda (file) + (patch-shebang file path)) + (find-files (string-append prefix "/lib/node_modules") + (lambda (file stat) + (executable-file? file)) + #:stat lstat)))))))) (native-inputs `(;; Runtime dependencies for binaries used as a bootstrap. ("c-ares" ,c-ares) @@ -274,6 +273,7 @@ (define-public node (inputs `(("bash" ,bash-minimal) ("coreutils" ,coreutils) + ("python-for-target" ,python-wrapper) ;; for node-gyp (supports python3) ("c-ares" ,c-ares) ("http-parser" ,http-parser) ("icu4c" ,icu4c) @@ -799,6 +799,7 @@ (define-public node-lts (inputs `(("bash" ,bash-minimal) ("coreutils" ,coreutils) + ("python-for-target" ,python-wrapper) ;; for node-gyp (supports python3) ("c-ares" ,c-ares-for-node) ("icu4c" ,icu4c-67) ("libuv" ,libuv-for-node) @@ -817,5 +818,4 @@ (define-public libnode `(cons* "--shared" "--without-npm" ,flags)) ((#:phases phases '%standard-phases) `(modify-phases ,phases - (delete 'patch-npm-shebang) - (delete 'patch-node-shebang))))))) + (delete 'patch-nested-shebangs))))))) -- 2.32.0