~ruther/guix-local

9bab6bea86e83c1aae355a7654263a87f0a4c130 — Ludovic Courtès 11 years ago 8fdd410
gnu: ld-wrapper: Use a hard-coded self-reference instead of $0.

* 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@.
2 files changed, 3 insertions(+), 1 deletions(-)

M gnu/packages/base.scm
M gnu/packages/ld-wrapper.scm
M gnu/packages/base.scm => gnu/packages/base.scm +2 -0
@@ 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"))

M gnu/packages/ld-wrapper.scm => gnu/packages/ld-wrapper.scm +1 -1
@@ 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>