gnu: ld-wrapper: Use a hard-coded self-reference instead of $0.
authorLudovic Courtès <ludo@gnu.org>
Fri, 3 Apr 2015 20:27:45 +0000 (22:27 +0200)
committerLudovic Courtès <ludo@gnu.org>
Fri, 3 Apr 2015 20:28:06 +0000 (22:28 +0200)
* gnu/packages/ld-wrapper.scm: Use @SELF@ instead of $0.  This is so
  that the .go file is found even when the wrapper is invoked via a
  symlink to it.
* gnu/packages/base.scm (make-ld-wrapper): Substitute @SELF@.

gnu/packages/base.scm
gnu/packages/ld-wrapper.scm

index 9eb90dc..c935784 100644 (file)
@@ -393,6 +393,8 @@ wrapper uses GUILE and BASH."
                      (mkdir-p bin)
                      (copy-file (assoc-ref %build-inputs "wrapper") ld)
                      (substitute* ld
+                       (("@SELF@")
+                        ld)
                        (("@GUILE@")
                         (string-append (assoc-ref %build-inputs "guile")
                                        "/bin/guile"))
index 4fa2962..cc533f5 100644 (file)
@@ -8,7 +8,7 @@
 # .go file (see <http://bugs.gnu.org/12519>).
 
 main="(@ (gnu build-support ld-wrapper) ld-wrapper)"
-exec @GUILE@ -c "(load-compiled \"$0.go\") (apply $main (cdr (command-line)))" "$@"
+exec @GUILE@ -c "(load-compiled \"@SELF@.go\") (apply $main (cdr (command-line)))" "$@"
 !#
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>