Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / build-aux / hydra / guix.scm
index dbc935d..f496357 100644 (file)
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +29,9 @@
   ;; newer, even though they may not correspond.
   (set! %fresh-auto-compile #t)
 
+  ;; Display which files are loaded.
+  (set! %load-verbosely #t)
+
   (and=> (assoc-ref (current-source-location) 'filename)
          (lambda (file)
            (let ((dir (string-append (dirname file) "/../..")))
 (use-modules (guix store)
              (guix packages)
              (guix utils)
+             (guix derivations)
              (guix build-system gnu)
              (gnu packages version-control)
              (gnu packages package-management)
+             (gnu packages imagemagick)
              (gnu packages graphviz)
+             (gnu packages man)
              (srfi srfi-1)
              (srfi srfi-26)
              (ice-9 match))
@@ -56,7 +62,8 @@
 (define* (package->alist store package system
                          #:optional (package-derivation package-derivation))
   "Convert PACKAGE to an alist suitable for Hydra."
-  `((derivation . ,(package-derivation store package system))
+  `((derivation . ,(derivation-file-name
+                    (package-derivation store package system)))
     (description . ,(package-synopsis package))
     (long-description . ,(package-description package))
     (license . ,(package-license package))
 (define (tarball-package checkout)
   "Return a package that does `make distcheck' from CHECKOUT, a directory
 containing a Git checkout of Guix."
-  (let ((dist (dist-package guix checkout)))
-    (package (inherit dist)
-      (location (source-properties->location (current-source-location)))
-      (arguments (substitute-keyword-arguments (package-arguments dist)
-                   ((#:phases p)
-                    `(alist-cons-before
-                      'autoreconf 'patch-bootstrap-script
-                      (lambda _
-                        ;; Comment out `git' invocations, since Hydra provides
-                        ;; us with a checkout that includes sub-modules.
-                        (substitute* "bootstrap"
-                          (("git ") "true git ")))
-                      ,p))))
-      (native-inputs `(("git" ,git)
-                       ("graphviz" ,graphviz)
-                       ,@(package-native-inputs dist))))))
+  (let ((guix (@@ (gnu packages package-management) guix)))
+    (dist-package (package
+                    (inherit guix)
+                    (arguments (package-arguments guix))
+                    (native-inputs `(("imagemagick" ,imagemagick)
+                                     ,@(package-native-inputs guix))))
+                  checkout
+
+                  #:phases
+                  '(modify-phases %dist-phases
+                     (add-before 'build 'build-daemon
+                       ;; Build 'guix-daemon' first so that help2man
+                       ;; successfully creates 'guix-daemon.1'.
+                       (lambda _
+                         (let ((n (number->string
+                                   (parallel-job-count))))
+                           (zero? (system* "make"
+                                           "nix/libstore/schema.sql.hh"
+                                           "guix-daemon" "-j" n)))))))))
 
 (define (hydra-jobs store arguments)
   "Return Hydra jobs."
@@ -96,11 +106,12 @@ containing a Git checkout of Guix."
       (_
        (list (%current-system)))))
 
-  (define checkout
+  (define guix-checkout
     (assq-ref arguments 'guix))
 
-  (format (current-error-port) "using checkout ~s~%" checkout)
-  (let ((directory (assq-ref checkout 'file-name)))
+  (let ((guix (assq-ref guix-checkout 'file-name)))
+    (format (current-error-port) "using checkout ~s (~s)~%"
+            guix-checkout guix)
     `((tarball . ,(cute package->alist store
-                        (tarball-package directory)
+                        (tarball-package guix)
                         (%current-system))))))