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> |
c0f297e8 | 5 | ;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com> |
8f0b41c8 | 6 | ;;; Copyright © 2017, 2019, 2020 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) | |
0791437f | 35 | #:use-module (gnu packages guile-xyz) |
7903f00a | 36 | #:use-module (gnu packages gnupg) |
0061079a | 37 | #:use-module (gnu packages mail) |
0061079a EB |
38 | #:use-module (gnu packages package-management) |
39 | #:use-module (gnu packages perl) | |
21b41a79 | 40 | #:use-module (gnu packages perl-compression) |
0061079a | 41 | #:use-module (gnu packages pkg-config) |
e5032111 | 42 | #:use-module (gnu packages sqlite) |
cc2b77df | 43 | #:use-module (gnu packages tls) |
44ccd962 | 44 | #:use-module (gnu packages texinfo) |
0061079a EB |
45 | #:use-module (gnu packages version-control) |
46 | #:use-module (gnu packages web) | |
47 | #:use-module (gnu packages xml) | |
b94cf161 | 48 | #:use-module (guix build-system gnu)) |
0061079a | 49 | |
e5032111 MO |
50 | ;; Guile-Sqlite3 package adding SQL query logging support. |
51 | ;; Remove it when next Guile-Sqlite3 release is out. | |
52 | (define-public guile-sqlite3-dev | |
53 | (let ((commit "22ef45d268de7707cbbb943c404f9b0c1668e2e1") | |
54 | (revision "1")) | |
55 | (package | |
56 | (inherit guile-sqlite3) | |
57 | (name "guile-sqlite3") | |
58 | (version (git-version "0.1.2" revision commit)) | |
59 | (home-page "https://notabug.org/mothacehe/guile-sqlite3.git") | |
60 | (source (origin | |
61 | (method git-fetch) | |
62 | (uri (git-reference | |
63 | (url home-page) | |
64 | (commit commit))) | |
65 | (sha256 | |
66 | (base32 | |
67 | "1q90f8zhw9n1c39szd2ba7aj5fi92m09pnlv0z7jbhnnjam5jwcd")) | |
68 | (file-name (string-append name "-" version "-checkout"))))))) | |
69 | ||
365de1e7 | 70 | (define-public cuirass |
2dd4f389 MO |
71 | (let ((commit "697fa14584551d9595cd042f1ffeba240e45a127") |
72 | (revision "56")) | |
365de1e7 ML |
73 | (package |
74 | (name "cuirass") | |
8f0b41c8 | 75 | (version (git-version "0.0.1" revision commit)) |
365de1e7 ML |
76 | (source (origin |
77 | (method git-fetch) | |
78 | (uri (git-reference | |
0d43b12d | 79 | (url "https://git.savannah.gnu.org/git/guix/guix-cuirass.git") |
365de1e7 | 80 | (commit commit))) |
8f0b41c8 | 81 | (file-name (git-file-name name version)) |
365de1e7 ML |
82 | (sha256 |
83 | (base32 | |
2dd4f389 | 84 | "0gw9cja8fiyra9vnn3y384gwanvsqdq6gwjcvmz91sy5lvfwv34m")))) |
365de1e7 ML |
85 | (build-system gnu-build-system) |
86 | (arguments | |
0d43b12d LC |
87 | '(#:modules ((guix build utils) |
88 | (guix build gnu-build-system) | |
89 | (ice-9 rdelim) | |
90 | (ice-9 popen)) | |
91 | ||
134a2c4a LC |
92 | #:configure-flags '("--localstatedir=/var") ;for /var/log/cuirass |
93 | ||
0d43b12d | 94 | #:phases |
365de1e7 | 95 | (modify-phases %standard-phases |
04927b6f | 96 | (add-after 'unpack 'disable-repo-tests |
2dd4f389 | 97 | (lambda _ |
04927b6f ML |
98 | ;; Disable tests that use a connection to the Guix daemon. |
99 | (substitute* "Makefile.am" | |
100 | (("tests/repo.scm \\\\") "\\")) | |
101 | #t)) | |
4561498e KK |
102 | (add-after 'disable-repo-tests 'patch-/bin/sh |
103 | (lambda _ | |
104 | (substitute* "build-aux/git-version-gen" | |
105 | (("#!/bin/sh") (string-append "#!" (which "sh")))) | |
106 | #t)) | |
365de1e7 ML |
107 | (add-after 'install 'wrap-program |
108 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
109 | ;; Wrap the 'cuirass' command to refer to the right modules. | |
110 | (let* ((out (assoc-ref outputs "out")) | |
7903f00a | 111 | (gcrypt (assoc-ref inputs "guile-gcrypt")) |
365de1e7 ML |
112 | (json (assoc-ref inputs "guile-json")) |
113 | (sqlite (assoc-ref inputs "guile-sqlite3")) | |
a6d05444 RW |
114 | (git (assoc-ref inputs "guile-git")) |
115 | (bytes (assoc-ref inputs "guile-bytestructures")) | |
d1688e6a | 116 | (fibers (assoc-ref inputs "guile-fibers")) |
7f765a9d | 117 | (zlib (assoc-ref inputs "guile-zlib")) |
365de1e7 | 118 | (guix (assoc-ref inputs "guix")) |
7f765a9d MO |
119 | (deps (list gcrypt json sqlite git bytes fibers |
120 | zlib guix)) | |
0d43b12d LC |
121 | (guile (assoc-ref %build-inputs "guile")) |
122 | (effective (read-line | |
123 | (open-pipe* OPEN_READ | |
124 | (string-append guile "/bin/guile") | |
125 | "-c" "(display (effective-version))"))) | |
7903f00a LC |
126 | (mods (string-drop-right ;drop trailing colon |
127 | (string-join deps | |
128 | (string-append "/share/guile/site/" | |
129 | effective ":") | |
130 | 'suffix) | |
131 | 1)) | |
132 | (objs (string-drop-right | |
133 | (string-join deps | |
134 | (string-append "/lib/guile/" effective | |
135 | "/site-ccache:") | |
136 | 'suffix) | |
137 | 1))) | |
a6d05444 RW |
138 | ;; Make sure 'cuirass' can find the 'evaluate' command, as |
139 | ;; well as the relevant Guile modules. | |
365de1e7 | 140 | (wrap-program (string-append out "/bin/cuirass") |
a6d05444 | 141 | `("PATH" ":" prefix (,(string-append out "/bin"))) |
365de1e7 | 142 | `("GUILE_LOAD_PATH" ":" prefix (,mods)) |
7903f00a | 143 | `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))) |
2eadd828 | 144 | #t)))))) |
365de1e7 | 145 | (inputs |
0b17de06 | 146 | `(("guile" ,guile-3.0/libgc-7) |
d1688e6a | 147 | ("guile-fibers" ,guile-fibers) |
7903f00a | 148 | ("guile-gcrypt" ,guile-gcrypt) |
8f7cf3b5 | 149 | ("guile-json" ,guile-json-4) |
e5032111 | 150 | ("guile-sqlite3" ,guile-sqlite3-dev) |
a6d05444 | 151 | ("guile-git" ,guile-git) |
7f765a9d | 152 | ("guile-zlib" ,guile-zlib) |
a6d05444 RW |
153 | ;; FIXME: this is propagated by "guile-git", but it needs to be among |
154 | ;; the inputs to add it to GUILE_LOAD_PATH. | |
155 | ("guile-bytestructures" ,guile-bytestructures) | |
156 | ("guix" ,guix))) | |
365de1e7 ML |
157 | (native-inputs |
158 | `(("autoconf" ,autoconf) | |
159 | ("automake" ,automake) | |
44ccd962 ML |
160 | ("pkg-config" ,pkg-config) |
161 | ("texinfo" ,texinfo))) | |
1501cb55 LC |
162 | (native-search-paths |
163 | ;; For HTTPS access, Cuirass itself honors these variables, with the | |
164 | ;; same semantics as Git and OpenSSL (respectively). | |
165 | (list (search-path-specification | |
166 | (variable "GIT_SSL_CAINFO") | |
167 | (file-type 'regular) | |
168 | (separator #f) ;single entry | |
169 | (files '("etc/ssl/certs/ca-certificates.crt"))) | |
170 | (search-path-specification | |
171 | (variable "SSL_CERT_DIR") | |
172 | (files '("etc/ssl/certs"))))) | |
365de1e7 ML |
173 | (synopsis "Continuous integration system") |
174 | (description | |
175 | "Cuirass is a continuous integration tool using GNU Guix. It is | |
176 | intended as a replacement for Hydra.") | |
0d43b12d | 177 | (home-page "https://www.gnu.org/software/guix/") |
365de1e7 | 178 | (license l:gpl3+)))) |