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