1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 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 build jobs of Guix itself for the Hydra continuation
24 ;; Attempt to use our very own Guix modules.
25 (eval-when (compile load eval)
27 ;; Ignore any available .go, and force recompilation. This is because our
28 ;; checkout in the store has mtime set to the epoch, and thus .go files look
29 ;; newer, even though they may not correspond.
30 (set! %fresh-auto-compile #t)
32 ;; Display which files are loaded.
33 (set! %load-verbosely #t)
35 (and=> (assoc-ref (current-source-location) 'filename)
37 (let ((dir (string-append (dirname file) "/../..")))
38 (format (current-error-port) "prepending ~s to the load path~%"
40 (set! %load-path (cons dir %load-path))))))
43 (use-modules (guix store)
47 (guix build-system gnu)
48 (gnu packages version-control)
49 (gnu packages package-management)
50 (gnu packages graphviz)
55 ;; XXX: Debugging hack: since `hydra-eval-guile-jobs' redirects the output
56 ;; port to the bit bucket, let us write to the error port instead.
57 (setvbuf (current-error-port) _IOLBF)
58 (set-current-output-port (current-error-port))
60 (define* (package->alist store package system
61 #:optional (package-derivation package-derivation))
62 "Convert PACKAGE to an alist suitable for Hydra."
63 `((derivation . ,(derivation-file-name
64 (package-derivation store package system)))
65 (description . ,(package-synopsis package))
66 (long-description . ,(package-description package))
67 (license . ,(package-license package))
68 (home-page . ,(package-home-page package))
69 (maintainers . ("bug-guix@gnu.org"))))
71 (define (tarball-package checkout)
72 "Return a package that does `make distcheck' from CHECKOUT, a directory
73 containing a Git checkout of Guix."
74 (dist-package guix checkout))
76 (define (hydra-jobs store arguments)
79 (match (filter-map (match-lambda
87 (list (%current-system)))))
90 (assq-ref arguments 'guix))
92 (let ((guix (assq-ref guix-checkout 'file-name)))
93 (format (current-error-port) "using checkout ~s (~s)~%"
95 `((tarball . ,(cute package->alist store
96 (tarball-package guix)
97 (%current-system))))))