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> |
0061079a EB |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
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. | |
13 | ;;; | |
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. | |
18 | ;;; | |
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/>. | |
21 | ||
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) | |
0061079a EB |
34 | #:use-module (gnu packages package-management) |
35 | #:use-module (gnu packages perl) | |
36 | #:use-module (gnu packages pkg-config) | |
cc2b77df | 37 | #:use-module (gnu packages tls) |
44ccd962 | 38 | #:use-module (gnu packages texinfo) |
0061079a EB |
39 | #:use-module (gnu packages version-control) |
40 | #:use-module (gnu packages web) | |
41 | #:use-module (gnu packages xml) | |
0061079a EB |
42 | #:use-module (guix build-system gnu)) |
43 | ||
44 | (define-public hydra | |
253745d7 | 45 | (let ((commit "1ff48da3d3d4a425063f5b7dd0b89d35270f8932")) |
0061079a EB |
46 | (package |
47 | (name "hydra") | |
253745d7 | 48 | (version (string-append "20151030." (string-take commit 7))) |
0061079a EB |
49 | (source (origin |
50 | (method git-fetch) | |
51 | (uri (git-reference | |
52 | (url "https://github.com/NixOS/hydra") | |
53 | (commit commit))) | |
54 | (file-name (string-append name "-" version)) | |
fc1adab1 | 55 | (patches (search-patches |
fc1adab1 | 56 | ;; TODO: Remove once we have a darcs input |
253745d7 JN |
57 | "hydra-disable-darcs-test.patch")) |
58 | (sha256 | |
59 | (base32 | |
60 | "0ni8i8v1nxxfr51rz8m6znwpbm77vr7i05k506hmgmg32r938lap")))) | |
0061079a EB |
61 | (build-system gnu-build-system) |
62 | (native-inputs | |
63 | `(("unzip" ,unzip) | |
64 | ("pkg-config" ,pkg-config) | |
65 | ;; For documentation | |
66 | ("dblatex" ,dblatex) | |
67 | ("xsltproc" ,libxslt) | |
68 | ("docbook-xsl" ,docbook-xsl) | |
69 | ;; For bootstrap | |
70 | ("autoconf" ,autoconf) | |
71 | ("automake" ,automake) | |
72 | ("libtool" ,libtool) | |
73 | ;; For tests | |
74 | ("git" ,git) | |
75 | ("subversion" ,subversion) | |
76 | ("mercurial" ,mercurial) | |
77 | ("bazaar" ,bazaar))) | |
78 | (inputs | |
253745d7 JN |
79 | `(("libpqxx" ,libpqxx) |
80 | ("perl" ,perl) | |
0061079a EB |
81 | ("guile" ,guile-2.0) |
82 | ("openssl" ,openssl) | |
83 | ("bzip2" ,bzip2) | |
84 | ("gzip" ,gzip) | |
85 | ("sed" ,sed) | |
86 | ("starman" ,starman) | |
87 | ("git" ,git) | |
88 | ("subversion" ,subversion) | |
89 | ("mercurial" ,mercurial) | |
90 | ("bazaar" ,bazaar) | |
91 | ("nix" ,nix) | |
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) | |
253745d7 | 131 | ("perl-net-statsd" ,perl-net-statsd) |
0061079a EB |
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))) | |
140 | (arguments | |
141 | `(#:configure-flags | |
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 | |
149 | (add-after | |
150 | 'unpack 'bootstrap | |
151 | (lambda _ (zero? (system* "autoreconf" "-vfi")))) | |
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 | |
0d43b12d LC |
189 | (let ((commit "870e8d6ad3415ac61c52e57095fcc6164023a0fc") |
190 | (revision "6")) | |
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 | |
0d43b12d | 202 | "0lp5a5p42k7lml15lbmmd7az9i0gw5kips3sh3awd2z79h0w2knw")))) |
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)) | |
218 | (add-before 'configure 'bootstrap | |
365de1e7 ML |
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")) | |
2eadd828 | 226 | (git (assoc-ref inputs "git")) |
365de1e7 | 227 | (guix (assoc-ref inputs "guix")) |
0d43b12d LC |
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/" | |
234 | effective ":" | |
235 | sqlite "/share/guile/site/" | |
236 | effective ":" | |
237 | guix "/share/guile/site/" | |
238 | effective))) | |
4a78638f LC |
239 | ;; Make sure 'cuirass' can find the 'git' and 'evaluate' |
240 | ;; commands, as well as the relevant Guile modules. | |
365de1e7 | 241 | (wrap-program (string-append out "/bin/cuirass") |
4a78638f LC |
242 | `("PATH" ":" prefix (,(string-append out "/bin") |
243 | ,(string-append git "/bin"))) | |
365de1e7 | 244 | `("GUILE_LOAD_PATH" ":" prefix (,mods)) |
2eadd828 LC |
245 | `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,mods))) |
246 | #t)))))) | |
365de1e7 | 247 | (inputs |
0d43b12d | 248 | `(("guile" ,guile-2.2) |
2252f087 | 249 | ("guile-json" ,guile-json) |
365de1e7 | 250 | ("guile-sqlite3" ,guile-sqlite3) |
2eadd828 LC |
251 | ("guix" ,guix) |
252 | ("git" ,git))) | |
365de1e7 ML |
253 | (native-inputs |
254 | `(("autoconf" ,autoconf) | |
255 | ("automake" ,automake) | |
44ccd962 ML |
256 | ("pkg-config" ,pkg-config) |
257 | ("texinfo" ,texinfo))) | |
365de1e7 ML |
258 | (synopsis "Continuous integration system") |
259 | (description | |
260 | "Cuirass is a continuous integration tool using GNU Guix. It is | |
261 | intended as a replacement for Hydra.") | |
0d43b12d | 262 | (home-page "https://www.gnu.org/software/guix/") |
365de1e7 | 263 | (license l:gpl3+)))) |