[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
137/207: gnu: tcc-boot: Use gnu-build-system.
From: |
Jan Nieuwenhuizen |
Subject: |
137/207: gnu: tcc-boot: Use gnu-build-system. |
Date: |
Sat, 8 Sep 2018 13:26:19 -0400 (EDT) |
janneke pushed a commit to branch wip-bootstrap
in repository guix.
commit 8c502888065865f5ef20134518271cd51a20f661
Author: Jan Nieuwenhuizen <address@hidden>
Date: Thu Aug 23 21:05:26 2018 +0200
gnu: tcc-boot: Use gnu-build-system.
* gnu/packages/mes.scm (tcc-boot): Use gnu-build-system.
---
gnu/packages/mes.scm | 143 ++++++++++++++++++++++++++++-----------------------
1 file changed, 78 insertions(+), 65 deletions(-)
diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index c357d47..94f57e0 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -492,77 +492,90 @@ standard.")
(sha256
(base32
"177bdhwzrnqgyrdv1dwvpd04fcxj68s5pm1dzwny6359ziway8yy"))))
- (build-system trivial-build-system)
+ (build-system gnu-build-system)
(supported-systems '("i686-linux" "x86_64-linux"))
-
(native-inputs
`(("coreutils" , %bootstrap-coreutils&co)
("mes" ,mes-boot)
("tcc" ,tcc-boot0)))
(arguments
- `(#:modules ((guix build utils))
- #:builder
- (begin
- (use-modules (guix build utils))
- (let* ((coreutils (assoc-ref %build-inputs "coreutils"))
- (source (assoc-ref %build-inputs "source"))
- (mes (assoc-ref %build-inputs "mes"))
- (tcc (assoc-ref %build-inputs "tcc"))
- (out (assoc-ref %outputs "out"))
- (libc (assoc-ref %build-inputs "libc"))
- (interpreter (if libc
- (string-append libc ,(glibc-dynamic-linker))
- (string-append mes "/lib/mes-loader"))))
- ;; unpack
- (setenv "PATH" (string-append
- coreutils "/bin"
- ":" tcc "/bin"))
- (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
- (mkdir-p "source")
- (system* "tar" "--strip=1" "-C" "source" "-xvf" source)
- (chdir "source")
-
- ;; configure
- (and
- (zero? (system* "sh" "configure"
- (string-append "--cc=tcc")
- (string-append "--cpu=i386")
- (string-append "--prefix=" out)
- (string-append "--elfinterp=" interpreter)
- (string-append "--crtprefix=" tcc "/lib")
- (string-append "--sysincludepaths=" tcc
"/include")
- (string-append "--libpaths=" tcc "/lib")))
- ;; make
- (zero? (system* "tcc"
- "-vvv"
- "-D" "BOOTSTRAP=1"
- "-D" "ONE_SOURCE=1"
- "-D" "TCC_TARGET_I386=1"
- "-D" "CONFIG_TCC_STATIC=1"
- "-D" "CONFIG_USE_LIBGCC=1"
- "-D" (string-append "CONFIG_TCCDIR=\"" out
"/lib/tcc\"")
- "-D" (string-append "CONFIG_TCC_CRTPREFIX=\"" out
"/lib:{B}/lib:.\"")
- "-D" (string-append "CONFIG_TCC_CRTPREFIX=\"" out
"/lib:{B}/lib:.\"")
- "-D" (string-append "CONFIG_TCC_ELFINTERP=\""
interpreter "\"")
- "-D" (string-append "CONFIG_TCC_LIBPATHS=\"" tcc
"/lib:{B}/lib:.\"")
- "-D" (string-append
"CONFIG_TCC_SYSINCLUDEPATHS=\"" tcc "/include" ":/include:{B}/include\"")
- "-D" (string-append "TCC_LIBGCC=\"" tcc
"/lib/libc.a\"")
- "-I" (string-append tcc "/out")
- "-L" (string-append tcc "/lib")
- "-o" "tcc"
- "tcc.c"))
- (mkdir-p (string-append out "/bin"))
- (copy-file "tcc" (string-append out "/bin/tcc"))
- (mkdir-p (string-append out "/lib/tcc"))
- (copy-recursively (string-append tcc "/include")
- (string-append out "/include"))
- (copy-recursively (string-append tcc "/lib")
- (string-append out "/lib"))
- (zero? (system* "tcc" "-D" "TCC_TARGET_I386=1" "-c" "-o"
"libtcc1.o" "lib/libtcc1.c"))
- (zero? (system* "tcc" "-ar" "rc" "libtcc1.a" "libtcc1.o"))
- (copy-file "libtcc1.a" (string-append out "/lib/libtcc1.a"))
- (delete-file (string-append out "/lib/tcc/libtcc1.a"))
- (copy-file "libtcc1.a" (string-append out
"/lib/tcc/libtcc1.a"))))))))))
+ `(#:strip-binaries? #f ; binutil's strip b0rkes MesCC/M1/hex2 binaries,
+ ; tcc-boot also comes with
MesCC/M1/hex2-built
+ ; binaries
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref %outputs "out"))
+ (coreutils (assoc-ref %build-inputs "coreutils"))
+ (mes (assoc-ref %build-inputs "mes"))
+ (tcc (assoc-ref %build-inputs "tcc"))
+ (libc (assoc-ref %build-inputs "libc"))
+ (interpreter (if libc
+ (string-append libc
,(glibc-dynamic-linker))
+ (string-append mes "/lib/mes-loader"))))
+ ;; unpack
+ (setenv "PATH" (string-append
+ coreutils "/bin"
+ ":" tcc "/bin"))
+ (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
+ (zero? (system* "sh" "configure"
+ (string-append "--cc=tcc")
+ (string-append "--cpu=i386")
+ (string-append "--prefix=" out)
+ (string-append "--elfinterp=" interpreter)
+ (string-append "--crtprefix=" tcc "/lib")
+ (string-append "--sysincludepaths=" tcc
"/include")
+ (string-append "--libpaths=" tcc "/lib"))))))
+ (replace 'build
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref %outputs "out"))
+ (mes (assoc-ref %build-inputs "mes"))
+ (tcc (assoc-ref %build-inputs "tcc"))
+ (libc (assoc-ref %build-inputs "libc"))
+ (interpreter (if libc
+ (string-append libc
,(glibc-dynamic-linker))
+ (string-append mes "/lib/mes-loader"))))
+ (zero? (system* "tcc"
+ "-vvv"
+ "-D" "BOOTSTRAP=1"
+ "-D" "ONE_SOURCE=1"
+ "-D" "TCC_TARGET_I386=1"
+ "-D" "CONFIG_TCC_STATIC=1"
+ "-D" "CONFIG_USE_LIBGCC=1"
+ "-D" (string-append "CONFIG_TCCDIR=\"" out
"/lib/tcc\"")
+ "-D" (string-append "CONFIG_TCC_CRTPREFIX=\""
out "/lib:{B}/lib:.\"")
+ "-D" (string-append "CONFIG_TCC_CRTPREFIX=\""
out "/lib:{B}/lib:.\"")
+ "-D" (string-append "CONFIG_TCC_ELFINTERP=\""
interpreter "\"")
+ "-D" (string-append "CONFIG_TCC_LIBPATHS=\""
tcc "/lib:{B}/lib:.\"")
+ "-D" (string-append
"CONFIG_TCC_SYSINCLUDEPATHS=\"" tcc "/include" ":/include:{B}/include\"")
+ "-D" (string-append "TCC_LIBGCC=\"" tcc
"/lib/libc.a\"")
+ "-I" (string-append tcc "/out")
+ "-L" (string-append tcc "/lib")
+ "-o" "tcc"
+ "tcc.c")))))
+ (replace 'check
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; FIXME: add sensible check target (without depending on make)
+ ;; ./check.sh ?
+ (= 1 (status:exit-val (system* "./tcc" "--help")))))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref %outputs "out"))
+ (tcc (assoc-ref %build-inputs "tcc")))
+ (and
+ (mkdir-p (string-append out "/bin"))
+ (copy-file "tcc" (string-append out "/bin/tcc"))
+ (mkdir-p (string-append out "/lib/tcc"))
+ (copy-recursively (string-append tcc "/include")
+ (string-append out "/include"))
+ (copy-recursively (string-append tcc "/lib")
+ (string-append out "/lib"))
+ (zero? (system* "tcc" "-D" "TCC_TARGET_I386=1" "-c" "-o"
"libtcc1.o" "lib/libtcc1.c"))
+ (zero? (system* "tcc" "-ar" "rc" "libtcc1.a" "libtcc1.o"))
+ (copy-file "libtcc1.a" (string-append out "/lib/libtcc1.a"))
+ (delete-file (string-append out "/lib/tcc/libtcc1.a"))
+ (copy-file "libtcc1.a" (string-append out
"/lib/tcc/libtcc1.a"))))))))))))
(define-public m4-mesboot
(package-with-bootstrap-guile
- 155/207: Revert "gnu: Add %diffutils-static, %diffutils-static-stripped, %diffutils-bootstrap-tarball.", (continued)
- 155/207: Revert "gnu: Add %diffutils-static, %diffutils-static-stripped, %diffutils-bootstrap-tarball.", Jan Nieuwenhuizen, 2018/09/08
- 180/207: gnu: make-mesboot0: Cleanup., Jan Nieuwenhuizen, 2018/09/08
- 80/207: gnu: Add gcc-core-boot 2.95.3., Jan Nieuwenhuizen, 2018/09/08
- 173/207: gnu: Add mesboot-headers., Jan Nieuwenhuizen, 2018/09/08
- 122/207: gnu: tcc-boot: Revise dependencies., Jan Nieuwenhuizen, 2018/09/08
- 97/207: gnu: gcc-boot: build with %cheat-binutils?, Jan Nieuwenhuizen, 2018/09/08
- 148/207: gnu: mes-boot: Update to 0.17.1., Jan Nieuwenhuizen, 2018/09/08
- 156/207: Revert "gnu: Add %bootstrap-make.", Jan Nieuwenhuizen, 2018/09/08
- 170/207: gnu: make-mesboot: Update to 3.82., Jan Nieuwenhuizen, 2018/09/08
- 105/207: gnu: binutils-mesboot: Rename from binutils-boot., Jan Nieuwenhuizen, 2018/09/08
- 137/207: gnu: tcc-boot: Use gnu-build-system.,
Jan Nieuwenhuizen <=
- 150/207: gnu: Add make-mesboot 3.79., Jan Nieuwenhuizen, 2018/09/08
- 191/207: gnu: glibc-headers-mesboot: Cleanup., Jan Nieuwenhuizen, 2018/09/08
- 165/207: Revert "gnu: make-boot0: Set LOADLIBES for i686-linux.", Jan Nieuwenhuizen, 2018/09/08
- 142/207: gnu: Add %linux-libre-headers-stripped, %linux-libre-headers-bootstrap-tarball., Jan Nieuwenhuizen, 2018/09/08
- 103/207: gnu: glibc-mesboot: Rename from glibc-boot., Jan Nieuwenhuizen, 2018/09/08
- 194/207: oops: fixup glibc-bootstrap-system-2.16.0.patch name., Jan Nieuwenhuizen, 2018/09/08
- 111/207: gnu: m4-mesboot: Package with boostrap-guile., Jan Nieuwenhuizen, 2018/09/08
- 145/207: bootstrap: Integrate mes bootstrap for i686-linux., Jan Nieuwenhuizen, 2018/09/08
- 96/207: gnu: Add binutils-boot0-cheat., Jan Nieuwenhuizen, 2018/09/08
- 133/207: bootstrap: Move mes seeds to bootstrap.scm, Jan Nieuwenhuizen, 2018/09/08