guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: gnu: node: Fix npx shebang.


From: guix-commits
Subject: 02/02: gnu: node: Fix npx shebang.
Date: Tue, 29 Dec 2020 08:28:45 -0500 (EST)

rekado pushed a commit to branch master
in repository guix.

commit 1d77141f6d5004cf10d1f9ead53855f25a973847
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Tue Dec 29 14:24:50 2020 +0100

    gnu: node: Fix npx shebang.
    
    * gnu/packages/node.scm (node)[arguments]: Add build phase
    "patch-node-shebang".
---
 gnu/packages/node.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index f04e39b..9e07cd9 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2020 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -170,6 +171,14 @@
                     (target (readlink npm)))
                (with-directory-excursion bindir
                  (patch-shebang target (list bindir))
+                 #t))))
+         (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))
                  #t)))))))
     (native-inputs
      `(("python" ,python-2)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]