1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
20 ;;; This file defines a continuous integration job to build the same modular
21 ;;; Guix as 'guix pull', which is defined in (guix self).
24 (use-modules (guix store)
27 ((guix packages) #:select (%hydra-supported-systems))
30 ((guix licenses) #:prefix license:)
34 ;; XXX: Debugging hack: since `hydra-eval-guile-jobs' redirects the output
35 ;; port to the bit bucket, let us write to the error port instead.
36 (setvbuf (current-error-port) _IOLBF)
37 (set-current-output-port (current-error-port))
39 (define* (build-job store source version system)
40 "Return a Hydra job a list building the modular Guix derivation from SOURCE
41 for SYSTEM. Use VERSION as the version identifier."
44 (primitive-load (string-append source "/build-aux/build-self.scm")))
46 `((derivation . ,(derivation-file-name
48 (build source #:version version #:system system
50 #:guile-version "2.2")))) ;the latest 2.2.x
51 (description . "Modular Guix")
53 . "This is the modular Guix package as produced by 'guix pull'.")
54 (license . ,license:gpl3+)
55 (home-page . ,%guix-home-page-url)
56 (maintainers . (,%guix-bug-report-address)))))
58 (define (hydra-jobs store arguments)
61 (match (assoc-ref arguments 'systems)
62 (#f %hydra-supported-systems)
64 ((? string? str) (call-with-input-string str read))))
67 (or (assq-ref arguments 'guix) ;Hydra on hydra
68 (assq-ref arguments 'guix-modular))) ;Cuirass on berlin
71 (or (assq-ref guix-checkout 'revision)
74 (let ((file (assq-ref guix-checkout 'file-name)))
75 (format (current-error-port) "using checkout ~s (~s; arguments: ~s)~%"
76 guix-checkout file arguments)
79 (let ((name (string->symbol
80 (string-append "guix." system))))
82 . ,(build-job store file version system))))