gnu: node: Correctly patch npm shebang.
Commit Message
Efraim Flashner <efraim@flashner.co.il> writes:
> On Wed, Jun 15, 2016 at 12:39:29PM +0200, Jelle Licht wrote:
>>
>> Jelle Licht <jlicht@fsfe.org> writes:
>>
>> > * gnu/packages/node.scm (node): Correctly patch npm shebang.
>> > ---
>> > gnu/packages/node.scm | 6 ++++++
>> > 1 file changed, 6 insertions(+)
>> >
>> > diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
>> > index 2f269d0..2cedda8 100644
>> > --- a/gnu/packages/node.scm
>> > +++ b/gnu/packages/node.scm
>> > @@ -51,8 +51,14 @@
>>
>> This patch should be applied to core-updates, as it depends on the
>> correct handling of symlinks in the `patch-shebangs' phase introduced by
>> Ludo's recent patch [1].
>>
>> Thanks,
>> - Jelle
>>
>> [1]https://lists.gnu.org/archive/html/bug-guix/2016-06/msg00043.html
>>
>
> I think you forgot to attach the patch :)
It was in the first message body, but for good measure:
From d01a35d3ef5b2619807b666e4f4126143a0bf08a Mon Sep 17 00:00:00 2001
From: Jelle Licht <jlicht@fsfe.org>
Date: Wed, 15 Jun 2016 12:22:40 +0200
Subject: [PATCH] gnu: node: Correctly patch npm shebang.
To: guix-devel@gnu.org
* gnu/packages/node.scm (node): Correctly patch npm shebang.
---
gnu/packages/node.scm | 6 ++++++
1 file changed, 6 insertions(+)
@@ -51,8 +51,14 @@
"--shared-zlib"
"--shared-libuv"
"--without-snapshot")
+ ;#:tests? #f
#:phases
(modify-phases %standard-phases
+ (add-after 'patch-shebangs 'patch-npm-shebang
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; XXX: patch-shebangs does not patch this file by default
+ (let ((out (assoc-ref outputs "out")))
+ (patch-shebang (string-append out "/lib/node_modules/npm/bin/npm-cli.js") (list (string-append out "/bin"))))))
(add-before 'configure 'patch-files
(lambda* (#:key inputs #:allow-other-keys)
;; Fix hardcoded /bin/sh references.
--
2.8.4