guix-commits
[Top][All Lists]
Advanced

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

10/16: bootstrap: Add make-mesboot1. WIP


From: guix-commits
Subject: 10/16: bootstrap: Add make-mesboot1. WIP
Date: Fri, 30 Nov 2018 13:21:48 -0500 (EST)

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

commit 158cc57d43bc2f6ed461b5e60ee53bf0c6e1c40a
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Sun Oct 21 17:09:20 2018 +0200

    bootstrap: Add make-mesboot1.  WIP
    
    * gnu/packages/commencement.scm (make-mesboot1): Build without bash,
    coreutils.
---
 gnu/packages/commencement.scm | 175 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 171 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index aaade21..d773bf1 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -129,7 +129,7 @@
                "0dlcqmchhl57nh7f0v6qb1kkbi7zbs3b185hcqv57fhb60b7rgcq")))
            (package-source nyacc))))))
 
-(define mes-boot
+(define-public mes-boot
   (package-with-bootstrap-guile
    (package
      (inherit mes)
@@ -146,7 +146,8 @@
         ("bootstrap-mes" ,%bootstrap-mes)
         ,@(if %fake-bootstrap?  ; cheat: fast non-bootstrap testing with Guile
               `(("guile" ,%bootstrap-guile)
-                ("srfi-43" ,%srfi-43)) ; guile-2.0.9 lacks srfi-43; cherry-pick
+                ;;("srfi-43" ,%srfi-43)
+                ) ; guile-2.0.9 lacks srfi-43; cherry-pick
               '())))
      (arguments
       `(#:implicit-inputs? #f
@@ -188,11 +189,11 @@
                     (setenv "MES" "guile")
                     (setenv "GUILE_AUTO_COMPILE" "1")
                     (setenv "GUILE_LOAD_COMPILED_PATH"
-                            (string-append guile "/lib/guile/2.0/ccache"))
+                            (string-append guile "/lib/guile/2.2/ccache"))
                     (setenv "GUILE_LOAD_PATH"
                             (string-append (string-append dir 
"/nyacc-source/module")
                                            ":" dir
-                                           ":" guile "/share/guile/2.0/"))
+                                           ":" guile "/share/guile/2.2/"))
                     ;; these fail with guile-2.0
                     (when srfi-43
                       (delete-file "tests/srfi-9.test")
@@ -524,6 +525,172 @@
                      (bin (string-append out "/bin")))
                 (install-file "make" bin))))))))))
 
+(define-public make-mesboot1
+  (package-with-bootstrap-guile
+   (package
+     (inherit gnu-make)
+     (name "make-mesboot1")
+     (version "3.80")
+     (source (origin
+               (method url-fetch)
+               (uri (string-append "http://lilypond.org/janneke/mes/make-";
+                                   version ".tar.Z"))
+               (sha256
+                (base32
+                 "1qsdf1hmp9k0hcdscqi021x6mgf9cd9k02ljvj8jj4mrwiqxszbh"))))
+     (supported-systems '("i686-linux" "x86_64-linux"))
+     (inputs '())
+     (propagated-inputs '())
+     (native-inputs `(("tcc" ,tcc-boot)
+
+                      ("guile" ,%bootstrap-guile)
+                      ("gash" ,%bootstrap-gash)))
+     (arguments
+      `(#:implicit-inputs? #f
+        #:guile ,%bootstrap-guile
+        #:configure-flags `("CC=tcc -DO_RDONLY=0"
+                            "LD=tcc"
+                            "--disable-nls")
+        #:modules ((guix build gnu-build-system)
+                   (guix build utils)
+                   (srfi srfi-1)
+                   (srfi srfi-26))
+        #:strip-binaries? #f            ; no strip yet
+        #:phases
+        (modify-phases %standard-phases
+          (replace 'configure
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (includedir (string-append out "/include"))
+                     (libdir (string-append out "/lib"))
+                     (localedir (string-append out "/share/locale"))
+                     (host "i686-unknown-linux-gnu")
+                     (version ,(package-version make-mesboot1)))
+                (with-output-to-file "config.h"
+                  (lambda _ (display (string-append "
+#define ALIASPATH \""localedir"\":.
+#define INCLUDEDIR \""includedir"\"
+#define LIBDIR \""libdir"\"
+#define LOCALEDIR \""localedir"\"
+
+#define C_GETLOADAVG 1
+#define FILE_TIMESTAMP_HI_RES 0
+#define HAVE_ALLOCA 1
+#define HAVE_ALLOCA_H 1
+#define HAVE_DIRENT_H 1
+#define HAVE_DUP2 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FDOPEN 1
+#define HAVE_FORK 1
+#define HAVE_GETCWD 1
+#define HAVE_GETTIMEOFDAY 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_LOCALE_H 1
+#define HAVE_MEMCPY 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMORY_H 1
+#define HAVE_MKTEMP 1
+#define HAVE_PIPE 1
+#define HAVE_SA_RESTART 1
+#define HAVE_SETLOCALE 1
+#define HAVE_SETVBUF 1
+#define HAVE_SIGACTION 1
+#define HAVE_SIGSETMASK 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRCHR 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIMEB_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_WAIT_H 1
+#define HAVE_UNISTD_H 1
+#define HAVE_VPRINTF 1
+#define HAVE_WAITPID 1
+#define HAVE_WORKING_FORK 1
+#define MAKE_HOST \"" host "\"
+#define MAKE_JOBSERVER 1
+#define PACKAGE \"make\"
+#define PACKAGE_BUGREPORT \"address@hidden"
+#define PACKAGE_NAME \"GNU make\"
+#define PACKAGE_STRING \"GNU make "version"\"
+#define PACKAGE_TARNAME \"make\"
+#define PACKAGE_VERSION \""version"\"
+#define PROTOTYPES 1
+#define RETSIGTYPE void
+#define SCCS_GET \"get\"
+#define STDC_HEADERS 1
+#define TIME_WITH_SYS_TIME 1
+#define VERSION \"" version" \"
+#define __PROTOTYPES 1
+#define vfork fork
+")))))
+              #t))
+          (delete 'patch-generated-file-shebangs) ; no perl
+          (add-after 'configure 'configure-fixup
+            (lambda _
+              (substitute* "make.h"
+                (("^extern long int lseek.*" all) (string-append "// " all)))
+              #t))
+          (replace 'build
+            (lambda _
+              (let ((files '(
+                             "ar"
+                             "arscan"
+                             "commands"
+                             "default"
+                             "dir"
+                             "expand"
+                             "file"
+                             "function"
+                             "getopt"
+                             "getopt1"
+                             "implicit"
+                             "job"
+                             "main"
+                             "misc"
+                             "read"
+                             "remake"
+                             "rule"
+                             "signame"
+                             "variable"
+                             "version"
+                             "vpath"
+                             "hash"
+                             "remote-stub"
+                             "getloadavg"
+                             "glob/fnmatch"
+                             "glob/glob"
+                             )))
+                (and (fold-right
+                      (lambda (file status)
+                        (and status (invoke "tcc"
+                                            "-D" "HAVE_CONFIG_H"
+                                            "-I" "."
+                                            "-I" "glob"
+                                            "-c" (string-append file ".c")
+                                            "-o" (string-append file ".o"))))
+                      #t
+                      files)
+                     (apply invoke `("tcc" "-o" "make"
+                                     ,@(map (cut string-append <> ".o")
+                                            files)))))))
+          (replace 'check
+            (lambda _
+              (invoke "./make" "--version")))
+          (replace 'install
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (bin (string-append out "/bin")))
+                (install-file "make" bin)
+                #t)))))))))
+
 (define diffutils-mesboot
   (package-with-bootstrap-guile
    (package



reply via email to

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