build-system/gnu: Add 'bootstrap' phase.
[jackhill/guix/guix.git] / gnu / packages / ci.scm
CommitLineData
0061079a
EB
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
365de1e7 3;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
04927b6f 4;;; Copyright © 2016, 2017 Mathieu Lirzin <mthl@gnu.org>
7a9ca44a 5;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
a6d05444 6;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
0061079a
EB
7;;;
8;;; This file is part of GNU Guix.
9;;;
10;;; GNU Guix is free software; you can redistribute it and/or modify it
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
15;;; GNU Guix is distributed in the hope that it will be useful, but
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22
23(define-module (gnu packages ci)
24 #:use-module ((guix licenses) #:prefix l:)
25 #:use-module (gnu packages)
26 #:use-module (guix packages)
27 #:use-module (guix git-download)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages base)
30 #:use-module (gnu packages docbook)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages databases)
33 #:use-module (gnu packages guile)
34 #:use-module (gnu packages mail)
0061079a
EB
35 #:use-module (gnu packages package-management)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages pkg-config)
cc2b77df 38 #:use-module (gnu packages tls)
44ccd962 39 #:use-module (gnu packages texinfo)
0061079a
EB
40 #:use-module (gnu packages version-control)
41 #:use-module (gnu packages web)
42 #:use-module (gnu packages xml)
0061079a
EB
43 #:use-module (guix build-system gnu))
44
45(define-public hydra
253745d7 46 (let ((commit "1ff48da3d3d4a425063f5b7dd0b89d35270f8932"))
0061079a
EB
47 (package
48 (name "hydra")
253745d7 49 (version (string-append "20151030." (string-take commit 7)))
0061079a
EB
50 (source (origin
51 (method git-fetch)
52 (uri (git-reference
53 (url "https://github.com/NixOS/hydra")
54 (commit commit)))
55 (file-name (string-append name "-" version))
fc1adab1 56 (patches (search-patches
fc1adab1 57 ;; TODO: Remove once we have a darcs input
253745d7
JN
58 "hydra-disable-darcs-test.patch"))
59 (sha256
60 (base32
61 "0ni8i8v1nxxfr51rz8m6znwpbm77vr7i05k506hmgmg32r938lap"))))
0061079a
EB
62 (build-system gnu-build-system)
63 (native-inputs
64 `(("unzip" ,unzip)
65 ("pkg-config" ,pkg-config)
66 ;; For documentation
67 ("dblatex" ,dblatex)
68 ("xsltproc" ,libxslt)
69 ("docbook-xsl" ,docbook-xsl)
70 ;; For bootstrap
71 ("autoconf" ,autoconf)
72 ("automake" ,automake)
73 ("libtool" ,libtool)
74 ;; For tests
75 ("git" ,git)
76 ("subversion" ,subversion)
77 ("mercurial" ,mercurial)
78 ("bazaar" ,bazaar)))
79 (inputs
253745d7
JN
80 `(("libpqxx" ,libpqxx)
81 ("perl" ,perl)
0061079a
EB
82 ("guile" ,guile-2.0)
83 ("openssl" ,openssl)
84 ("bzip2" ,bzip2)
85 ("gzip" ,gzip)
86 ("sed" ,sed)
87 ("starman" ,starman)
88 ("git" ,git)
89 ("subversion" ,subversion)
90 ("mercurial" ,mercurial)
91 ("bazaar" ,bazaar)
92 ("nix" ,nix)
93 ;; Lots o' perl modules...
94 ("perl-catalyst-action-rest" ,perl-catalyst-action-rest)
95 ("perl-catalyst-authentication-store-dbix-class"
96 ,perl-catalyst-authentication-store-dbix-class)
97 ("perl-catalyst-devel" ,perl-catalyst-devel)
98 ("perl-catalyst-dispatchtype-regex" ,perl-catalyst-dispatchtype-regex)
99 ("perl-catalyst-plugin-accesslog" ,perl-catalyst-plugin-accesslog)
100 ("perl-catalyst-plugin-authorization-roles"
101 ,perl-catalyst-plugin-authorization-roles)
102 ("perl-catalyst-plugin-captcha" ,perl-catalyst-plugin-captcha)
103 ("perl-catalyst-plugin-session-state-cookie"
104 ,perl-catalyst-plugin-session-state-cookie)
105 ("perl-catalyst-plugin-session-store-fastmmap"
106 ,perl-catalyst-plugin-session-store-fastmmap)
107 ("perl-catalyst-plugin-stacktrace" ,perl-catalyst-plugin-stacktrace)
108 ("perl-catalyst-traitfor-request-proxybase"
109 ,perl-catalyst-traitfor-request-proxybase)
110 ("perl-catalyst-view-download" ,perl-catalyst-view-download)
111 ("perl-catalyst-view-json" ,perl-catalyst-view-json)
112 ("perl-catalyst-view-tt" ,perl-catalyst-view-tt)
113 ("perl-catalystx-roleapplicator" ,perl-catalystx-roleapplicator)
114 ("perl-catalystx-script-server-starman"
115 ,perl-catalystx-script-server-starman)
116 ("perl-crypt-randpasswd" ,perl-crypt-randpasswd)
117 ("perl-data-dump" ,perl-data-dump)
118 ("perl-datetime" ,perl-datetime)
119 ("perl-dbd-pg" ,perl-dbd-pg)
120 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
121 ("perl-digest-sha1" ,perl-digest-sha1)
122 ("perl-email-mime" ,perl-email-mime)
123 ("perl-email-sender" ,perl-email-sender)
124 ("perl-file-slurp" ,perl-file-slurp)
125 ("perl-io-compress" ,perl-io-compress)
126 ("perl-ipc-run" ,perl-ipc-run)
127 ("perl-json-any" ,perl-json-any)
128 ("perl-json-xs" ,perl-json-xs)
129 ("perl-libwww" ,perl-libwww)
130 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
131 ("perl-net-amazon-s3" ,perl-net-amazon-s3)
253745d7 132 ("perl-net-statsd" ,perl-net-statsd)
0061079a
EB
133 ("perl-padwalker" ,perl-padwalker)
134 ("perl-readonly" ,perl-readonly)
135 ("perl-set-scalar" ,perl-set-scalar)
136 ("perl-sql-splitstatement" ,perl-sql-splitstatement)
137 ("perl-sys-hostname-long" ,perl-sys-hostname-long)
138 ("perl-text-diff" ,perl-text-diff)
139 ("perl-text-table" ,perl-text-table)
140 ("perl-xml-simple" ,perl-xml-simple)))
141 (arguments
142 `(#:configure-flags
143 (let ((docbook (assoc-ref %build-inputs "docbook-xsl")))
144 (list (string-append "--with-docbook-xsl="
145 docbook "/xml/xsl/docbook-xsl-"
146 ,(package-version docbook-xsl))
147 (string-append "--docdir=" %output
148 "/doc/hydra-" ,version)))
149 #:phases (modify-phases %standard-phases
0061079a
EB
150 (add-before
151 'check 'check-setup
152 (lambda _ (setenv "LOGNAME" "test.log")))
153 (add-after
154 'install 'wrap-program
155 (lambda* (#:key inputs outputs #:allow-other-keys)
156 (let ((out (assoc-ref outputs "out")))
157 (for-each
158 (lambda (file)
159 (wrap-program file
160 `("PATH" ":" prefix
161 (,(string-append out "/bin")
162 ,@(map (lambda (i)
163 (string-append (assoc-ref inputs i)
164 "/bin"))
165 '("subversion" "git" "bazaar"
166 "mercurial" "coreutils" "gzip"
167 "sed" "unzip" "nix"))))
168 `("PERL5LIB" ":" prefix
169 (,(string-append out "/libexec/hydra/lib")
170 ,@(search-path-as-string->list
171 (getenv "PERL5LIB"))))
172 `("HYDRA_RELEASE" = (,,version))
173 `("HYDRA_HOME" =
174 (,(string-append out "/libexec/hydra")))
175 `("NIX_RELEASE" = (,,(package-version nix)))))
176 (find-files (string-append out "/bin")
177 ".*"))))))))
178 (home-page "https://nixos.org/hydra")
179 (synopsis "Continuous build system")
180 (description
181 "Hydra is a tool for continuous integration testing and software
182release that uses a purely functional language to describe build jobs and
183their dependencies.")
184 (license l:gpl3+))))
365de1e7
ML
185
186(define-public cuirass
2b870303
LC
187 (let ((commit "4ab2f2c3f084ffd9d0f77134cc1af0f8cf0e13be")
188 (revision "12"))
365de1e7
ML
189 (package
190 (name "cuirass")
191 (version (string-append "0.0.1-" revision "." (string-take commit 7)))
192 (source (origin
193 (method git-fetch)
194 (uri (git-reference
0d43b12d 195 (url "https://git.savannah.gnu.org/git/guix/guix-cuirass.git")
365de1e7
ML
196 (commit commit)))
197 (file-name (string-append name "-" version))
198 (sha256
199 (base32
2b870303 200 "1r97z5lkzg6vx014rfmv1pp3x3bl1shb6wkcgnlncwqf56a9bzi1"))))
365de1e7
ML
201 (build-system gnu-build-system)
202 (arguments
0d43b12d
LC
203 '(#:modules ((guix build utils)
204 (guix build gnu-build-system)
205 (ice-9 rdelim)
206 (ice-9 popen))
207
208 #:phases
365de1e7 209 (modify-phases %standard-phases
04927b6f
ML
210 (add-after 'unpack 'disable-repo-tests
211 (λ _
212 ;; Disable tests that use a connection to the Guix daemon.
213 (substitute* "Makefile.am"
214 (("tests/repo.scm \\\\") "\\"))
215 #t))
4561498e
KK
216 (add-after 'disable-repo-tests 'patch-/bin/sh
217 (lambda _
218 (substitute* "build-aux/git-version-gen"
219 (("#!/bin/sh") (string-append "#!" (which "sh"))))
220 #t))
365de1e7
ML
221 (add-after 'install 'wrap-program
222 (lambda* (#:key inputs outputs #:allow-other-keys)
223 ;; Wrap the 'cuirass' command to refer to the right modules.
224 (let* ((out (assoc-ref outputs "out"))
225 (json (assoc-ref inputs "guile-json"))
226 (sqlite (assoc-ref inputs "guile-sqlite3"))
a6d05444
RW
227 (git (assoc-ref inputs "guile-git"))
228 (bytes (assoc-ref inputs "guile-bytestructures"))
d1688e6a 229 (fibers (assoc-ref inputs "guile-fibers"))
365de1e7 230 (guix (assoc-ref inputs "guix"))
0d43b12d
LC
231 (guile (assoc-ref %build-inputs "guile"))
232 (effective (read-line
233 (open-pipe* OPEN_READ
234 (string-append guile "/bin/guile")
235 "-c" "(display (effective-version))")))
236 (mods (string-append json "/share/guile/site/"
a6d05444
RW
237 effective ":"
238 git "/share/guile/site/"
239 effective ":"
240 bytes "/share/guile/site/"
0d43b12d
LC
241 effective ":"
242 sqlite "/share/guile/site/"
243 effective ":"
d1688e6a
LC
244 fibers "/share/guile/site/"
245 effective ":"
0d43b12d
LC
246 guix "/share/guile/site/"
247 effective)))
a6d05444
RW
248 ;; Make sure 'cuirass' can find the 'evaluate' command, as
249 ;; well as the relevant Guile modules.
365de1e7 250 (wrap-program (string-append out "/bin/cuirass")
a6d05444 251 `("PATH" ":" prefix (,(string-append out "/bin")))
365de1e7 252 `("GUILE_LOAD_PATH" ":" prefix (,mods))
2eadd828
LC
253 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,mods)))
254 #t))))))
365de1e7 255 (inputs
0d43b12d 256 `(("guile" ,guile-2.2)
d1688e6a 257 ("guile-fibers" ,guile-fibers)
2252f087 258 ("guile-json" ,guile-json)
365de1e7 259 ("guile-sqlite3" ,guile-sqlite3)
a6d05444
RW
260 ("guile-git" ,guile-git)
261 ;; FIXME: this is propagated by "guile-git", but it needs to be among
262 ;; the inputs to add it to GUILE_LOAD_PATH.
263 ("guile-bytestructures" ,guile-bytestructures)
264 ("guix" ,guix)))
365de1e7
ML
265 (native-inputs
266 `(("autoconf" ,autoconf)
267 ("automake" ,automake)
44ccd962
ML
268 ("pkg-config" ,pkg-config)
269 ("texinfo" ,texinfo)))
1501cb55
LC
270 (native-search-paths
271 ;; For HTTPS access, Cuirass itself honors these variables, with the
272 ;; same semantics as Git and OpenSSL (respectively).
273 (list (search-path-specification
274 (variable "GIT_SSL_CAINFO")
275 (file-type 'regular)
276 (separator #f) ;single entry
277 (files '("etc/ssl/certs/ca-certificates.crt")))
278 (search-path-specification
279 (variable "SSL_CERT_DIR")
280 (files '("etc/ssl/certs")))))
365de1e7
ML
281 (synopsis "Continuous integration system")
282 (description
283 "Cuirass is a continuous integration tool using GNU Guix. It is
284intended as a replacement for Hydra.")
0d43b12d 285 (home-page "https://www.gnu.org/software/guix/")
365de1e7 286 (license l:gpl3+))))