guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

16/70: bootstrap: Add gash-boot.


From: guix-commits
Subject: 16/70: bootstrap: Add gash-boot.
Date: Wed, 11 Dec 2019 13:04:41 -0500 (EST)

janneke pushed a commit to branch wip-bootstrap
in repository guix.

commit 50a2651aace944366359b5345a9d7d23d7e25830
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Fri Dec 6 07:21:21 2019 +0100

    bootstrap: Add gash-boot.
    
    * gnu/packages/commencement.scm (gash-boot): New variable.
---
 gnu/packages/commencement.scm | 100 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 98 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 7f454c7..75f89b7 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2014, 2015, 2017 Mark H Weaver <address@hidden>
 ;;; Copyright © 2017, 2018, 2019 Efraim Flashner <address@hidden>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <address@hidden>
-;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <address@hidden>
+;;; Copyright © 2018, 2019 Jan (janneke) Nieuwenhuizen <address@hidden>
 ;;; Copyright © 2019 Marius Bakke <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -46,12 +46,14 @@
   #:use-module (gnu packages python)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages hurd)
+  #:use-module (gnu packages shells)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages xml)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system guile)
   #:use-module (guix build-system trivial)
   #:use-module (guix memoization)
   #:use-module (guix utils)
@@ -133,7 +135,101 @@
     (synopsis "Bootstrap Guile plus Guild")
     (description "Bootstrap Guile with added Guild")
     (home-page #f)
-    (license (package-license guile-2.0))))
+    (license (package-license guile-2.0))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "GUILE_LOAD_PATH")
+            (files '("share/guile/site/2.0")))
+           (search-path-specification
+            (variable "GUILE_LOAD_COMPILED_PATH")
+            (files '("lib/guile/2.0/site-ccache")))))))
+
+(define gash-boot
+  (package
+    (inherit gash)
+    (name "gash-boot")
+    (version "0.1.50-c1b8")
+    (source (bootstrap-origin
+             (origin
+               (method url-fetch)
+               (uri (string-append "http://lilypond.org/janneke/guix/20191206/";
+                                   "/gash-" version ".tar.gz"))
+               (modules '((guix build utils)
+                          (srfi srfi-26)))
+               (snippet
+                '(begin
+                   ;; Remove Guix'y files that we cannot compile.
+                   (delete-file "guix.scm")
+                   (delete-file-recursively "tests")
+                   #t))
+               (sha256
+                (base32
+                 "1d8i4r1i9zc4ymwb40y4jbmxdr15v712ahwlqnlpdfnsga68hmpk")))))
+    (build-system guile-build-system)
+    (native-inputs `(("bash" ,(bootstrap-executable "bash" (%current-system)))
+                     ("tar" ,(bootstrap-executable "tar" (%current-system)))
+                     ("xz" ,(bootstrap-executable "xz" (%current-system)))
+                     ("guile-source" ,(bootstrap-origin
+                                       (package-source guile-2.0)))))
+    (inputs `(("guile" ,%bootstrap-guile+guild)))
+    (arguments
+     `(#:implicit-inputs? #f
+       #:guile ,%bootstrap-guile+guild
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'unpack-guile-source
+           (lambda _
+             (let ((guile-source (assoc-ref %build-inputs "guile-source"))
+                   (bin (string-append (getcwd) "/zee-bin")))
+               (mkdir-p bin)
+               (with-directory-excursion bin
+                 (invoke "tar" "--strip-components=2"
+
+                         "-xvf" guile-source
+                         (string-append "guile-"
+                                        ,(package-version guile-2.0)
+                                        "/meta/guild.in"))
+                 (copy-file "guild.in" "guild")
+                 (chmod "guild" #o555))
+               #t)))
+         (add-before 'unpack 'set-path
+           (lambda _
+             (let ((bash (assoc-ref %build-inputs "bash"))
+                   (tar (assoc-ref %build-inputs "tar"))
+                   (xz (assoc-ref %build-inputs "xz"))
+                   (bin (string-append (getcwd) "/zee-bin")))
+               (mkdir-p bin)
+               (setenv "PATH" (string-append bin ":" (getenv "PATH")))
+               (copy-file bash (string-append bin "/bash"))
+               (copy-file bash (string-append bin "/sh"))
+               (copy-file tar (string-append bin "/tar"))
+               (copy-file xz (string-append bin "/xz"))
+               #t)))
+         (add-after 'build 'build-scripts
+           (lambda _
+             (let* ((guile (assoc-ref %build-inputs "guile"))
+                    (guile (string-append guile "/bin/guile"))
+                    (out (assoc-ref %outputs "out"))
+                    (effective "2.0")
+                    (moddir (string-append out "/share/guile/site/" effective 
"/"))
+                    (godir (string-append out "/lib/guile/" effective 
"/site-ccache/")))
+               (copy-file "scripts/gash.in" "scripts/gash")
+               (chmod "scripts/gash" #o555)
+               (substitute* "scripts/gash"
+                 (("@GUILE@") guile)
+                 (("@MODDIR@") moddir)
+                 (("@GODIR") godir))
+               #t)))
+         (add-after 'install 'install-scripts
+           (lambda _
+             (let* ((out (assoc-ref %outputs "out"))
+                    (bin (string-append out "/bin")))
+               (install-file "scripts/gash" bin)
+               (copy-file "scripts/gash" "scripts/sh")
+               (install-file "scripts/sh" bin)
+               (copy-file "scripts/gash" "scripts/bash")
+               (install-file "scripts/bash" bin)
+               #t))))))))
 
 (define mes-boot
   (package



reply via email to

[Prev in Thread] Current Thread [Next in Thread]