guix-commits
[Top][All Lists]
Advanced

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

13/15: bootstrap: make-mesboot0: Scheme-only bootstrap. WIP


From: guix-commits
Subject: 13/15: bootstrap: make-mesboot0: Scheme-only bootstrap. WIP
Date: Wed, 5 Dec 2018 16:57:54 -0500 (EST)

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

commit 11b9cad41dfd8ecf4535f997d29175f2f17d0434
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Tue Dec 4 23:20:18 2018 +0100

    bootstrap: make-mesboot0: Scheme-only bootstrap.  WIP
---
 gnu/packages/commencement.scm | 143 ++++++++++++++++++++++++++++++++++++++----
 1 file changed, 131 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 3ea9c2e..939ccb3 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -550,44 +550,163 @@
      (version "3.80")
      (source (origin
                (method url-fetch)
-               (uri (string-append "mirror://gnu/make/make-"
-                                   version ".tar.gz"))
+               (uri (string-append "http://lilypond.org/janneke/mes/make-";
+                                   version ".tar.Z"))
                (sha256
                 (base32
-                 "1pb7fb7fqf9wz9najm85qdma1xhxzf1rhj5gwrlzdsz2zm0hpcv4"))))
+                 "1qsdf1hmp9k0hcdscqi021x6mgf9cd9k02ljvj8jj4mrwiqxszbh"))))
      (supported-systems '("i686-linux" "x86_64-linux"))
      (inputs '())
      (propagated-inputs '())
      (native-inputs `(("tcc" ,tcc-boot)
 
-                      ("bash" ,%bootstrap-coreutils&co)
-                      ("coreutils" ,%bootstrap-coreutils&co)))
+                      ("guile" ,%bootstrap-guile)
+                      ("gash" ,%bootstrap-gash)))
      (arguments
       `(#:implicit-inputs? #f
-        #:tests? #f                     ; check depends on perl
         #: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-mesboot0)))
+                (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* "build.sh"
-                (("^REMOTE=.*") "REMOTE=stub\n")
-                (("^extras=.*") "extras=getloadavg.c\n"))
               (substitute* "make.h"
                 (("^extern long int lseek.*" all) (string-append "// " all)))
               #t))
-          (delete 'patch-generated-file-shebangs) ; no perl
           (replace 'build
             (lambda _
-              (invoke "sh" "./build.sh")))
+              (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))))))))))
+                (install-file "make" bin)
+                #t)))))))))
 
 (define diffutils-mesboot
   (package-with-bootstrap-guile



reply via email to

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