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