guix-commits
[Top][All Lists]
Advanced

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

138/176: gnu: Add %make-static, %make-static-stripped, %make-bootstrap-t


From: Jan Nieuwenhuizen
Subject: 138/176: gnu: Add %make-static, %make-static-stripped, %make-bootstrap-tarball.
Date: Fri, 31 Aug 2018 11:20:29 -0400 (EDT)

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

commit 0a8298ed7c89a78981488483c20fd44f4cbf0285
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Thu Aug 23 21:33:11 2018 +0200

    gnu: Add %make-static, %make-static-stripped, %make-bootstrap-tarball.
    
    * gnu/packages/make-bootstrap.scm (%make-static, %make-static-stripped,
    %make-bootstrap-tarball): New variable.
---
 gnu/packages/make-bootstrap.scm | 56 +++++++++++++++++++++++++++++++++++++++++
 gnu/packages/mes.scm            |  2 +-
 2 files changed, 57 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index 475749b..efef713 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017 Efraim Flashner <address@hidden>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <address@hidden>
 ;;; Copyright © 2018 Mark H Weaver <address@hidden>
+;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -40,6 +41,7 @@
   #:use-module (ice-9 match)
   #:use-module (srfi srfi-1)
   #:export (%bootstrap-binaries-tarball
+            %make-bootstrap-tarball
             %binutils-bootstrap-tarball
             %glibc-bootstrap-tarball
             %gcc-bootstrap-tarball
@@ -299,6 +301,56 @@ for `sh' in $PATH, and without nscd, and with static NSS 
modules."
     (license gpl3+)
     (home-page #f)))
 
+(define %make-static
+  ;; Statically-linked Make.
+  (package
+    (inherit gnu-make)
+    (name "make-static")
+    (arguments
+     `(#:strip-flags '("--strip-all")
+       #:configure-flags (cons "--without-guile"
+                               ,(match (memq #:configure-flags
+                                             (package-arguments binutils))
+                                  ((#:configure-flags flags _ ...)
+                                   flags)))
+       #:phases (modify-phases %standard-phases
+                  (add-before 'configure  'all-static
+                    (lambda _
+                      ;; The `-all-static' libtool flag can only be passed
+                      ;; after `configure', since configure tests don't use
+                      ;; libtool, and only for executables built with libtool.
+                      (substitute* '("Makefile.in")
+                        (("^LDFLAGS =(.*)$" line)
+                         (string-append line
+                                        "\nAM_LDFLAGS = -static\n"))))))))))
+
+(define %make-static-stripped
+  ;; The subset of Make that we need.
+  (package (inherit %make-static)
+    (name (string-append (package-name %make-static) "-stripped"))
+    (build-system trivial-build-system)
+    (outputs '("out"))
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (begin
+         (use-modules (guix build utils))
+
+         (setvbuf (current-output-port) _IOLBF)
+         (let* ((in  (assoc-ref %build-inputs "make"))
+                (out (assoc-ref %outputs "out"))
+                (bin (string-append out "/bin")))
+           (mkdir-p bin)
+           (for-each (lambda (file)
+                       (let ((target (string-append bin "/" file)))
+                         (format #t "copying `~a'...~%" file)
+                         (copy-file (string-append in "/bin/" file)
+                                    target)
+                         (remove-store-references target)))
+                     '("make"))
+           #t))))
+    (inputs `(("make" ,%make-static)))))
+
 (define %binutils-static
   ;; Statically-linked Binutils.
   (package (inherit binutils)
@@ -650,6 +702,10 @@ for `sh' in $PATH, and without nscd, and with static NSS 
modules."
   ;; A tarball with the statically-linked bootstrap binaries.
   (tarball-package %static-binaries))
 
+(define %make-bootstrap-tarball
+  ;; A tarball with the statically-linked Make programs.
+  (tarball-package %make-static-stripped))
+
 (define %binutils-bootstrap-tarball
   ;; A tarball with the statically-linked Binutils programs.
   (tarball-package %binutils-static-stripped))
diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index 94f57e0..ddddd4b 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -44,7 +44,7 @@
   #:use-module (guix utils)
   #:use-module (guix gexp))
 
-(define %fake-bootstrap? #f)  ; cheat using Guile instead of Mes for speed-up?
+(define %fake-bootstrap? #t)  ; cheat using Guile instead of Mes for speed-up?
 
 (define-public stage0-boot
   (let ((version "0.0.8")



reply via email to

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