From 9bab6bea86e83c1aae355a7654263a87f0a4c130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 3 Apr 2015 22:27:45 +0200 Subject: [PATCH] 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@. --- gnu/packages/base.scm | 2 ++ gnu/packages/ld-wrapper.scm | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 9eb90dca5b..c935784663 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -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")) diff --git a/gnu/packages/ld-wrapper.scm b/gnu/packages/ld-wrapper.scm index 4fa2962bb9..cc533f5464 100644 --- a/gnu/packages/ld-wrapper.scm +++ b/gnu/packages/ld-wrapper.scm @@ -8,7 +8,7 @@ # .go file (see ). 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