gnu: commencement: tcc-boot0: Use Gash instead of coretutils&co.
* gnu/packages/commencement.scm (tcc-boot0): Use Gash instead of coretutils&co.
This commit is contained in:
		
							parent
							
								
									c9c1cbf60d
								
							
						
					
					
						commit
						5dedce047c
					
				
					 1 changed files with 82 additions and 103 deletions
				
			
		| 
						 | 
					@ -589,103 +589,82 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
 | 
				
			||||||
  ;; bootstrappable effort; we will try again later.  These patches have been
 | 
					  ;; bootstrappable effort; we will try again later.  These patches have been
 | 
				
			||||||
  ;; ported to 0.9.27, alas the resulting tcc is buggy.  Once MesCC is more
 | 
					  ;; ported to 0.9.27, alas the resulting tcc is buggy.  Once MesCC is more
 | 
				
			||||||
  ;; mature, this package should use the 0.9.27 sources (or later).
 | 
					  ;; mature, this package should use the 0.9.27 sources (or later).
 | 
				
			||||||
  (let ((version "0.9.26")
 | 
					 | 
				
			||||||
        (revision "6")
 | 
					 | 
				
			||||||
        (commit "c004e9a34fb026bb44d211ab98bb768e79900eef"))
 | 
					 | 
				
			||||||
  (package
 | 
					  (package
 | 
				
			||||||
    (inherit tcc)
 | 
					    (inherit tcc)
 | 
				
			||||||
    (name "tcc-boot0")
 | 
					    (name "tcc-boot0")
 | 
				
			||||||
      (version (string-append version "-" revision "." (string-take commit 7)))
 | 
					    (version "0.9.26-1103-g6e62e0e")
 | 
				
			||||||
    (source (origin
 | 
					    (source (origin
 | 
				
			||||||
              (method url-fetch)
 | 
					              (method url-fetch)
 | 
				
			||||||
                (uri (list (string-append "mirror://gnu/guix/mirror"
 | 
					              (uri (string-append
 | 
				
			||||||
                                          "/tinycc-" commit ".tar.gz")
 | 
					                    "http://lilypond.org/janneke/mes/20191117/"
 | 
				
			||||||
                           (string-append "https://gitlab.com/janneke/tinycc"
 | 
					                    "/tcc-" version ".tar.gz"))
 | 
				
			||||||
                                          "/-/archive/" commit
 | 
					 | 
				
			||||||
                                          "/tinycc-" commit ".tar.gz")))
 | 
					 | 
				
			||||||
              (sha256
 | 
					              (sha256
 | 
				
			||||||
               (base32
 | 
					               (base32
 | 
				
			||||||
                  "1hmzn1pq0x22ppd80hyrn5qzqq94mxd0ychzj6vrr2vnj2frjv5b"))))
 | 
					                "1qbybw7mxbgkv3sazvz1v7c8byq998vk8f1h25ik8w3d2l63lxng"))))
 | 
				
			||||||
    (build-system gnu-build-system)
 | 
					    (build-system gnu-build-system)
 | 
				
			||||||
    (supported-systems '("i686-linux" "x86_64-linux"))
 | 
					    (supported-systems '("i686-linux" "x86_64-linux"))
 | 
				
			||||||
    (inputs '())
 | 
					    (inputs '())
 | 
				
			||||||
    (propagated-inputs '())
 | 
					    (propagated-inputs '())
 | 
				
			||||||
    (native-inputs
 | 
					    (native-inputs
 | 
				
			||||||
     `(("mes" ,mes-boot)
 | 
					     `(("mes" ,mes-boot)
 | 
				
			||||||
 | 
					       ("nyacc-source" ,(origin (inherit (package-source nyacc))
 | 
				
			||||||
 | 
					                                (snippet #f)))
 | 
				
			||||||
       ("mescc-tools" ,%bootstrap-mescc-tools)
 | 
					       ("mescc-tools" ,%bootstrap-mescc-tools)
 | 
				
			||||||
         ("nyacc-source" ,(bootstrap-origin
 | 
					       ,@(%boot-gash-inputs)))
 | 
				
			||||||
                           (package-source nyacc-0.86)))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
         ("coreutils" , %bootstrap-coreutils&co)
 | 
					 | 
				
			||||||
         ("bootstrap-mes" ,%bootstrap-mes)))
 | 
					 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     `(#:implicit-inputs? #f
 | 
					     `(#:implicit-inputs? #f
 | 
				
			||||||
       #:guile ,%bootstrap-guile
 | 
					       #:guile ,%bootstrap-guile
 | 
				
			||||||
         #:strip-binaries? #f  ; binutil's strip b0rkes MesCC/M1/hex2 binaries
 | 
					       #:validate-runpath? #f           ; no dynamic executables
 | 
				
			||||||
 | 
					       #:strip-binaries? #f             ; no strip yet
 | 
				
			||||||
       #:phases
 | 
					       #:phases
 | 
				
			||||||
       (modify-phases %standard-phases
 | 
					       (modify-phases %standard-phases
 | 
				
			||||||
         (add-after 'unpack 'unpack-seeds
 | 
					         (add-after 'unpack 'unpack-seeds
 | 
				
			||||||
           (lambda* (#:key outputs #:allow-other-keys)
 | 
					           (lambda* (#:key outputs #:allow-other-keys)
 | 
				
			||||||
               (let* ((coreutils (assoc-ref %build-inputs "coreutils"))
 | 
					             (let ((nyacc-source (assoc-ref %build-inputs "nyacc-source")))
 | 
				
			||||||
                      (nyacc-source (assoc-ref %build-inputs "nyacc-source"))
 | 
					 | 
				
			||||||
                      (bootstrap-mes (assoc-ref %build-inputs "bootstrap-mes")))
 | 
					 | 
				
			||||||
                 (setenv "PATH" (string-append
 | 
					 | 
				
			||||||
                                 coreutils "/bin"))
 | 
					 | 
				
			||||||
                 (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
 | 
					 | 
				
			||||||
               (with-directory-excursion ".."
 | 
					               (with-directory-excursion ".."
 | 
				
			||||||
                   (mkdir-p "nyacc-source")
 | 
					                 (invoke "tar" "-xvf" nyacc-source)))))
 | 
				
			||||||
                   (invoke "tar" "--strip=1" "-C" "nyacc-source"
 | 
					 | 
				
			||||||
                           "-xvf" nyacc-source)
 | 
					 | 
				
			||||||
                   (symlink (string-append bootstrap-mes "/share/mes/lib") "mes-seed"))
 | 
					 | 
				
			||||||
                 #t)))
 | 
					 | 
				
			||||||
         (replace 'configure
 | 
					         (replace 'configure
 | 
				
			||||||
           (lambda* (#:key outputs #:allow-other-keys)
 | 
					           (lambda* (#:key outputs #:allow-other-keys)
 | 
				
			||||||
             (let* ((out (assoc-ref %outputs "out"))
 | 
					             (let* ((out (assoc-ref %outputs "out"))
 | 
				
			||||||
                    (dir (with-directory-excursion ".." (getcwd)))
 | 
					                    (dir (with-directory-excursion ".." (getcwd)))
 | 
				
			||||||
                      (coreutils (assoc-ref %build-inputs "coreutils"))
 | 
					                    (interpreter "/lib/mes-loader"))
 | 
				
			||||||
                      (mes (assoc-ref %build-inputs "mes"))
 | 
					
 | 
				
			||||||
                      (mescc-tools (assoc-ref %build-inputs "mescc-tools"))
 | 
					               (setenv "prefix" out)
 | 
				
			||||||
                      (libc (assoc-ref %build-inputs "libc"))
 | 
					               (setenv "GUILE_LOAD_PATH"
 | 
				
			||||||
                      (interpreter (if libc
 | 
					                       (string-append dir "/nyacc-0.99.0/module"))
 | 
				
			||||||
                                       ;; also for x86_64-linux, we are still on i686-linux
 | 
					
 | 
				
			||||||
                                       (string-append libc ,(glibc-dynamic-linker "i686-linux"))
 | 
					               (substitute* "conftest.c"
 | 
				
			||||||
                                       (string-append mes "/lib/mes-loader"))))
 | 
					                 (("volatile") ""))
 | 
				
			||||||
                 (setenv "PATH" (string-append
 | 
					 | 
				
			||||||
                                 coreutils "/bin"
 | 
					 | 
				
			||||||
                                 ":" mes "/bin"
 | 
					 | 
				
			||||||
                                 ":" mescc-tools "/bin"))
 | 
					 | 
				
			||||||
                 (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                 (setenv "PREFIX" out)
 | 
					 | 
				
			||||||
                 (symlink (string-append mes "/share/mes") "mes")
 | 
					 | 
				
			||||||
                 (symlink (string-append "../nyacc-source/module") "nyacc")
 | 
					 | 
				
			||||||
                 (setenv "MES_PREFIX" "mes")
 | 
					 | 
				
			||||||
                 (setenv "MES_ARENA" "100000000")
 | 
					 | 
				
			||||||
                 (setenv "MES_MAX_ARENA" "100000000")
 | 
					 | 
				
			||||||
                 (setenv "MES_STACK" "10000000")
 | 
					 | 
				
			||||||
                 (setenv "MES" "mes")
 | 
					 | 
				
			||||||
                 (setenv "GUILE_LOAD_PATH" "nyacc")
 | 
					 | 
				
			||||||
               (invoke "sh" "configure"
 | 
					               (invoke "sh" "configure"
 | 
				
			||||||
                         "--prefix=$PREFIX"
 | 
					                       "--cc=mescc"
 | 
				
			||||||
 | 
					                       (string-append "--prefix=" out)
 | 
				
			||||||
                       (string-append "--elfinterp=" interpreter)
 | 
					                       (string-append "--elfinterp=" interpreter)
 | 
				
			||||||
                       "--crtprefix=."
 | 
					                       "--crtprefix=."
 | 
				
			||||||
                       "--tccdir=."))))
 | 
					                       "--tccdir=."))))
 | 
				
			||||||
         (replace 'build
 | 
					         (replace 'build
 | 
				
			||||||
           (lambda _
 | 
					           (lambda _
 | 
				
			||||||
               (substitute* "bootstrap.sh"
 | 
					             (substitute* "bootstrap.sh" ; Show some progress
 | 
				
			||||||
                 (("^    cmp") "#    cmp"))
 | 
					               (("^( *)((cp|ls|mkdir|rm|[.]/tcc|[.]/[$][{PROGRAM_PREFIX[}]tcc) [^\"]*[^\\])\n" all space cmd)
 | 
				
			||||||
 | 
					                (string-append space "echo \"" cmd "\"\n"
 | 
				
			||||||
 | 
					                               space cmd "\n")))
 | 
				
			||||||
             (invoke "sh" "bootstrap.sh")))
 | 
					             (invoke "sh" "bootstrap.sh")))
 | 
				
			||||||
         (replace 'check
 | 
					         (replace 'check
 | 
				
			||||||
           (lambda _
 | 
					           (lambda _
 | 
				
			||||||
               (setenv "DIFF" "diff.scm")
 | 
					 | 
				
			||||||
               (setenv "OBJDUMP" "true")
 | 
					 | 
				
			||||||
             ;; fail fast tests
 | 
					             ;; fail fast tests
 | 
				
			||||||
 | 
					             (system* "./tcc" "--help") ; --help exits 1
 | 
				
			||||||
             ;; (invoke "sh" "test.sh" "mes/scaffold/tests/30-strlen")
 | 
					             ;; (invoke "sh" "test.sh" "mes/scaffold/tests/30-strlen")
 | 
				
			||||||
             ;; (invoke "sh" "-x" "test.sh" "mes/scaffold/tinycc/00_assignment")
 | 
					             ;; (invoke "sh" "-x" "test.sh" "mes/scaffold/tinycc/00_assignment")
 | 
				
			||||||
               (setenv "TCC" "./tcc")
 | 
					             ;; TODO: add sensible check target (without depending on make)
 | 
				
			||||||
               (invoke "sh" "check.sh")))
 | 
					             ;; (invoke "sh" "check.sh")
 | 
				
			||||||
 | 
					             #t))
 | 
				
			||||||
         (replace 'install
 | 
					         (replace 'install
 | 
				
			||||||
           (lambda _
 | 
					           (lambda _
 | 
				
			||||||
 | 
					             (substitute* "install.sh"  ; Show some progress
 | 
				
			||||||
 | 
					               (("^( *)((cp|ls|mkdir|rm|tar|./[$][{PROGRAM_PREFIX[}]tcc) [^\"]*[^\\])\n" all space cmd)
 | 
				
			||||||
 | 
					                (string-append space "echo \"" cmd "\"\n"
 | 
				
			||||||
 | 
					                               space cmd "\n")))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
             (invoke "sh" "install.sh"))))))
 | 
					             (invoke "sh" "install.sh"))))))
 | 
				
			||||||
    (native-search-paths
 | 
					    (native-search-paths
 | 
				
			||||||
     (list (search-path-specification
 | 
					     (list (search-path-specification
 | 
				
			||||||
| 
						 | 
					@ -693,7 +672,7 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
 | 
				
			||||||
            (files '("include")))
 | 
					            (files '("include")))
 | 
				
			||||||
           (search-path-specification
 | 
					           (search-path-specification
 | 
				
			||||||
            (variable "LIBRARY_PATH")
 | 
					            (variable "LIBRARY_PATH")
 | 
				
			||||||
              (files '("lib"))))))))
 | 
					            (files '("lib")))))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(define tcc-boot
 | 
					(define tcc-boot
 | 
				
			||||||
  (package
 | 
					  (package
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue