[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: gnu: node: Make sure 'npm' remains a symlink after 'patch-shebang
From: |
Ludovic Courtès |
Subject: |
02/02: gnu: node: Make sure 'npm' remains a symlink after 'patch-shebangs'. |
Date: |
Wed, 29 Jun 2016 08:06:41 +0000 (UTC) |
civodul pushed a commit to branch master
in repository guix.
commit 2de091f0c8ee143b1dd07483b3b86a31870342c0
Author: Ludovic Courtès <address@hidden>
Date: Wed Jun 29 10:02:58 2016 +0200
gnu: node: Make sure 'npm' remains a symlink after 'patch-shebangs'.
Fixes <http://bugs.gnu.org/23744>.
Reported by Jovany Leandro G.C <address@hidden>
and Jelle Licht <address@hidden>.
* gnu/packages/node.scm (node)[arguments]: Replace 'patch-shebangs'
phase.
---
gnu/packages/node.scm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/node.scm b/gnu/packages/node.scm
index 2f269d0..887ef93 100644
--- a/gnu/packages/node.scm
+++ b/gnu/packages/node.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2014 Cyrill Schenkel <address@hidden>
;;; Copyright © 2015 Andreas Enge <address@hidden>
;;; Copyright © 2015, 2016 David Thompson <address@hidden>
+;;; Copyright © 2016 Ludovic Courtès <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -99,7 +100,23 @@
(zero? (apply system*
(string-append (assoc-ref inputs "python")
"/bin/python")
- "configure" flags))))))))
+ "configure" flags)))))
+ (replace 'patch-shebangs
+ (lambda* (#:key outputs #:allow-other-keys #:rest all)
+ ;; Work around <http://bugs.gnu.org/23723>.
+ (let* ((patch (assoc-ref %standard-phases 'patch-shebangs))
+ (npm (string-append (assoc-ref outputs "out")
+ "/bin/npm"))
+ (target (readlink npm)))
+ (and (apply patch all)
+ (with-directory-excursion (dirname npm)
+ ;; Turn NPM into a symlink to TARGET again, which 'npm'
+ ;; relies on for the resolution of relative file names
+ ;; in JS files.
+ (delete-file target)
+ (rename-file npm target)
+ (symlink target npm)
+ #t))))))))
(native-inputs
`(("python" ,python-2)
("perl" ,perl)