| 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018 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 emacs) |
| 28 | (gnu packages make-bootstrap) |
| 29 | (srfi srfi-1) |
| 30 | (srfi srfi-26) |
| 31 | (ice-9 format)) |
| 32 | |
| 33 | (with-store store |
| 34 | (parameterize ((%graft? #f)) |
| 35 | (let* ((native (append-map (lambda (system) |
| 36 | (map (cut package-derivation store <> system) |
| 37 | (list %bootstrap-tarballs emacs))) |
| 38 | %hydra-supported-systems)) |
| 39 | (cross (map (cut package-cross-derivation store |
| 40 | %bootstrap-tarballs <>) |
| 41 | '("mips64el-linux-gnu" |
| 42 | "arm-linux-gnueabihf"))) |
| 43 | (total (append native cross))) |
| 44 | |
| 45 | (set-build-options store |
| 46 | #:use-substitutes? #t |
| 47 | #:substitute-urls %default-substitute-urls) |
| 48 | (let* ((total (map derivation->output-path total)) |
| 49 | (available (substitutable-paths store total)) |
| 50 | (missing (lset-difference string=? total available))) |
| 51 | (if (null? missing) |
| 52 | (format (current-error-port) |
| 53 | "~a packages found substitutable on~{ ~a~}~%" |
| 54 | (length total) %hydra-supported-systems) |
| 55 | (format (current-error-port) |
| 56 | "~a packages are not substitutable:~%~{ ~a~%~}~%" |
| 57 | (length missing) missing)) |
| 58 | (exit (null? missing)))))) |