| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; |
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 7 | ;;; under the terms of the GNU General Public License as published by |
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 9 | ;;; your option) any later version. |
| 10 | ;;; |
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | ;;; GNU General Public License for more details. |
| 15 | ;;; |
| 16 | ;;; You should have received a copy of the GNU General Public License |
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | ;;; This file returns a manifest containing release-critical bit, for all the |
| 20 | ;;; supported architectures and cross-compilation targets. |
| 21 | |
| 22 | (use-modules (gnu packages) |
| 23 | (guix packages) |
| 24 | (guix profiles) |
| 25 | ((gnu ci) #:select (%cross-targets)) |
| 26 | (srfi srfi-1) |
| 27 | (srfi srfi-26)) |
| 28 | |
| 29 | (define* (package->manifest-entry* package system |
| 30 | #:key target) |
| 31 | "Return a manifest entry for PACKAGE on SYSTEM, optionally cross-compiled to |
| 32 | TARGET." |
| 33 | (manifest-entry |
| 34 | (inherit (package->manifest-entry package)) |
| 35 | (name (string-append (package-name package) "." system |
| 36 | (if target |
| 37 | (string-append "." target) |
| 38 | "'"))) |
| 39 | (item (with-parameters ((%current-system system) |
| 40 | (%current-target-system target)) |
| 41 | package)))) |
| 42 | |
| 43 | (define %base-packages |
| 44 | ;; Packages that must be substitutable on all the platforms Guix supports. |
| 45 | (map specification->package |
| 46 | '("bootstrap-tarballs" "gcc-toolchain" "nss-certs" |
| 47 | "openssh" "emacs" "vim" "python" "guile" "guix"))) |
| 48 | |
| 49 | (define %system-packages |
| 50 | ;; Key packages proposed by the Guix System installer. |
| 51 | (map specification->package |
| 52 | '("xorg-server" "xfce" "gnome" "mate" "enlightenment" |
| 53 | "openbox" "awesome" "i3-wm" "ratpoison" |
| 54 | "xlockmore" "slock" "libreoffice" |
| 55 | "connman" "network-manager" "network-manager-applet" |
| 56 | "openssh" "ntp" "tor" |
| 57 | "linux-libre" "grub-hybrid" |
| 58 | ;; FIXME: Add IceCat when Rust is available on i686. |
| 59 | ;;"icecat" |
| 60 | ))) |
| 61 | |
| 62 | (define %packages-to-cross-build |
| 63 | ;; Packages that must be cross-buildable from x86_64-linux. |
| 64 | (cons (@ (gnu packages gcc) gcc) |
| 65 | (map specification->package |
| 66 | '("coreutils" "grep" "sed" "findutils" "diffutils" "patch" |
| 67 | "gawk" "gettext" "gzip" "xz" |
| 68 | "hello" "guile@2.2" "zlib")))) |
| 69 | |
| 70 | (define %cross-bootstrap-targets |
| 71 | ;; Cross-compilation triplets for which 'bootstrap-tarballs' must be |
| 72 | ;; buildable. |
| 73 | '("i586-pc-gnu" |
| 74 | "arm-linux-gnueabihf" |
| 75 | "aarch64-linux-gnu")) |
| 76 | |
| 77 | \f |
| 78 | ;;; |
| 79 | ;;; Manifests. |
| 80 | ;;; |
| 81 | |
| 82 | (define %base-manifest |
| 83 | (manifest |
| 84 | (append-map (lambda (system) |
| 85 | (map (cut package->manifest-entry* <> system) |
| 86 | %base-packages)) |
| 87 | %hydra-supported-systems))) |
| 88 | |
| 89 | (define %cross-manifest |
| 90 | (manifest |
| 91 | (append-map (lambda (target) |
| 92 | (map (cut package->manifest-entry* <> "x86_64-linux" |
| 93 | #:target target) |
| 94 | %packages-to-cross-build)) |
| 95 | %cross-targets))) |
| 96 | |
| 97 | (define %cross-bootstrap-manifest |
| 98 | (manifest |
| 99 | (map (lambda (target) |
| 100 | (package->manifest-entry* |
| 101 | (specification->package "bootstrap-tarballs") |
| 102 | "x86_64-linux" #:target target)) |
| 103 | %cross-bootstrap-targets))) |
| 104 | |
| 105 | ;; Return the union of all three manifests. |
| 106 | (concatenate-manifests (list %base-manifest |
| 107 | %cross-manifest |
| 108 | %cross-bootstrap-manifest)) |