1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
4 ;;; Copyright © 2016, 2017 Mathieu Lirzin <mthl@gnu.org>
5 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages ci)
23 #:use-module ((guix licenses) #:prefix l:)
24 #:use-module (gnu packages)
25 #:use-module (guix packages)
26 #:use-module (guix git-download)
27 #:use-module (gnu packages autotools)
28 #:use-module (gnu packages base)
29 #:use-module (gnu packages docbook)
30 #:use-module (gnu packages compression)
31 #:use-module (gnu packages databases)
32 #:use-module (gnu packages guile)
33 #:use-module (gnu packages mail)
34 #:use-module (gnu packages package-management)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages tls)
38 #:use-module (gnu packages texinfo)
39 #:use-module (gnu packages version-control)
40 #:use-module (gnu packages web)
41 #:use-module (gnu packages xml)
42 #:use-module (guix build-system gnu))
45 (let ((commit "1ff48da3d3d4a425063f5b7dd0b89d35270f8932"))
48 (version (string-append "20151030." (string-take commit 7)))
52 (url "https://github.com/NixOS/hydra")
54 (file-name (string-append name "-" version))
55 (patches (search-patches
56 ;; TODO: Remove once we have a darcs input
57 "hydra-disable-darcs-test.patch"))
60 "0ni8i8v1nxxfr51rz8m6znwpbm77vr7i05k506hmgmg32r938lap"))))
61 (build-system gnu-build-system)
64 ("pkg-config" ,pkg-config)
68 ("docbook-xsl" ,docbook-xsl)
70 ("autoconf" ,autoconf)
71 ("automake" ,automake)
75 ("subversion" ,subversion)
76 ("mercurial" ,mercurial)
79 `(("libpqxx" ,libpqxx)
88 ("subversion" ,subversion)
89 ("mercurial" ,mercurial)
92 ;; Lots o' perl modules...
93 ("perl-catalyst-action-rest" ,perl-catalyst-action-rest)
94 ("perl-catalyst-authentication-store-dbix-class"
95 ,perl-catalyst-authentication-store-dbix-class)
96 ("perl-catalyst-devel" ,perl-catalyst-devel)
97 ("perl-catalyst-dispatchtype-regex" ,perl-catalyst-dispatchtype-regex)
98 ("perl-catalyst-plugin-accesslog" ,perl-catalyst-plugin-accesslog)
99 ("perl-catalyst-plugin-authorization-roles"
100 ,perl-catalyst-plugin-authorization-roles)
101 ("perl-catalyst-plugin-captcha" ,perl-catalyst-plugin-captcha)
102 ("perl-catalyst-plugin-session-state-cookie"
103 ,perl-catalyst-plugin-session-state-cookie)
104 ("perl-catalyst-plugin-session-store-fastmmap"
105 ,perl-catalyst-plugin-session-store-fastmmap)
106 ("perl-catalyst-plugin-stacktrace" ,perl-catalyst-plugin-stacktrace)
107 ("perl-catalyst-traitfor-request-proxybase"
108 ,perl-catalyst-traitfor-request-proxybase)
109 ("perl-catalyst-view-download" ,perl-catalyst-view-download)
110 ("perl-catalyst-view-json" ,perl-catalyst-view-json)
111 ("perl-catalyst-view-tt" ,perl-catalyst-view-tt)
112 ("perl-catalystx-roleapplicator" ,perl-catalystx-roleapplicator)
113 ("perl-catalystx-script-server-starman"
114 ,perl-catalystx-script-server-starman)
115 ("perl-crypt-randpasswd" ,perl-crypt-randpasswd)
116 ("perl-data-dump" ,perl-data-dump)
117 ("perl-datetime" ,perl-datetime)
118 ("perl-dbd-pg" ,perl-dbd-pg)
119 ("perl-dbd-sqlite" ,perl-dbd-sqlite)
120 ("perl-digest-sha1" ,perl-digest-sha1)
121 ("perl-email-mime" ,perl-email-mime)
122 ("perl-email-sender" ,perl-email-sender)
123 ("perl-file-slurp" ,perl-file-slurp)
124 ("perl-io-compress" ,perl-io-compress)
125 ("perl-ipc-run" ,perl-ipc-run)
126 ("perl-json-any" ,perl-json-any)
127 ("perl-json-xs" ,perl-json-xs)
128 ("perl-libwww" ,perl-libwww)
129 ("perl-lwp-protocol-https" ,perl-lwp-protocol-https)
130 ("perl-net-amazon-s3" ,perl-net-amazon-s3)
131 ("perl-net-statsd" ,perl-net-statsd)
132 ("perl-padwalker" ,perl-padwalker)
133 ("perl-readonly" ,perl-readonly)
134 ("perl-set-scalar" ,perl-set-scalar)
135 ("perl-sql-splitstatement" ,perl-sql-splitstatement)
136 ("perl-sys-hostname-long" ,perl-sys-hostname-long)
137 ("perl-text-diff" ,perl-text-diff)
138 ("perl-text-table" ,perl-text-table)
139 ("perl-xml-simple" ,perl-xml-simple)))
142 (let ((docbook (assoc-ref %build-inputs "docbook-xsl")))
143 (list (string-append "--with-docbook-xsl="
144 docbook "/xml/xsl/docbook-xsl-"
145 ,(package-version docbook-xsl))
146 (string-append "--docdir=" %output
147 "/doc/hydra-" ,version)))
148 #:phases (modify-phases %standard-phases
151 (lambda _ (zero? (system* "autoreconf" "-vfi"))))
154 (lambda _ (setenv "LOGNAME" "test.log")))
156 'install 'wrap-program
157 (lambda* (#:key inputs outputs #:allow-other-keys)
158 (let ((out (assoc-ref outputs "out")))
163 (,(string-append out "/bin")
165 (string-append (assoc-ref inputs i)
167 '("subversion" "git" "bazaar"
168 "mercurial" "coreutils" "gzip"
169 "sed" "unzip" "nix"))))
170 `("PERL5LIB" ":" prefix
171 (,(string-append out "/libexec/hydra/lib")
172 ,@(search-path-as-string->list
173 (getenv "PERL5LIB"))))
174 `("HYDRA_RELEASE" = (,,version))
176 (,(string-append out "/libexec/hydra")))
177 `("NIX_RELEASE" = (,,(package-version nix)))))
178 (find-files (string-append out "/bin")
180 (home-page "https://nixos.org/hydra")
181 (synopsis "Continuous build system")
183 "Hydra is a tool for continuous integration testing and software
184 release that uses a purely functional language to describe build jobs and
185 their dependencies.")
188 (define-public cuirass
189 (let ((commit "870e8d6ad3415ac61c52e57095fcc6164023a0fc")
193 (version (string-append "0.0.1-" revision "." (string-take commit 7)))
197 (url "https://git.savannah.gnu.org/git/guix/guix-cuirass.git")
199 (file-name (string-append name "-" version))
202 "0lp5a5p42k7lml15lbmmd7az9i0gw5kips3sh3awd2z79h0w2knw"))))
203 (build-system gnu-build-system)
205 '(#:modules ((guix build utils)
206 (guix build gnu-build-system)
211 (modify-phases %standard-phases
212 (add-after 'unpack 'disable-repo-tests
214 ;; Disable tests that use a connection to the Guix daemon.
215 (substitute* "Makefile.am"
216 (("tests/repo.scm \\\\") "\\"))
218 (add-before 'configure 'bootstrap
219 (lambda _ (zero? (system* "sh" "bootstrap"))))
220 (add-after 'install 'wrap-program
221 (lambda* (#:key inputs outputs #:allow-other-keys)
222 ;; Wrap the 'cuirass' command to refer to the right modules.
223 (let* ((out (assoc-ref outputs "out"))
224 (json (assoc-ref inputs "guile-json"))
225 (sqlite (assoc-ref inputs "guile-sqlite3"))
226 (git (assoc-ref inputs "git"))
227 (guix (assoc-ref inputs "guix"))
228 (guile (assoc-ref %build-inputs "guile"))
229 (effective (read-line
230 (open-pipe* OPEN_READ
231 (string-append guile "/bin/guile")
232 "-c" "(display (effective-version))")))
233 (mods (string-append json "/share/guile/site/"
235 sqlite "/share/guile/site/"
237 guix "/share/guile/site/"
239 ;; Make sure 'cuirass' can find the 'git' and 'evaluate'
240 ;; commands, as well as the relevant Guile modules.
241 (wrap-program (string-append out "/bin/cuirass")
242 `("PATH" ":" prefix (,(string-append out "/bin")
243 ,(string-append git "/bin")))
244 `("GUILE_LOAD_PATH" ":" prefix (,mods))
245 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,mods)))
248 `(("guile" ,guile-2.2)
249 ("guile-json" ,guile-json)
250 ("guile-sqlite3" ,guile-sqlite3)
254 `(("autoconf" ,autoconf)
255 ("automake" ,automake)
256 ("pkg-config" ,pkg-config)
257 ("texinfo" ,texinfo)))
258 (synopsis "Continuous integration system")
260 "Cuirass is a continuous integration tool using GNU Guix. It is
261 intended as a replacement for Hydra.")
262 (home-page "https://www.gnu.org/software/guix/")