| 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 | ((gnu services xorg) #:select (%default-xorg-modules)) |
| 27 | (guix utils) |
| 28 | (srfi srfi-1) |
| 29 | (srfi srfi-26)) |
| 30 | |
| 31 | (define* (package->manifest-entry* package system |
| 32 | #:key target) |
| 33 | "Return a manifest entry for PACKAGE on SYSTEM, optionally cross-compiled to |
| 34 | TARGET." |
| 35 | (manifest-entry |
| 36 | (inherit (package->manifest-entry package)) |
| 37 | (name (string-append (package-name package) "." system |
| 38 | (if target |
| 39 | (string-append "." target) |
| 40 | "'"))) |
| 41 | (item (with-parameters ((%current-system system) |
| 42 | (%current-target-system target)) |
| 43 | package)))) |
| 44 | |
| 45 | (define %base-packages |
| 46 | ;; Packages that must be substitutable on all the platforms Guix supports. |
| 47 | (map specification->package |
| 48 | '("bootstrap-tarballs" "gcc-toolchain" "nss-certs" |
| 49 | "openssh" "emacs" "vim" "python" "guile" "guix"))) |
| 50 | |
| 51 | (define %system-packages |
| 52 | ;; Key packages proposed by the Guix System installer. |
| 53 | (append (map specification->package |
| 54 | '("xorg-server" "xfce" "gnome" "mate" "enlightenment" |
| 55 | "openbox" "awesome" "i3-wm" "ratpoison" |
| 56 | "xlockmore" "slock" "libreoffice" |
| 57 | "connman" "network-manager" "network-manager-applet" |
| 58 | "openssh" "ntp" "tor" |
| 59 | "linux-libre" "grub-hybrid" |
| 60 | ;; FIXME: Add IceCat when Rust is available on i686. |
| 61 | ;;"icecat" |
| 62 | )) |
| 63 | %default-xorg-modules)) |
| 64 | |
| 65 | (define %packages-to-cross-build |
| 66 | ;; Packages that must be cross-buildable from x86_64-linux. |
| 67 | ;; FIXME: Add (@ (gnu packages gcc) gcc) when <https://bugs.gnu.org/40463> |
| 68 | ;; is fixed. |
| 69 | (append (list (@ (gnu packages guile) guile-3.0/fixed)) |
| 70 | (map specification->package |
| 71 | '("coreutils" "grep" "sed" "findutils" "diffutils" "patch" |
| 72 | "gawk" "gettext" "gzip" "xz" |
| 73 | "hello" "zlib")))) |
| 74 | |
| 75 | (define %packages-to-cross-build-for-mingw |
| 76 | ;; Many things don't build for MinGW. Restrict to what's known to work. |
| 77 | (map specification->package '("hello"))) |
| 78 | |
| 79 | (define %cross-bootstrap-targets |
| 80 | ;; Cross-compilation triplets for which 'bootstrap-tarballs' must be |
| 81 | ;; buildable. |
| 82 | '("i586-pc-gnu" |
| 83 | "arm-linux-gnueabihf" |
| 84 | "aarch64-linux-gnu")) |
| 85 | |
| 86 | \f |
| 87 | ;;; |
| 88 | ;;; Manifests. |
| 89 | ;;; |
| 90 | |
| 91 | (define %base-manifest |
| 92 | (manifest |
| 93 | (append-map (lambda (system) |
| 94 | (map (cut package->manifest-entry* <> system) |
| 95 | %base-packages)) |
| 96 | %hydra-supported-systems))) |
| 97 | |
| 98 | (define %system-manifest |
| 99 | (manifest |
| 100 | (append-map (lambda (system) |
| 101 | (map (cut package->manifest-entry* <> system) |
| 102 | %system-packages)) |
| 103 | '("x86_64-linux" "i686-linux")))) ;Guix System |
| 104 | |
| 105 | (define %cross-manifest |
| 106 | (manifest |
| 107 | (append-map (lambda (target) |
| 108 | (map (cut package->manifest-entry* <> "x86_64-linux" |
| 109 | #:target target) |
| 110 | (if (target-mingw? target) |
| 111 | %packages-to-cross-build-for-mingw |
| 112 | %packages-to-cross-build))) |
| 113 | ;; XXX: Important bits like libsigsegv and libffi don't support |
| 114 | ;; RISCV at the moment, so don't require RISCV support. |
| 115 | (delete "riscv64-linux-gnu" %cross-targets)))) |
| 116 | |
| 117 | (define %cross-bootstrap-manifest |
| 118 | (manifest |
| 119 | (map (lambda (target) |
| 120 | (package->manifest-entry* |
| 121 | (specification->package "bootstrap-tarballs") |
| 122 | "x86_64-linux" #:target target)) |
| 123 | %cross-bootstrap-targets))) |
| 124 | |
| 125 | ;; Return the union of all three manifests. |
| 126 | (concatenate-manifests (list %base-manifest |
| 127 | %system-manifest |
| 128 | %cross-manifest |
| 129 | %cross-bootstrap-manifest)) |