2013-01-05 23:47:50 +00:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
2014-05-06 13:01:39 +00:00
|
|
|
|
;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
;;;
|
2013-01-05 23:47:50 +00:00
|
|
|
|
;;; This file is part of GNU Guix.
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
;;;
|
2013-01-05 23:47:50 +00:00
|
|
|
|
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
;;; under the terms of the GNU General Public License as published by
|
|
|
|
|
;;; the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
|
;;; your option) any later version.
|
|
|
|
|
;;;
|
2013-01-05 23:47:50 +00:00
|
|
|
|
;;; GNU Guix is distributed in the hope that it will be useful, but
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;;; GNU General Public License for more details.
|
|
|
|
|
;;;
|
|
|
|
|
;;; You should have received a copy of the GNU General Public License
|
2013-01-05 23:47:50 +00:00
|
|
|
|
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
|
2013-01-18 00:06:24 +00:00
|
|
|
|
(define-module (gnu packages make-bootstrap)
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
#:use-module (guix utils)
|
|
|
|
|
#:use-module (guix packages)
|
2013-01-05 14:46:08 +00:00
|
|
|
|
#:use-module (guix licenses)
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
#:use-module (guix build-system trivial)
|
2013-01-01 15:55:34 +00:00
|
|
|
|
#:use-module (guix build-system gnu)
|
2013-01-18 00:06:47 +00:00
|
|
|
|
#:use-module ((gnu packages) #:select (search-patch))
|
gnu: Split (gnu packages base), adding (gnu packages commencement).
* gnu/packages/base.scm (gnu-make-boot0, diffutils-boot0,
findutils-boot0, %boot0-inputs, nix-system->gnu-triplet, boot-triplet,
binutils-boot0, gcc-boot0, perl-boot0, linux-libre-headers-boot0,
texinfo-boot0, %boot1-inputs, glibc-final-with-bootstrap-bash,
cross-gcc-wrapper, static-bash-for-glibc, glibc-final,
gcc-boot0-wrapped, %boot2-inputs, binutils-final, libstdc++,
gcc-final, ld-wrapper-boot3, %boot3-inputs, bash-final, %boot4-inputs,
guile-final, gnu-make-final, ld-wrapper, coreutils-final, grep-final,
%boot5-inputs, %final-inputs, canonical-package, gcc-toolchain,
gcc-toolchain-4.8, gcc-toolchain-4.9): Move to...
* gnu/packages/commencement.scm: ... here. New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
* build-aux/check-final-inputs-self-contained.scm: Adjust accordingly.
* gnu/packages/cross-base.scm: Likewise.
* gnu/packages/make-bootstrap.scm: Likewise.
* guix/build-system/cmake.scm (cmake-build): Likewise.
* guix/build-system/gnu.scm (standard-packages, gnu-build,
gnu-cross-build): Likewise.
* guix/build-system/perl.scm (perl-build): Likewise.
* guix/build-system/python.scm (python-build): Likewise.
* guix/build-system/trivial.scm (guile-for-build): Likewise.
* guix/download.scm (url-fetch): Likewise.
* guix/gexp.scm (default-guile): Likewise.
* guix/git-download.scm (git-fetch): Likewise.
* guix/monads.scm (run-with-store): Likewise.
* guix/packages.scm (default-guile): Likewise.
* guix/scripts/package.scm (guix-package): Likewise.
* guix/scripts/refresh.scm: Likewise.
* guix/svn-download.scm (svn-fetch): Likewise.
* tests/builders.scm (%bootstrap-inputs, %bootstrap-search-paths):
Likewise.
* tests/packages.scm ("GNU Make, bootstrap"): Likewise.
* tests/guix-package.sh: Likewise.
* gnu/services/base.scm: Use 'canonical-package' instead of xxx-final.
* gnu/services/xorg.scm: Likewise.
* gnu/system/vm.scm: Likewise.
* guix/scripts/pull.scm (guix-pull): Likewise.
2014-08-26 22:25:17 +00:00
|
|
|
|
#:use-module ((gnu packages commencement) #:select (%final-inputs))
|
2013-01-18 00:06:24 +00:00
|
|
|
|
#:use-module (gnu packages base)
|
2013-06-25 21:39:14 +00:00
|
|
|
|
#:use-module (gnu packages cross-base)
|
2013-01-18 00:06:24 +00:00
|
|
|
|
#:use-module (gnu packages bash)
|
|
|
|
|
#:use-module (gnu packages compression)
|
|
|
|
|
#:use-module (gnu packages gawk)
|
2013-03-27 22:47:54 +00:00
|
|
|
|
#:use-module (gnu packages gcc)
|
2013-01-18 00:06:24 +00:00
|
|
|
|
#:use-module (gnu packages guile)
|
2013-02-13 20:42:34 +00:00
|
|
|
|
#:use-module (gnu packages bdw-gc)
|
2013-01-18 00:06:24 +00:00
|
|
|
|
#:use-module (gnu packages linux)
|
|
|
|
|
#:use-module (gnu packages multiprecision)
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
#:use-module (ice-9 match)
|
2012-12-20 00:29:56 +00:00
|
|
|
|
#:use-module (srfi srfi-1)
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
#:export (%bootstrap-binaries-tarball
|
|
|
|
|
%binutils-bootstrap-tarball
|
|
|
|
|
%glibc-bootstrap-tarball
|
|
|
|
|
%gcc-bootstrap-tarball
|
2013-01-05 14:46:08 +00:00
|
|
|
|
%guile-bootstrap-tarball
|
2014-05-06 13:01:39 +00:00
|
|
|
|
%bootstrap-tarballs
|
|
|
|
|
|
|
|
|
|
%guile-static-stripped))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;;
|
2013-08-21 09:38:51 +00:00
|
|
|
|
;;; This module provides tools to build tarballs of the "bootstrap binaries"
|
2013-01-18 00:06:24 +00:00
|
|
|
|
;;; used in (gnu packages bootstrap). These statically-linked binaries are
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
;;; taken for granted and used as the root of the whole bootstrap procedure.
|
|
|
|
|
;;;
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2013-06-25 21:39:14 +00:00
|
|
|
|
(define* (glibc-for-bootstrap #:optional (base glibc))
|
2013-06-14 13:29:08 +00:00
|
|
|
|
"Return a libc deriving from BASE whose `system' and `popen' functions looks
|
|
|
|
|
for `sh' in $PATH, and without nscd, and with static NSS modules."
|
|
|
|
|
(package (inherit base)
|
gnu: Use the 'patches' field of <origin>.
* gnu/packages/apr.scm,
gnu/packages/autotools.scm,
gnu/packages/avahi.scm,
gnu/packages/cdrom.scm,
gnu/packages/cmake.scm,
gnu/packages/cpio.scm,
gnu/packages/cross-base.scm,
gnu/packages/emacs.scm,
gnu/packages/flex.scm,
gnu/packages/fontutils.scm,
gnu/packages/glib.scm,
gnu/packages/grub.scm,
gnu/packages/guile.scm,
gnu/packages/idutils.scm,
gnu/packages/libevent.scm,
gnu/packages/linux.scm,
gnu/packages/mail.scm,
gnu/packages/make-bootstrap.scm,
gnu/packages/mp3.scm,
gnu/packages/oggvorbis.scm,
gnu/packages/pdf.scm,
gnu/packages/plotutils.scm,
gnu/packages/qemu.scm,
gnu/packages/recutils.scm,
gnu/packages/rush.scm,
gnu/packages/scheme.scm,
gnu/packages/system.scm,
gnu/packages/tcsh.scm,
gnu/packages/valgrind.scm,
gnu/packages/vpn.scm,
gnu/packages/w3m: Use the 'patches' field of <origin> instead of
adding a patch as input plus using #:patches.
2013-10-08 22:09:04 +00:00
|
|
|
|
(source (origin (inherit (package-source base))
|
|
|
|
|
(patches (cons (search-patch "glibc-bootstrap-system.patch")
|
|
|
|
|
(origin-patches (package-source base))))))
|
2012-12-20 00:29:56 +00:00
|
|
|
|
(arguments
|
2013-06-14 13:29:08 +00:00
|
|
|
|
(substitute-keyword-arguments (package-arguments base)
|
packages: Mark the `arguments' field of <package> as thunked.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
(package-derivation): Adjust accordingly. Parameterize
%CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
`package-arguments' to always return a list, and return a list.
(package-with-extra-configure-variable): Likewise.
(static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
from a lambda to a list, and use (%current-system) as needed.
(nix-system->gnu-triplet, boot-triplet): Have the first argument
default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
default to (%current-system).
(%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
expect `package-arguments' to return a list.
(%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
2013-01-23 22:21:59 +00:00
|
|
|
|
((#:configure-flags flags)
|
2013-06-25 21:39:14 +00:00
|
|
|
|
;; Arrange so that getaddrinfo & co. do not contact the nscd,
|
|
|
|
|
;; and can use statically-linked NSS modules.
|
|
|
|
|
`(cons* "--disable-nscd" "--disable-build-nscd"
|
|
|
|
|
"--enable-static-nss"
|
2013-11-03 21:35:17 +00:00
|
|
|
|
,flags))))
|
|
|
|
|
|
|
|
|
|
;; Remove the 'debug' output to allow bit-reproducible builds (when the
|
|
|
|
|
;; 'debug' output is used, ELF files end up with a .gnu_debuglink, which
|
|
|
|
|
;; includes a CRC of the corresponding debugging symbols; those symbols
|
|
|
|
|
;; contain store file names, so the CRC changes at every rebuild.)
|
|
|
|
|
(outputs (delete "debug" (package-outputs base)))))
|
2013-06-14 13:29:08 +00:00
|
|
|
|
|
|
|
|
|
(define (package-with-relocatable-glibc p)
|
|
|
|
|
"Return a variant of P that uses the libc as defined by
|
|
|
|
|
`glibc-for-bootstrap'."
|
|
|
|
|
|
2013-06-25 21:39:14 +00:00
|
|
|
|
(define (cross-bootstrap-libc)
|
|
|
|
|
(let ((target (%current-target-system)))
|
|
|
|
|
(glibc-for-bootstrap
|
|
|
|
|
;; `cross-libc' already returns a cross libc, so clear
|
|
|
|
|
;; %CURRENT-TARGET-SYSTEM.
|
|
|
|
|
(parameterize ((%current-target-system #f))
|
|
|
|
|
(cross-libc target)))))
|
|
|
|
|
|
|
|
|
|
;; Standard inputs with the above libc and corresponding GCC.
|
|
|
|
|
|
|
|
|
|
(define (inputs)
|
|
|
|
|
(if (%current-target-system) ; is this package cross built?
|
|
|
|
|
`(("cross-libc" ,(cross-bootstrap-libc)))
|
|
|
|
|
'()))
|
|
|
|
|
|
|
|
|
|
(define (native-inputs)
|
|
|
|
|
(if (%current-target-system)
|
|
|
|
|
(let ((target (%current-target-system)))
|
|
|
|
|
`(("cross-gcc" ,(cross-gcc target
|
|
|
|
|
(cross-binutils target)
|
|
|
|
|
(cross-bootstrap-libc)))
|
|
|
|
|
("cross-binutils" ,(cross-binutils target))
|
|
|
|
|
,@%final-inputs))
|
|
|
|
|
`(("libc" ,(glibc-for-bootstrap))
|
2013-11-01 12:04:38 +00:00
|
|
|
|
("gcc" ,(package (inherit gcc-4.8)
|
2014-06-13 13:57:23 +00:00
|
|
|
|
(outputs '("out")) ; all in one so libgcc_s is easily found
|
2013-06-25 21:39:14 +00:00
|
|
|
|
(inputs
|
|
|
|
|
`(("libc",(glibc-for-bootstrap))
|
2013-11-01 12:04:38 +00:00
|
|
|
|
,@(package-inputs gcc-4.8)))))
|
2013-06-25 21:39:14 +00:00
|
|
|
|
,@(fold alist-delete %final-inputs '("libc" "gcc")))))
|
2013-06-14 13:29:08 +00:00
|
|
|
|
|
|
|
|
|
(package-with-explicit-inputs p inputs
|
2013-06-25 21:39:14 +00:00
|
|
|
|
(current-source-location)
|
|
|
|
|
#:native-inputs native-inputs))
|
2012-12-20 00:29:56 +00:00
|
|
|
|
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(define %bash-static
|
2013-01-01 15:54:45 +00:00
|
|
|
|
(static-package bash-light))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
|
|
|
|
|
(define %static-inputs
|
|
|
|
|
;; Packages that are to be used as %BOOTSTRAP-INPUTS.
|
|
|
|
|
(let ((coreutils (package (inherit coreutils)
|
2013-06-14 12:50:33 +00:00
|
|
|
|
(arguments
|
|
|
|
|
`(#:configure-flags
|
|
|
|
|
'("--disable-nls"
|
|
|
|
|
"--disable-silent-rules"
|
|
|
|
|
"--enable-no-install-program=stdbuf,libstdbuf.so"
|
|
|
|
|
"CFLAGS=-Os -g0" ; smaller, please
|
|
|
|
|
"LDFLAGS=-static -pthread")
|
|
|
|
|
#:tests? #f ; signal-related Gnulib tests fail
|
|
|
|
|
,@(package-arguments coreutils)))
|
2013-01-04 17:58:53 +00:00
|
|
|
|
|
2013-06-14 12:50:33 +00:00
|
|
|
|
;; Remove optional dependencies such as GMP. Keep Perl
|
|
|
|
|
;; except if it's missing (which is the case when
|
|
|
|
|
;; cross-compiling).
|
|
|
|
|
(inputs (match (assoc "perl" (package-inputs coreutils))
|
|
|
|
|
(#f '())
|
2013-08-28 20:43:01 +00:00
|
|
|
|
(x (list x))))
|
|
|
|
|
|
2013-11-03 21:35:17 +00:00
|
|
|
|
;; Remove the 'debug' output (see above for the reason.)
|
2013-08-28 20:43:01 +00:00
|
|
|
|
(outputs '("out"))))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(bzip2 (package (inherit bzip2)
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments bzip2)
|
|
|
|
|
((#:phases phases)
|
|
|
|
|
`(alist-cons-before
|
|
|
|
|
'build 'dash-static
|
|
|
|
|
(lambda _
|
|
|
|
|
(substitute* "Makefile"
|
|
|
|
|
(("^LDFLAGS[[:blank:]]*=.*$")
|
|
|
|
|
"LDFLAGS = -static")))
|
|
|
|
|
,phases))))))
|
|
|
|
|
(xz (package (inherit xz)
|
|
|
|
|
(arguments
|
|
|
|
|
`(#:strip-flags '("--strip-all")
|
|
|
|
|
#:phases (alist-cons-before
|
|
|
|
|
'configure 'static-executable
|
|
|
|
|
(lambda _
|
|
|
|
|
;; Ask Libtool for a static executable.
|
|
|
|
|
(substitute* "src/xz/Makefile.in"
|
|
|
|
|
(("^xz_LDADD =")
|
|
|
|
|
"xz_LDADD = -all-static")))
|
|
|
|
|
%standard-phases)))))
|
|
|
|
|
(gawk (package (inherit gawk)
|
gnu: Use the 'patches' field of <origin>.
* gnu/packages/apr.scm,
gnu/packages/autotools.scm,
gnu/packages/avahi.scm,
gnu/packages/cdrom.scm,
gnu/packages/cmake.scm,
gnu/packages/cpio.scm,
gnu/packages/cross-base.scm,
gnu/packages/emacs.scm,
gnu/packages/flex.scm,
gnu/packages/fontutils.scm,
gnu/packages/glib.scm,
gnu/packages/grub.scm,
gnu/packages/guile.scm,
gnu/packages/idutils.scm,
gnu/packages/libevent.scm,
gnu/packages/linux.scm,
gnu/packages/mail.scm,
gnu/packages/make-bootstrap.scm,
gnu/packages/mp3.scm,
gnu/packages/oggvorbis.scm,
gnu/packages/pdf.scm,
gnu/packages/plotutils.scm,
gnu/packages/qemu.scm,
gnu/packages/recutils.scm,
gnu/packages/rush.scm,
gnu/packages/scheme.scm,
gnu/packages/system.scm,
gnu/packages/tcsh.scm,
gnu/packages/valgrind.scm,
gnu/packages/vpn.scm,
gnu/packages/w3m: Use the 'patches' field of <origin> instead of
adding a patch as input plus using #:patches.
2013-10-08 22:09:04 +00:00
|
|
|
|
(source (origin (inherit (package-source gawk))
|
|
|
|
|
(patches (cons (search-patch "gawk-shell.patch")
|
|
|
|
|
(origin-patches
|
|
|
|
|
(package-source gawk))))))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(arguments
|
gnu: Use the 'patches' field of <origin>.
* gnu/packages/apr.scm,
gnu/packages/autotools.scm,
gnu/packages/avahi.scm,
gnu/packages/cdrom.scm,
gnu/packages/cmake.scm,
gnu/packages/cpio.scm,
gnu/packages/cross-base.scm,
gnu/packages/emacs.scm,
gnu/packages/flex.scm,
gnu/packages/fontutils.scm,
gnu/packages/glib.scm,
gnu/packages/grub.scm,
gnu/packages/guile.scm,
gnu/packages/idutils.scm,
gnu/packages/libevent.scm,
gnu/packages/linux.scm,
gnu/packages/mail.scm,
gnu/packages/make-bootstrap.scm,
gnu/packages/mp3.scm,
gnu/packages/oggvorbis.scm,
gnu/packages/pdf.scm,
gnu/packages/plotutils.scm,
gnu/packages/qemu.scm,
gnu/packages/recutils.scm,
gnu/packages/rush.scm,
gnu/packages/scheme.scm,
gnu/packages/system.scm,
gnu/packages/tcsh.scm,
gnu/packages/valgrind.scm,
gnu/packages/vpn.scm,
gnu/packages/w3m: Use the 'patches' field of <origin> instead of
adding a patch as input plus using #:patches.
2013-10-08 22:09:04 +00:00
|
|
|
|
`(;; Starting from gawk 4.1.0, some of the tests for the
|
2013-07-14 14:58:43 +00:00
|
|
|
|
;; plug-in mechanism just fail on static builds:
|
|
|
|
|
;;
|
|
|
|
|
;; ./fts.awk:1: error: can't open shared library `filefuncs' for reading (No such file or directory)
|
|
|
|
|
#:tests? #f
|
|
|
|
|
|
packages: Mark the `arguments' field of <package> as thunked.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
(package-derivation): Adjust accordingly. Parameterize
%CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
`package-arguments' to always return a list, and return a list.
(package-with-extra-configure-variable): Likewise.
(static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
from a lambda to a list, and use (%current-system) as needed.
(nix-system->gnu-triplet, boot-triplet): Have the first argument
default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
default to (%current-system).
(%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
expect `package-arguments' to return a list.
(%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
2013-01-23 22:21:59 +00:00
|
|
|
|
,@(substitute-keyword-arguments (package-arguments gawk)
|
|
|
|
|
((#:phases phases)
|
|
|
|
|
`(alist-cons-before
|
|
|
|
|
'configure 'no-export-dynamic
|
|
|
|
|
(lambda _
|
|
|
|
|
;; Since we use `-static', remove
|
|
|
|
|
;; `-export-dynamic'.
|
|
|
|
|
(substitute* "configure"
|
|
|
|
|
(("-export-dynamic") "")))
|
|
|
|
|
,phases)))))
|
gnu: Use the 'patches' field of <origin>.
* gnu/packages/apr.scm,
gnu/packages/autotools.scm,
gnu/packages/avahi.scm,
gnu/packages/cdrom.scm,
gnu/packages/cmake.scm,
gnu/packages/cpio.scm,
gnu/packages/cross-base.scm,
gnu/packages/emacs.scm,
gnu/packages/flex.scm,
gnu/packages/fontutils.scm,
gnu/packages/glib.scm,
gnu/packages/grub.scm,
gnu/packages/guile.scm,
gnu/packages/idutils.scm,
gnu/packages/libevent.scm,
gnu/packages/linux.scm,
gnu/packages/mail.scm,
gnu/packages/make-bootstrap.scm,
gnu/packages/mp3.scm,
gnu/packages/oggvorbis.scm,
gnu/packages/pdf.scm,
gnu/packages/plotutils.scm,
gnu/packages/qemu.scm,
gnu/packages/recutils.scm,
gnu/packages/rush.scm,
gnu/packages/scheme.scm,
gnu/packages/system.scm,
gnu/packages/tcsh.scm,
gnu/packages/valgrind.scm,
gnu/packages/vpn.scm,
gnu/packages/w3m: Use the 'patches' field of <origin> instead of
adding a patch as input plus using #:patches.
2013-10-08 22:09:04 +00:00
|
|
|
|
(inputs (if (%current-target-system)
|
|
|
|
|
`(("bash" ,%bash-static))
|
|
|
|
|
'()))))
|
2013-06-25 21:39:14 +00:00
|
|
|
|
(finalize (compose static-package
|
|
|
|
|
package-with-relocatable-glibc)))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
`(,@(map (match-lambda
|
|
|
|
|
((name package)
|
2012-12-20 00:29:56 +00:00
|
|
|
|
(list name (finalize package))))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
`(("tar" ,tar)
|
|
|
|
|
("gzip" ,gzip)
|
|
|
|
|
("bzip2" ,bzip2)
|
|
|
|
|
("xz" ,xz)
|
|
|
|
|
("patch" ,patch)
|
|
|
|
|
("coreutils" ,coreutils)
|
|
|
|
|
("sed" ,sed)
|
|
|
|
|
("grep" ,grep)
|
|
|
|
|
("gawk" ,gawk)))
|
2013-06-25 21:39:14 +00:00
|
|
|
|
("bash" ,%bash-static))))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
|
|
|
|
|
(define %static-binaries
|
|
|
|
|
(package
|
|
|
|
|
(name "static-binaries")
|
|
|
|
|
(version "0")
|
|
|
|
|
(build-system trivial-build-system)
|
|
|
|
|
(source #f)
|
|
|
|
|
(inputs %static-inputs)
|
|
|
|
|
(arguments
|
|
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
|
#:builder
|
|
|
|
|
(begin
|
|
|
|
|
(use-modules (ice-9 ftw)
|
|
|
|
|
(ice-9 match)
|
|
|
|
|
(srfi srfi-1)
|
|
|
|
|
(srfi srfi-26)
|
|
|
|
|
(guix build utils))
|
|
|
|
|
|
|
|
|
|
(let ()
|
|
|
|
|
(define (directory-contents dir)
|
|
|
|
|
(map (cut string-append dir "/" <>)
|
|
|
|
|
(scandir dir (negate (cut member <> '("." ".."))))))
|
|
|
|
|
|
|
|
|
|
(define (copy-directory source destination)
|
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(format #t "copying ~s...~%" file)
|
|
|
|
|
(copy-file file
|
|
|
|
|
(string-append destination "/"
|
|
|
|
|
(basename file))))
|
|
|
|
|
(directory-contents source)))
|
|
|
|
|
|
|
|
|
|
(let* ((out (assoc-ref %outputs "out"))
|
|
|
|
|
(bin (string-append out "/bin")))
|
|
|
|
|
(mkdir-p bin)
|
|
|
|
|
|
|
|
|
|
;; Copy Coreutils binaries.
|
|
|
|
|
(let* ((coreutils (assoc-ref %build-inputs "coreutils"))
|
|
|
|
|
(source (string-append coreutils "/bin")))
|
|
|
|
|
(copy-directory source bin))
|
|
|
|
|
|
|
|
|
|
;; For the other inputs, copy just one binary, which has the
|
|
|
|
|
;; same name as the input.
|
|
|
|
|
(for-each (match-lambda
|
|
|
|
|
((name . dir)
|
|
|
|
|
(let ((source (string-append dir "/bin/" name)))
|
|
|
|
|
(format #t "copying ~s...~%" source)
|
|
|
|
|
(copy-file source
|
|
|
|
|
(string-append bin "/" name)))))
|
|
|
|
|
(alist-delete "coreutils" %build-inputs))
|
|
|
|
|
|
|
|
|
|
;; But of course, there are exceptions to this rule.
|
|
|
|
|
(let ((grep (assoc-ref %build-inputs "grep")))
|
|
|
|
|
(copy-file (string-append grep "/bin/fgrep")
|
|
|
|
|
(string-append bin "/fgrep"))
|
|
|
|
|
(copy-file (string-append grep "/bin/egrep")
|
|
|
|
|
(string-append bin "/egrep")))
|
|
|
|
|
|
|
|
|
|
;; Clear references to the store path.
|
|
|
|
|
(for-each remove-store-references
|
|
|
|
|
(directory-contents bin))
|
|
|
|
|
|
|
|
|
|
(with-directory-excursion bin
|
|
|
|
|
;; Programs such as Perl's build system want these aliases.
|
|
|
|
|
(symlink "bash" "sh")
|
|
|
|
|
(symlink "gawk" "awk"))
|
|
|
|
|
|
|
|
|
|
#t)))))
|
|
|
|
|
(synopsis "Statically-linked bootstrap binaries")
|
|
|
|
|
(description
|
|
|
|
|
"Binaries used to bootstrap the distribution.")
|
|
|
|
|
(license #f)
|
|
|
|
|
(home-page #f)))
|
|
|
|
|
|
|
|
|
|
(define %binutils-static
|
|
|
|
|
;; Statically-linked Binutils.
|
|
|
|
|
(package (inherit binutils)
|
|
|
|
|
(name "binutils-static")
|
|
|
|
|
(arguments
|
2013-06-26 15:23:56 +00:00
|
|
|
|
`(#:configure-flags (cons "--disable-gold"
|
|
|
|
|
,(match (memq #:configure-flags
|
|
|
|
|
(package-arguments binutils))
|
|
|
|
|
((#:configure-flags flags _ ...)
|
|
|
|
|
flags)))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
#:strip-flags '("--strip-all")
|
|
|
|
|
#:phases (alist-cons-before
|
|
|
|
|
'configure 'all-static
|
|
|
|
|
(lambda _
|
|
|
|
|
;; The `-all-static' libtool flag can only be passed
|
|
|
|
|
;; after `configure', since configure tests don't use
|
|
|
|
|
;; libtool, and only for executables built with libtool.
|
|
|
|
|
(substitute* '("binutils/Makefile.in"
|
|
|
|
|
"gas/Makefile.in"
|
|
|
|
|
"ld/Makefile.in")
|
|
|
|
|
(("^LDFLAGS =(.*)$" line)
|
|
|
|
|
(string-append line
|
|
|
|
|
"\nAM_LDFLAGS = -static -all-static\n"))))
|
|
|
|
|
%standard-phases)))))
|
|
|
|
|
|
|
|
|
|
(define %binutils-static-stripped
|
|
|
|
|
;; The subset of Binutils that we need.
|
|
|
|
|
(package (inherit %binutils-static)
|
2013-02-06 14:25:08 +00:00
|
|
|
|
(name (string-append (package-name %binutils-static) "-stripped"))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(build-system trivial-build-system)
|
2013-02-06 14:25:08 +00:00
|
|
|
|
(outputs '("out"))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(arguments
|
|
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
|
#:builder
|
|
|
|
|
(begin
|
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
|
|
|
|
|
|
(setvbuf (current-output-port) _IOLBF)
|
|
|
|
|
(let* ((in (assoc-ref %build-inputs "binutils"))
|
|
|
|
|
(out (assoc-ref %outputs "out"))
|
|
|
|
|
(bin (string-append out "/bin")))
|
|
|
|
|
(mkdir-p bin)
|
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(let ((target (string-append bin "/" file)))
|
|
|
|
|
(format #t "copying `~a'...~%" file)
|
|
|
|
|
(copy-file (string-append in "/bin/" file)
|
|
|
|
|
target)
|
|
|
|
|
(remove-store-references target)))
|
|
|
|
|
'("ar" "as" "ld" "nm" "objcopy" "objdump"
|
|
|
|
|
"ranlib" "readelf" "size" "strings" "strip"))
|
|
|
|
|
#t))))
|
|
|
|
|
(inputs `(("binutils" ,%binutils-static)))))
|
|
|
|
|
|
|
|
|
|
(define %glibc-stripped
|
|
|
|
|
;; GNU libc's essential shared libraries, dynamic linker, and headers,
|
|
|
|
|
;; with all references to store directories stripped. As a result,
|
|
|
|
|
;; libc.so is unusable and need to be patched for proper relocation.
|
2013-06-14 13:29:08 +00:00
|
|
|
|
(let ((glibc (glibc-for-bootstrap)))
|
2012-12-20 00:29:56 +00:00
|
|
|
|
(package (inherit glibc)
|
|
|
|
|
(name "glibc-stripped")
|
|
|
|
|
(build-system trivial-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
|
#:builder
|
|
|
|
|
(begin
|
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
|
|
|
|
|
|
(setvbuf (current-output-port) _IOLBF)
|
|
|
|
|
(let* ((out (assoc-ref %outputs "out"))
|
|
|
|
|
(libdir (string-append out "/lib"))
|
|
|
|
|
(incdir (string-append out "/include"))
|
|
|
|
|
(libc (assoc-ref %build-inputs "libc"))
|
|
|
|
|
(linux (assoc-ref %build-inputs "linux-headers")))
|
|
|
|
|
(mkdir-p libdir)
|
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(let ((target (string-append libdir "/"
|
|
|
|
|
(basename file))))
|
|
|
|
|
(copy-file file target)
|
|
|
|
|
(remove-store-references target)))
|
|
|
|
|
(find-files (string-append libc "/lib")
|
|
|
|
|
"^(crt.*|ld.*|lib(c|m|dl|rt|pthread|nsl|util).*\\.so(\\..*)?|libc_nonshared\\.a)$"))
|
|
|
|
|
|
|
|
|
|
(copy-recursively (string-append libc "/include") incdir)
|
|
|
|
|
|
|
|
|
|
;; Copy some of the Linux-Libre headers that glibc headers
|
|
|
|
|
;; refer to.
|
|
|
|
|
(mkdir (string-append incdir "/linux"))
|
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(copy-file (string-append linux "/include/linux/" file)
|
|
|
|
|
(string-append incdir "/linux/"
|
|
|
|
|
(basename file))))
|
|
|
|
|
'("limits.h" "errno.h" "socket.h" "kernel.h"
|
|
|
|
|
"sysctl.h" "param.h" "ioctl.h" "types.h"
|
|
|
|
|
"posix_types.h" "stddef.h"))
|
|
|
|
|
|
|
|
|
|
(copy-recursively (string-append linux "/include/asm")
|
|
|
|
|
(string-append incdir "/asm"))
|
|
|
|
|
(copy-recursively (string-append linux "/include/asm-generic")
|
|
|
|
|
(string-append incdir "/asm-generic"))
|
2013-11-02 21:28:30 +00:00
|
|
|
|
|
|
|
|
|
;; Remove the '.install' and '..install.cmd' files; the latter
|
|
|
|
|
;; contains store paths, which prevents bit reproducibility.
|
|
|
|
|
(for-each delete-file (find-files incdir "\\.install"))
|
|
|
|
|
|
2012-12-20 00:29:56 +00:00
|
|
|
|
#t))))
|
2013-06-25 21:39:14 +00:00
|
|
|
|
(inputs `(("libc" ,(let ((target (%current-target-system)))
|
|
|
|
|
(if target
|
|
|
|
|
(glibc-for-bootstrap
|
|
|
|
|
(parameterize ((%current-target-system #f))
|
|
|
|
|
(cross-libc target)))
|
|
|
|
|
glibc)))
|
2013-04-28 22:28:36 +00:00
|
|
|
|
("linux-headers" ,linux-libre-headers)))
|
|
|
|
|
|
|
|
|
|
;; Only one output.
|
|
|
|
|
(outputs '("out")))))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
|
|
|
|
|
(define %gcc-static
|
|
|
|
|
;; A statically-linked GCC, with stripped-down functionality.
|
2013-06-14 13:29:08 +00:00
|
|
|
|
(package-with-relocatable-glibc
|
2013-11-01 12:04:38 +00:00
|
|
|
|
(package (inherit gcc-4.8)
|
2012-12-20 00:29:56 +00:00
|
|
|
|
(name "gcc-static")
|
2014-06-09 09:58:43 +00:00
|
|
|
|
(outputs '("out")) ; all in one
|
2012-12-20 00:29:56 +00:00
|
|
|
|
(arguments
|
packages: Mark the `arguments' field of <package> as thunked.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
(package-derivation): Adjust accordingly. Parameterize
%CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
`package-arguments' to always return a list, and return a list.
(package-with-extra-configure-variable): Likewise.
(static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
from a lambda to a list, and use (%current-system) as needed.
(nix-system->gnu-triplet, boot-triplet): Have the first argument
default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
default to (%current-system).
(%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
expect `package-arguments' to return a list.
(%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
2013-01-23 22:21:59 +00:00
|
|
|
|
`(#:modules ((guix build utils)
|
|
|
|
|
(guix build gnu-build-system)
|
|
|
|
|
(srfi srfi-1)
|
|
|
|
|
(srfi srfi-26)
|
|
|
|
|
(ice-9 regex))
|
2013-11-01 12:04:38 +00:00
|
|
|
|
,@(substitute-keyword-arguments (package-arguments gcc-4.8)
|
packages: Mark the `arguments' field of <package> as thunked.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
(package-derivation): Adjust accordingly. Parameterize
%CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
`package-arguments' to always return a list, and return a list.
(package-with-extra-configure-variable): Likewise.
(static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
from a lambda to a list, and use (%current-system) as needed.
(nix-system->gnu-triplet, boot-triplet): Have the first argument
default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
default to (%current-system).
(%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
expect `package-arguments' to return a list.
(%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
2013-01-23 22:21:59 +00:00
|
|
|
|
((#:guile _) #f)
|
|
|
|
|
((#:implicit-inputs? _) #t)
|
|
|
|
|
((#:configure-flags flags)
|
|
|
|
|
`(append (list
|
2014-06-12 21:27:25 +00:00
|
|
|
|
;; We don't need a full bootstrap here.
|
|
|
|
|
"--disable-bootstrap"
|
|
|
|
|
|
|
|
|
|
;; Make sure '-static' is passed where it matters.
|
|
|
|
|
"--with-stage1-ldflags=-static"
|
|
|
|
|
|
2014-06-13 15:57:41 +00:00
|
|
|
|
;; GCC 4.8+ requires a C++ compiler and library.
|
|
|
|
|
"--enable-languages=c,c++"
|
|
|
|
|
|
2014-06-14 13:34:56 +00:00
|
|
|
|
;; Make sure gcc-nm doesn't require liblto_plugin.so.
|
|
|
|
|
"--disable-lto"
|
|
|
|
|
|
packages: Mark the `arguments' field of <package> as thunked.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
(package-derivation): Adjust accordingly. Parameterize
%CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
`package-arguments' to always return a list, and return a list.
(package-with-extra-configure-variable): Likewise.
(static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
from a lambda to a list, and use (%current-system) as needed.
(nix-system->gnu-triplet, boot-triplet): Have the first argument
default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
default to (%current-system).
(%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
expect `package-arguments' to return a list.
(%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
2013-01-23 22:21:59 +00:00
|
|
|
|
"--disable-shared"
|
|
|
|
|
"--disable-plugin"
|
|
|
|
|
"--disable-libmudflap"
|
2013-11-20 18:01:27 +00:00
|
|
|
|
"--disable-libatomic"
|
|
|
|
|
"--disable-libsanitizer"
|
|
|
|
|
"--disable-libitm"
|
packages: Mark the `arguments' field of <package> as thunked.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
(package-derivation): Adjust accordingly. Parameterize
%CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
`package-arguments' to always return a list, and return a list.
(package-with-extra-configure-variable): Likewise.
(static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
from a lambda to a list, and use (%current-system) as needed.
(nix-system->gnu-triplet, boot-triplet): Have the first argument
default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
default to (%current-system).
(%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
expect `package-arguments' to return a list.
(%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
2013-01-23 22:21:59 +00:00
|
|
|
|
"--disable-libgomp"
|
|
|
|
|
"--disable-libssp"
|
|
|
|
|
"--disable-libquadmath"
|
|
|
|
|
"--disable-decimal-float")
|
|
|
|
|
(remove (cut string-match "--(.*plugin|enable-languages)" <>)
|
2015-01-02 03:53:55 +00:00
|
|
|
|
,flags)))
|
|
|
|
|
((#:phases phases)
|
|
|
|
|
`(alist-cons-after
|
|
|
|
|
'pre-configure 'remove-lgcc_s
|
|
|
|
|
(lambda _
|
|
|
|
|
;; Remove the '-lgcc_s' added to GNU_USER_TARGET_LIB_SPEC in
|
|
|
|
|
;; the 'pre-configure phase of our main gcc package, because
|
|
|
|
|
;; that shared library is not present in this static gcc. See
|
|
|
|
|
;; <https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00008.html>.
|
|
|
|
|
(substitute* (find-files "gcc/config"
|
|
|
|
|
"^gnu-user.*\\.h$")
|
|
|
|
|
((" -lgcc_s}}") "}}")))
|
|
|
|
|
,phases)))))
|
2013-11-23 15:07:29 +00:00
|
|
|
|
(native-inputs
|
|
|
|
|
(if (%current-target-system)
|
|
|
|
|
`(;; When doing a Canadian cross, we need GMP/MPFR/MPC both
|
|
|
|
|
;; as target inputs and as native inputs; the latter is
|
|
|
|
|
;; needed when building build-time tools ('genconstants',
|
|
|
|
|
;; etc.) Failing to do that leads to misdetections of
|
|
|
|
|
;; declarations by 'gcc/configure', and eventually to
|
|
|
|
|
;; duplicate declarations as reported in
|
|
|
|
|
;; <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59217>.
|
|
|
|
|
("gmp-native" ,gmp)
|
|
|
|
|
("mpfr-native" ,mpfr)
|
|
|
|
|
("mpc-native" ,mpc)
|
|
|
|
|
,@(package-native-inputs gcc-4.8))
|
|
|
|
|
(package-native-inputs gcc-4.8))))))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
|
|
|
|
|
(define %gcc-stripped
|
|
|
|
|
;; The subset of GCC files needed for bootstrap.
|
2013-11-01 12:04:38 +00:00
|
|
|
|
(package (inherit gcc-4.8)
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(name "gcc-stripped")
|
|
|
|
|
(build-system trivial-build-system)
|
|
|
|
|
(source #f)
|
2014-06-13 13:57:23 +00:00
|
|
|
|
(outputs '("out")) ;only one output
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(arguments
|
|
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
|
#:builder
|
|
|
|
|
(begin
|
|
|
|
|
(use-modules (srfi srfi-1)
|
|
|
|
|
(srfi srfi-26)
|
|
|
|
|
(guix build utils))
|
|
|
|
|
|
|
|
|
|
(setvbuf (current-output-port) _IOLBF)
|
|
|
|
|
(let* ((out (assoc-ref %outputs "out"))
|
|
|
|
|
(bindir (string-append out "/bin"))
|
|
|
|
|
(libdir (string-append out "/lib"))
|
2013-11-02 14:17:08 +00:00
|
|
|
|
(includedir (string-append out "/include"))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(libexecdir (string-append out "/libexec"))
|
|
|
|
|
(gcc (assoc-ref %build-inputs "gcc")))
|
|
|
|
|
(copy-recursively (string-append gcc "/bin") bindir)
|
|
|
|
|
(for-each remove-store-references
|
|
|
|
|
(find-files bindir ".*"))
|
|
|
|
|
|
|
|
|
|
(copy-recursively (string-append gcc "/lib") libdir)
|
|
|
|
|
(for-each remove-store-references
|
|
|
|
|
(remove (cut string-suffix? ".h" <>)
|
|
|
|
|
(find-files libdir ".*")))
|
|
|
|
|
|
|
|
|
|
(copy-recursively (string-append gcc "/libexec")
|
|
|
|
|
libexecdir)
|
|
|
|
|
(for-each remove-store-references
|
|
|
|
|
(find-files libexecdir ".*"))
|
2013-11-02 14:17:08 +00:00
|
|
|
|
|
|
|
|
|
;; Starting from GCC 4.8, helper programs built natively
|
|
|
|
|
;; (‘genchecksum’, ‘gcc-nm’, etc.) rely on C++ headers.
|
|
|
|
|
(copy-recursively (string-append gcc "/include/c++")
|
|
|
|
|
(string-append includedir "/c++"))
|
2014-06-14 13:58:23 +00:00
|
|
|
|
|
|
|
|
|
;; For native builds, check whether the binaries actually work.
|
|
|
|
|
,(if (%current-target-system)
|
|
|
|
|
'#t
|
|
|
|
|
'(every (lambda (prog)
|
|
|
|
|
(zero? (system* (string-append gcc "/bin/" prog)
|
|
|
|
|
"--version")))
|
|
|
|
|
'("gcc" "g++" "cpp")))))))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(inputs `(("gcc" ,%gcc-static)))))
|
|
|
|
|
|
|
|
|
|
(define %guile-static
|
|
|
|
|
;; A statically-linked Guile that is relocatable--i.e., it can search
|
|
|
|
|
;; .scm and .go files relative to its installation directory, rather
|
|
|
|
|
;; than in hard-coded configure-time paths.
|
2013-10-15 21:42:58 +00:00
|
|
|
|
(let* ((patches (cons* (search-patch "guile-relocatable.patch")
|
|
|
|
|
(search-patch "guile-default-utf8.patch")
|
|
|
|
|
(search-patch "guile-linux-syscalls.patch")
|
|
|
|
|
(origin-patches (package-source guile-2.0))))
|
|
|
|
|
(source (origin (inherit (package-source guile-2.0))
|
|
|
|
|
(patches patches)))
|
gnu: Use the 'patches' field of <origin>.
* gnu/packages/apr.scm,
gnu/packages/autotools.scm,
gnu/packages/avahi.scm,
gnu/packages/cdrom.scm,
gnu/packages/cmake.scm,
gnu/packages/cpio.scm,
gnu/packages/cross-base.scm,
gnu/packages/emacs.scm,
gnu/packages/flex.scm,
gnu/packages/fontutils.scm,
gnu/packages/glib.scm,
gnu/packages/grub.scm,
gnu/packages/guile.scm,
gnu/packages/idutils.scm,
gnu/packages/libevent.scm,
gnu/packages/linux.scm,
gnu/packages/mail.scm,
gnu/packages/make-bootstrap.scm,
gnu/packages/mp3.scm,
gnu/packages/oggvorbis.scm,
gnu/packages/pdf.scm,
gnu/packages/plotutils.scm,
gnu/packages/qemu.scm,
gnu/packages/recutils.scm,
gnu/packages/rush.scm,
gnu/packages/scheme.scm,
gnu/packages/system.scm,
gnu/packages/tcsh.scm,
gnu/packages/valgrind.scm,
gnu/packages/vpn.scm,
gnu/packages/w3m: Use the 'patches' field of <origin> instead of
adding a patch as input plus using #:patches.
2013-10-08 22:09:04 +00:00
|
|
|
|
(guile (package (inherit guile-2.0)
|
2013-06-25 21:39:14 +00:00
|
|
|
|
(name (string-append (package-name guile-2.0) "-static"))
|
2013-10-15 21:42:58 +00:00
|
|
|
|
(source source)
|
2013-08-21 09:44:16 +00:00
|
|
|
|
(synopsis "Statically-linked and relocatable Guile")
|
2013-11-03 21:35:17 +00:00
|
|
|
|
|
|
|
|
|
;; Remove the 'debug' output (see above for the reason.)
|
|
|
|
|
(outputs (delete "debug" (package-outputs guile-2.0)))
|
|
|
|
|
|
2013-06-25 21:39:14 +00:00
|
|
|
|
(propagated-inputs
|
|
|
|
|
`(("bdw-gc" ,libgc)
|
|
|
|
|
,@(alist-delete "bdw-gc"
|
|
|
|
|
(package-propagated-inputs guile-2.0))))
|
|
|
|
|
(arguments
|
|
|
|
|
`(;; When `configure' checks for ltdl availability, it
|
|
|
|
|
;; doesn't try to link using libtool, and thus fails
|
|
|
|
|
;; because of a missing -ldl. Work around that.
|
2013-12-17 19:33:26 +00:00
|
|
|
|
#:configure-flags '("LDFLAGS=-ldl")
|
2013-06-25 21:39:14 +00:00
|
|
|
|
|
|
|
|
|
#:phases (alist-cons-before
|
|
|
|
|
'configure 'static-guile
|
|
|
|
|
(lambda _
|
|
|
|
|
(substitute* "libguile/Makefile.in"
|
|
|
|
|
;; Create a statically-linked `guile'
|
|
|
|
|
;; executable.
|
|
|
|
|
(("^guile_LDFLAGS =")
|
|
|
|
|
"guile_LDFLAGS = -all-static")
|
|
|
|
|
|
|
|
|
|
;; Add `-ldl' *after* libguile-2.0.la.
|
|
|
|
|
(("^guile_LDADD =(.*)$" _ ldadd)
|
|
|
|
|
(string-append "guile_LDADD = "
|
|
|
|
|
(string-trim-right ldadd)
|
|
|
|
|
" -ldl\n"))))
|
|
|
|
|
%standard-phases)
|
|
|
|
|
|
|
|
|
|
;; There are uses of `dynamic-link' in
|
|
|
|
|
;; {foreign,coverage}.test that don't fly here.
|
|
|
|
|
#:tests? #f)))))
|
2013-06-14 13:29:08 +00:00
|
|
|
|
(package-with-relocatable-glibc (static-package guile))))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
|
|
|
|
|
(define %guile-static-stripped
|
|
|
|
|
;; A stripped static Guile binary, for use during bootstrap.
|
|
|
|
|
(package (inherit %guile-static)
|
|
|
|
|
(name "guile-static-stripped")
|
|
|
|
|
(build-system trivial-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
|
#:builder
|
|
|
|
|
(let ()
|
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
|
|
2013-08-21 09:38:51 +00:00
|
|
|
|
(let* ((in (assoc-ref %build-inputs "guile"))
|
|
|
|
|
(out (assoc-ref %outputs "out"))
|
|
|
|
|
(guile1 (string-append in "/bin/guile"))
|
|
|
|
|
(guile2 (string-append out "/bin/guile")))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(mkdir-p (string-append out "/share/guile/2.0"))
|
|
|
|
|
(copy-recursively (string-append in "/share/guile/2.0")
|
|
|
|
|
(string-append out "/share/guile/2.0"))
|
|
|
|
|
|
|
|
|
|
(mkdir-p (string-append out "/lib/guile/2.0/ccache"))
|
|
|
|
|
(copy-recursively (string-append in "/lib/guile/2.0/ccache")
|
|
|
|
|
(string-append out "/lib/guile/2.0/ccache"))
|
|
|
|
|
|
|
|
|
|
(mkdir (string-append out "/bin"))
|
2013-08-21 09:38:51 +00:00
|
|
|
|
(copy-file guile1 guile2)
|
|
|
|
|
|
|
|
|
|
;; Does the relocated Guile work?
|
|
|
|
|
(and ,(if (%current-target-system)
|
|
|
|
|
#t
|
|
|
|
|
'(zero? (system* guile2 "--version")))
|
|
|
|
|
(begin
|
|
|
|
|
;; Strip store references.
|
|
|
|
|
(remove-store-references guile2)
|
|
|
|
|
|
|
|
|
|
;; Does the stripped Guile work? If it aborts, it could be
|
|
|
|
|
;; that it tries to open iconv descriptors and fails because
|
|
|
|
|
;; libc's iconv data isn't available (see
|
|
|
|
|
;; `guile-default-utf8.patch'.)
|
|
|
|
|
,(if (%current-target-system)
|
|
|
|
|
#t
|
|
|
|
|
'(zero? (system* guile2 "--version")))))))))
|
2013-07-05 12:39:47 +00:00
|
|
|
|
(inputs `(("guile" ,%guile-static)))
|
2013-08-21 09:44:16 +00:00
|
|
|
|
(outputs '("out"))
|
|
|
|
|
(synopsis "Minimal statically-linked and relocatable Guile")))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
|
|
|
|
|
(define (tarball-package pkg)
|
|
|
|
|
"Return a package containing a tarball of PKG."
|
|
|
|
|
(package (inherit pkg)
|
|
|
|
|
(location (source-properties->location (current-source-location)))
|
|
|
|
|
(name (string-append (package-name pkg) "-tarball"))
|
|
|
|
|
(build-system trivial-build-system)
|
2013-06-25 21:39:14 +00:00
|
|
|
|
(native-inputs `(("tar" ,tar)
|
|
|
|
|
("xz" ,xz)))
|
|
|
|
|
(inputs `(("input" ,pkg)))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
(arguments
|
packages: Mark the `arguments' field of <package> as thunked.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
(package-derivation): Adjust accordingly. Parameterize
%CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
`package-arguments' to always return a list, and return a list.
(package-with-extra-configure-variable): Likewise.
(static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
from a lambda to a list, and use (%current-system) as needed.
(nix-system->gnu-triplet, boot-triplet): Have the first argument
default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
default to (%current-system).
(%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
expect `package-arguments' to return a list.
(%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
2013-01-23 22:21:59 +00:00
|
|
|
|
(let ((name (package-name pkg))
|
|
|
|
|
(version (package-version pkg)))
|
|
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
|
#:builder
|
|
|
|
|
(begin
|
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
|
(let ((out (assoc-ref %outputs "out"))
|
|
|
|
|
(input (assoc-ref %build-inputs "input"))
|
|
|
|
|
(tar (assoc-ref %build-inputs "tar"))
|
|
|
|
|
(xz (assoc-ref %build-inputs "xz")))
|
|
|
|
|
(mkdir out)
|
|
|
|
|
(set-path-environment-variable "PATH" '("bin") (list tar xz))
|
|
|
|
|
(with-directory-excursion input
|
|
|
|
|
(zero? (system* "tar" "cJvf"
|
|
|
|
|
(string-append out "/"
|
|
|
|
|
,name "-" ,version
|
2013-06-25 21:39:14 +00:00
|
|
|
|
"-"
|
|
|
|
|
,(or (%current-target-system)
|
|
|
|
|
(%current-system))
|
packages: Mark the `arguments' field of <package> as thunked.
* guix/packages.scm (<package>): Mark `arguments' as thunked.
(package-derivation): Adjust accordingly. Parameterize
%CURRENT-SYSTEM to SYSTEM, so that arguments can refer to it.
* guix/build-system/gnu.scm (package-with-explicit-inputs): Expect
`package-arguments' to always return a list, and return a list.
(package-with-extra-configure-variable): Likewise.
(static-package): Likewise.
* gnu/packages/base.scm (patch, findutils, gcc-4.7, binutils-boot0,
gcc-boot0, glibc-final-with-bootstrap-bash, cross-gcc-wrapper,
static-bash-for-glibc, binutils-final, gcc-final): Change `arguments'
from a lambda to a list, and use (%current-system) as needed.
(nix-system->gnu-triplet, boot-triplet): Have the first argument
default to (%current-system).
* gnu/packages/bootstrap.scm (glibc-dynamic-linker): Have `system'
default to (%current-system).
(%bootstrap-gcc): Change `arguments' to a list.
* gnu/packages/gawk.scm (gawk): Likewise.
* gnu/packages/m4.scm (m4): Likewise.
* gnu/packages/make-bootstrap.scm (%glibc-for-bootstrap): Likewise, and
expect `package-arguments' to return a list.
(%static-inputs, %gcc-static, tarball-package): Likewise.
* gnu/packages/ncurses.scm (ncurses): Likewise.
2013-01-23 22:21:59 +00:00
|
|
|
|
".tar.xz")
|
|
|
|
|
"."))))))))))
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
|
|
|
|
|
(define %bootstrap-binaries-tarball
|
|
|
|
|
;; A tarball with the statically-linked bootstrap binaries.
|
|
|
|
|
(tarball-package %static-binaries))
|
|
|
|
|
|
|
|
|
|
(define %binutils-bootstrap-tarball
|
|
|
|
|
;; A tarball with the statically-linked Binutils programs.
|
|
|
|
|
(tarball-package %binutils-static-stripped))
|
|
|
|
|
|
|
|
|
|
(define %glibc-bootstrap-tarball
|
|
|
|
|
;; A tarball with GNU libc's shared libraries, dynamic linker, and headers.
|
|
|
|
|
(tarball-package %glibc-stripped))
|
|
|
|
|
|
|
|
|
|
(define %gcc-bootstrap-tarball
|
|
|
|
|
;; A tarball with a dynamic-linked GCC and its headers.
|
|
|
|
|
(tarball-package %gcc-stripped))
|
|
|
|
|
|
|
|
|
|
(define %guile-bootstrap-tarball
|
|
|
|
|
;; A tarball with the statically-linked, relocatable Guile.
|
|
|
|
|
(tarball-package %guile-static-stripped))
|
|
|
|
|
|
2013-01-05 14:46:08 +00:00
|
|
|
|
(define %bootstrap-tarballs
|
|
|
|
|
;; A single derivation containing all the bootstrap tarballs, for
|
|
|
|
|
;; convenience.
|
|
|
|
|
(package
|
|
|
|
|
(name "bootstrap-tarballs")
|
|
|
|
|
(version "0")
|
|
|
|
|
(source #f)
|
|
|
|
|
(build-system trivial-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
|
#:builder
|
|
|
|
|
(let ((out (assoc-ref %outputs "out")))
|
|
|
|
|
(use-modules (guix build utils)
|
|
|
|
|
(ice-9 match)
|
|
|
|
|
(srfi srfi-26))
|
|
|
|
|
|
|
|
|
|
(setvbuf (current-output-port) _IOLBF)
|
|
|
|
|
(mkdir out)
|
|
|
|
|
(chdir out)
|
|
|
|
|
(for-each (match-lambda
|
|
|
|
|
((name . directory)
|
|
|
|
|
(for-each (lambda (file)
|
|
|
|
|
(format #t "~a -> ~a~%" file out)
|
|
|
|
|
(symlink file (basename file)))
|
|
|
|
|
(find-files directory "\\.tar\\."))))
|
|
|
|
|
%build-inputs)
|
|
|
|
|
#t)))
|
|
|
|
|
(inputs `(("guile-tarball" ,%guile-bootstrap-tarball)
|
|
|
|
|
("gcc-tarball" ,%gcc-bootstrap-tarball)
|
|
|
|
|
("binutils-tarball" ,%binutils-bootstrap-tarball)
|
|
|
|
|
("glibc-tarball" ,%glibc-bootstrap-tarball)
|
|
|
|
|
("coreutils&co-tarball" ,%bootstrap-binaries-tarball)))
|
|
|
|
|
(synopsis #f)
|
|
|
|
|
(description #f)
|
|
|
|
|
(home-page #f)
|
|
|
|
|
(license gpl3+)))
|
|
|
|
|
|
distro: Move bootstrap tarball packages to (distro packages make-bootstrap).
* distro/packages/base.scm (binutils-final): Make public.
(static-package, %bash-static, %static-inputs, %static-binaries,
%binutils-static, %binutils-static-stripped, %glibc-stripped,
%gcc-static, %gcc-stripped, %guile-static, %guile-static-stripped,
tarball-package, %bootstrap-binaries-tarball,
%binutils-bootstrap-tarball, %glibc-bootstrap-tarball,
%guile-bootstrap-tarball): Move to...
* distro/packages/make-bootstrap.scm: ... here. New file.
* Makefile.am (MODULES): Add it.
2012-11-06 21:55:44 +00:00
|
|
|
|
;;; make-bootstrap.scm ends here
|