gnu: node: Fix npx shebang.

* gnu/packages/node.scm (node)[arguments]: Add build phase
"patch-node-shebang".
This commit is contained in:
Ricardo Wurmus 2020-12-29 14:24:50 +01:00
parent ac80cbfab6
commit 1d77141f6d
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

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