gnu: gnome-shell-extensions: Depropagate glib:bin.
[jackhill/guix/guix.git] / build-aux / check-available-binaries.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 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 ;;;
20 ;;; Check whether important binaries are available.
21 ;;;
22
23 (use-modules (guix store)
24 (guix grafts)
25 (guix packages)
26 (guix derivations)
27 (gnu packages)
28 (gnu packages certs)
29 (gnu packages emacs)
30 (gnu packages make-bootstrap)
31 (gnu packages ssh)
32 (srfi srfi-1)
33 (srfi srfi-26)
34 (ice-9 format))
35
36 (define (packages-for-system system)
37 "Return the list of packages to check for SYSTEM."
38 (let ((base (list %bootstrap-tarballs emacs nss-certs openssh)))
39 ;; On Intel systems, make sure key packages proposed by the installer are
40 ;; available.
41 (if (member system '("x86_64-linux" "i686-linux"))
42 (append (map specification->package
43 '("xfce" "gnome" "mate" "enlightenment"
44 "openbox" "awesome" "i3-wm" "ratpoison"
45 "network-manager-applet" "xlockmore"
46 "linux-libre" "grub-hybrid" "xorg-server"
47 "libreoffice"
48 ;; FIXME: Add IceCat when Rust is available on i686.
49 #;"icecat"))
50 base)
51 base)))
52
53 (with-store store
54 (parameterize ((%graft? #f))
55 (let* ((native (append-map (lambda (system)
56 (map (cut package-derivation store <> system)
57 (packages-for-system system)))
58 %hydra-supported-systems))
59 (cross (map (cut package-cross-derivation store
60 %bootstrap-tarballs <>)
61 '("mips64el-linux-gnu"
62 "arm-linux-gnueabihf")))
63 (total (append native cross)))
64
65 (set-build-options store
66 #:use-substitutes? #t
67 #:substitute-urls %default-substitute-urls)
68 (let* ((total (map derivation->output-path total))
69 (available (substitutable-paths store total))
70 (missing (lset-difference string=? total available)))
71 (if (null? missing)
72 (format (current-error-port)
73 "~a packages found substitutable on~{ ~a~}~%"
74 (length total) %hydra-supported-systems)
75 (format (current-error-port)
76 "~a packages are not substitutable:~%~{ ~a~%~}~%"
77 (length missing) missing))
78 (exit (null? missing))))))