summary refs log tree commit diff
path: root/distro
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2012-10-17 21:44:25 +0200
committerLudovic Courtès <ludo@gnu.org>2012-10-17 23:25:25 +0200
commitac5aa28889ac3a535f8cfdd71047c9aa10b1959d (patch)
tree24498549369142b80528fa21b2d12629eb8432e6 /distro
parent9735a7b6eaccf248d91e1f3c17446b2fac41ec9a (diff)
downloadguix-ac5aa28889ac3a535f8cfdd71047c9aa10b1959d.tar.gz
distro: Use our own pre-built Guile to bootstrap.
* distro/packages/base.scm (%bootstrap-guile): Build from a tarball
  containing a pre-built Guile.

* distro.scm (%bootstrap-binaries-directory): New variable.
  (search-bootstrap-binary): New procedure.

* Makefile.am (bootstrapdir, bootstrap_x86_64_linuxdir,
  dist_bootstrap_x86_64_linux_DATA, DISTCLEANFILES, DOWNLOAD_FILE): New
  variables.
  (distro/packages/bootstrap/x86_64-linux/guile-bootstrap-2.0.6.tar.xz):
  New rule.
  (EXTRA_DIST): Add `build-aux/download.scm'.
  (.scm.go): Define the `DISTRO_BOOTSTRAP_DIRECTORY' and
  `DISTRO_INSTALLED_BOOTSTRAP_DIRECTORY' environment variables.

* pre-inst-env.in: Define `DISTRO_BOOTSTRAP_DIRECTORY'.

* build-aux/download.scm: New file.
* distro/packages/bootstrap/x86_64-linux/{bash, mkdir, tar, xz}: New
  files.
Diffstat (limited to 'distro')
-rw-r--r--distro/packages/base.scm47
-rwxr-xr-xdistro/packages/bootstrap/x86_64-linux/bashbin0 -> 1419928 bytes
-rwxr-xr-xdistro/packages/bootstrap/x86_64-linux/mkdirbin0 -> 799312 bytes
-rwxr-xr-xdistro/packages/bootstrap/x86_64-linux/tarbin0 -> 1229888 bytes
-rwxr-xr-xdistro/packages/bootstrap/x86_64-linux/xzbin0 -> 926000 bytes
5 files changed, 46 insertions, 1 deletions
diff --git a/distro/packages/base.scm b/distro/packages/base.scm
index 8ffdbf635d..35db11e7de 100644
--- a/distro/packages/base.scm
+++ b/distro/packages/base.scm
@@ -21,8 +21,11 @@
   #:use-module (guix packages)
   #:use-module (guix ftp)
   #:use-module (guix http)
+  #:use-module (guix build-system)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system trivial)
+  #:use-module ((guix store) #:select (add-to-store add-text-to-store))
+  #:use-module ((guix derivations) #:select (derivation))
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
@@ -1386,7 +1389,49 @@ with the Linux kernel.")
 
 (define %bootstrap-guile
   ;; The Guile used to run the build scripts of the initial derivations.
-  (nixpkgs-derivation* "guile"))
+  ;; It is just unpacked from a tarball containing a pre-built binary.
+  ;; This is typically built using %GUILE-BOOTSTRAP-TARBALL below.
+  ;;
+  ;; XXX: Would need libc's `libnss_files2.so' for proper `getaddrinfo'
+  ;; support (for /etc/services).
+  (let ((raw (build-system
+              (name "raw")
+              (description "Raw build system with direct store access")
+              (build (lambda* (store name source inputs #:key outputs system)
+                       (define (->store file)
+                         (add-to-store store file #t #t "sha256"
+                                       (search-bootstrap-binary file system)))
+
+                       (let* ((tar   (->store "tar"))
+                              (xz    (->store "xz"))
+                              (mkdir (->store "mkdir"))
+                              (bash  (->store "bash"))
+                              (guile (->store "guile-bootstrap-2.0.6.tar.xz"))
+                              (builder
+                               (add-text-to-store store
+                                                  "build-bootstrap-guile.sh"
+                                                  (format #f "
+echo \"unpacking bootstrap Guile to '$out'...\"
+~a $out
+cd $out
+~a -dc < ~a | ~a xv
+
+# Sanity check.
+$out/bin/guile --version~%"
+                                                          mkdir xz guile tar)
+                                                  (list mkdir xz guile tar))))
+                         (derivation store name system
+                                     bash `(,builder) '()
+                                     `((,bash) (,builder)))))))))
+   (package
+     (name "guile-bootstrap")
+     (version "2.0")
+     (source #f)
+     (build-system raw)
+     (description "Bootstrap Guile")
+     (long-description "Pre-built Guile for bootstrapping purposes.")
+     (home-page #f)
+     (license "LGPLv3+"))))
 
 (define (default-keyword-arguments args defaults)
   "Return ARGS augmented with any keyword/value from DEFAULTS for
diff --git a/distro/packages/bootstrap/x86_64-linux/bash b/distro/packages/bootstrap/x86_64-linux/bash
new file mode 100755
index 0000000000..81114f79c3
--- /dev/null
+++ b/distro/packages/bootstrap/x86_64-linux/bash
Binary files differdiff --git a/distro/packages/bootstrap/x86_64-linux/mkdir b/distro/packages/bootstrap/x86_64-linux/mkdir
new file mode 100755
index 0000000000..226865dfe6
--- /dev/null
+++ b/distro/packages/bootstrap/x86_64-linux/mkdir
Binary files differdiff --git a/distro/packages/bootstrap/x86_64-linux/tar b/distro/packages/bootstrap/x86_64-linux/tar
new file mode 100755
index 0000000000..c9a2c27d13
--- /dev/null
+++ b/distro/packages/bootstrap/x86_64-linux/tar
Binary files differdiff --git a/distro/packages/bootstrap/x86_64-linux/xz b/distro/packages/bootstrap/x86_64-linux/xz
new file mode 100755
index 0000000000..02f9014740
--- /dev/null
+++ b/distro/packages/bootstrap/x86_64-linux/xz
Binary files differ