[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/11: gnu: bootstrap: Create a wrapper for guile to set the system load
From: |
Mark H. Weaver |
Subject: |
01/11: gnu: bootstrap: Create a wrapper for guile to set the system load path. |
Date: |
Sat, 11 Jul 2015 03:48:03 +0000 |
mhw pushed a commit to branch core-updates
in repository guix.
commit 5d6792f06f1b8646fe9c6d8ca5763323912a7fba
Author: Mark H Weaver <address@hidden>
Date: Wed Jul 8 12:31:32 2015 -0400
gnu: bootstrap: Create a wrapper for guile to set the system load path.
* gnu/packages/bootstrap.scm (raw-build): After unpacking, use the bootstrap
guile to create its own wrapper that sets the guile system load path.
---
gnu/packages/bootstrap.scm | 38 ++++++++++++++++++++++++++++++++++++--
1 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/bootstrap.scm b/gnu/packages/bootstrap.scm
index 1f0fe16..f3c1c5a 100644
--- a/gnu/packages/bootstrap.scm
+++ b/gnu/packages/bootstrap.scm
@@ -197,6 +197,33 @@ successful, or false to signal an error."
"guile-2.0.11.tar.xz")
(_
"guile-2.0.9.tar.xz"))))
+ ;; The following code, run by the bootstrap guile after it is
+ ;; unpacked, creates a wrapper for itself to set its load path.
+ ;; This replaces the previous non-portable method based on
+ ;; reading the /proc/self/exe symlink.
+ (make-guile-wrapper
+ '(begin
+ (use-modules (ice-9 match))
+ (match (command-line)
+ ((_ out bash)
+ (let ((bin-dir (string-append out "/bin"))
+ (guile (string-append out "/bin/guile"))
+ (guile-real (string-append out "/bin/.guile-real"))
+ ;; We must avoid using a bare dollar sign in this code,
+ ;; because it would be interpreted by the shell.
+ (dollar (string (integer->char 36))))
+ (chmod bin-dir #o755)
+ (rename-file guile guile-real)
+ (call-with-output-file guile
+ (lambda (p)
+ (format p "\
+#!~a
+export GUILE_SYSTEM_PATH=~a/share/guile/2.0
+export GUILE_SYSTEM_COMPILED_PATH=~a/lib/guile/2.0/ccache
+exec -a \"~a0\" ~a \"address@hidden"\n"
+ bash out out dollar guile-real dollar)))
+ (chmod guile #o555)
+ (chmod bin-dir #o555))))))
(builder
(add-text-to-store store
"build-bootstrap-guile.sh"
@@ -206,10 +233,17 @@ echo \"unpacking bootstrap Guile to '$out'...\"
cd $out
~a -dc < ~a | ~a xv
+# Use the bootstrap guile to create its own wrapper to set the load path.
+GUILE_SYSTEM_PATH=$out/share/guile/2.0 \
+GUILE_SYSTEM_COMPILED_PATH=$out/lib/guile/2.0/ccache \
+$out/bin/guile -c ~s $out ~a
+
# Sanity check.
$out/bin/guile --version~%"
- mkdir xz guile tar)
- (list mkdir xz guile tar))))
+ mkdir xz guile tar
+ (format #f "~s" make-guile-wrapper)
+ bash)
+ (list mkdir xz guile tar bash))))
(derivation store name
bash `(,builder)
#:system system
- branch core-updates created (now 8ba24e6), Mark H. Weaver, 2015/07/10
- 01/11: gnu: bootstrap: Create a wrapper for guile to set the system load path.,
Mark H. Weaver <=
- 04/11: gnu: gettext: Update to 0.19.5., Mark H. Weaver, 2015/07/10
- 02/11: gnu: gcc-4.9: Update to 4.9.3., Mark H. Weaver, 2015/07/10
- 05/11: gnu: ed: Update to 1.12., Mark H. Weaver, 2015/07/10
- 03/11: gnu: coreutils: Update to 8.24., Mark H. Weaver, 2015/07/10
- 07/11: gnu: libunistring: Update to 0.9.6., Mark H. Weaver, 2015/07/10
- 06/11: gnu: mpfr: Update to 3.1.3., Mark H. Weaver, 2015/07/10
- 11/11: gnu: nss: Update to 3.19.2., Mark H. Weaver, 2015/07/10
- 08/11: gnu: texinfo: Use version 6.0 by default., Mark H. Weaver, 2015/07/10
- 09/11: gnu: libidn: Update to 1.31., Mark H. Weaver, 2015/07/10
- 10/11: gnu: libgpg-error: Update to 1.19., Mark H. Weaver, 2015/07/10