janneke pushed a commit to branch wip-bootstrap in repository guix. commit eca4d2e4db316a75f276ebefc4dec8d8fa10788c Author: Jan Nieuwenhuizen <jann...@gnu.org> Date: Fri Jun 29 21:14:26 2018 +0200
gnu: tcc-boot: Package with bootstrap-guile. * gnu/packages/mes.scm (tcc-boot): Package with bootstrap-guile. --- gnu/packages/mes.scm | 179 ++++++++++++++++++++++++++------------------------- 1 file changed, 90 insertions(+), 89 deletions(-) diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm index e1c0c8e..8a87d0a 100644 --- a/gnu/packages/mes.scm +++ b/gnu/packages/mes.scm @@ -514,95 +514,96 @@ standard.") (license lgpl2.1+))))) (define-public tcc-boot - (package - (inherit tcc-boot0) - (name "tcc-boot") - (version "0.9.27") - (source (origin - (method url-fetch) - (uri (string-append "mirror://savannah/tinycc/tcc-" - version ".tar.bz2")) - (patches (search-patches "tcc-boot-0.9.27.patch")) - (sha256 - (base32 - "177bdhwzrnqgyrdv1dwvpd04fcxj68s5pm1dzwny6359ziway8yy")))) - (build-system trivial-build-system) - (supported-systems '("i686-linux" "x86_64-linux")) - - (native-inputs - `(("static-bash" ,@(assoc-ref %bootstrap-inputs "bash")) - ("tar" ,(search-bootstrap-binary "tar" (%current-system))) - ("xz" ,(search-bootstrap-binary "xz" (%current-system))) - ("mes" ,mes-boot) - ("tcc" ,tcc-boot0))) - (arguments - `(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let* ((bash (assoc-ref %build-inputs "static-bash")) - (tar (assoc-ref %build-inputs "tar")) - (xz (assoc-ref %build-inputs "xz")) - (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 - bash "/bin:" - tar "/bin:" - tcc "/bin:" - xz "/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"))))))))) + (package-with-bootstrap-guile + (package + (inherit tcc-boot0) + (name "tcc-boot") + (version "0.9.27") + (source (origin + (method url-fetch) + (uri (string-append "mirror://savannah/tinycc/tcc-" + version ".tar.bz2")) + (patches (search-patches "tcc-boot-0.9.27.patch")) + (sha256 + (base32 + "177bdhwzrnqgyrdv1dwvpd04fcxj68s5pm1dzwny6359ziway8yy")))) + (build-system trivial-build-system) + (supported-systems '("i686-linux" "x86_64-linux")) + + (native-inputs + `(("static-bash" ,@(assoc-ref %bootstrap-inputs "bash")) + ("tar" ,(search-bootstrap-binary "tar" (%current-system))) + ("xz" ,(search-bootstrap-binary "xz" (%current-system))) + ("mes" ,mes-boot) + ("tcc" ,tcc-boot0))) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((bash (assoc-ref %build-inputs "static-bash")) + (tar (assoc-ref %build-inputs "tar")) + (xz (assoc-ref %build-inputs "xz")) + (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 + bash "/bin:" + tar "/bin:" + tcc "/bin:" + xz "/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")))))))))) (define-public m4-mesboot (package-with-bootstrap-guile