1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016 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 imagemagick)
51 (gnu packages graphviz)
57 ;; XXX: Debugging hack: since `hydra-eval-guile-jobs' redirects the output
58 ;; port to the bit bucket, let us write to the error port instead.
59 (setvbuf (current-error-port) _IOLBF)
60 (set-current-output-port (current-error-port))
62 (define* (package->alist store package system
63 #:optional (package-derivation package-derivation))
64 "Convert PACKAGE to an alist suitable for Hydra."
65 `((derivation . ,(derivation-file-name
66 (package-derivation store package system)))
67 (description . ,(package-synopsis package))
68 (long-description . ,(package-description package))
69 (license . ,(package-license package))
70 (home-page . ,(package-home-page package))
71 (maintainers . ("bug-guix@gnu.org"))))
73 (define (tarball-package checkout)
74 "Return a package that does `make distcheck' from CHECKOUT, a directory
75 containing a Git checkout of Guix."
76 (let ((guix (@@ (gnu packages package-management) guix)))
77 (dist-package (package
79 (arguments (package-arguments guix))
80 (native-inputs `(("imagemagick" ,imagemagick)
81 ,@(package-native-inputs guix))))
85 '(modify-phases %dist-phases
86 (add-before 'build 'build-daemon
87 ;; Build 'guix-daemon' first so that help2man
88 ;; successfully creates 'guix-daemon.1'.
90 (let ((n (number->string
91 (parallel-job-count))))
92 (zero? (system* "make"
93 "nix/libstore/schema.sql.hh"
94 "guix-daemon" "-j" n)))))))))
96 (define (hydra-jobs store arguments)
99 (match (filter-map (match-lambda
107 (list (%current-system)))))
109 (define guix-checkout
110 (assq-ref arguments 'guix))
112 (let ((guix (assq-ref guix-checkout 'file-name)))
113 (format (current-error-port) "using checkout ~s (~s)~%"
115 `((tarball . ,(cute package->alist store
116 (tarball-package guix)
117 (%current-system))))))