Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / build-aux / hydra / guix.scm
index 57041d6..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) "/../..")))
@@ -44,7 +47,9 @@
              (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))
     (home-page . ,(package-home-page package))
     (maintainers . ("bug-guix@gnu.org"))))
 
-(define (tarball-package checkout nix-checkout)
+(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 'set-nix-submodule
-                      (lambda _
-                        ;; Tell Git to use the Nix checkout that Hydra gave us.
-                        (zero?
-                         (system* "git" "config" "submodule.nix-upstream.url"
-                                  ,nix-checkout)))
-                      ,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."
@@ -101,13 +109,9 @@ containing a Git checkout of Guix."
   (define guix-checkout
     (assq-ref arguments 'guix))
 
-  (define nix-checkout
-    (assq-ref arguments 'nix))
-
-  (format (current-error-port) "using checkout ~s (Nix: ~s)~%"
-          guix-checkout nix-checkout)
-  (let ((guix (assq-ref guix-checkout 'file-name))
-        (nix  (assq-ref nix-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 guix nix)
+                        (tarball-package guix)
                         (%current-system))))))