service: cuirass: Update it.
[jackhill/guix/guix.git] / gnu / packages / ci.scm
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, 2020, 2021 Mathieu Othacehe <m.othacehe@gmail.com>
6 ;;; Copyright © 2017, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
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 (guix download)
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages base)
32 #:use-module (gnu packages docbook)
33 #:use-module (gnu packages compression)
34 #:use-module (gnu packages databases)
35 #:use-module (gnu packages guile)
36 #:use-module (gnu packages guile-xyz)
37 #:use-module (gnu packages gnupg)
38 #:use-module (gnu packages mail)
39 #:use-module (gnu packages package-management)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages perl-compression)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages sqlite)
44 #:use-module (gnu packages tls)
45 #:use-module (gnu packages texinfo)
46 #:use-module (gnu packages version-control)
47 #:use-module (gnu packages web)
48 #:use-module (gnu packages xml)
49 #:use-module (guix build-system gnu))
50
51 ;; Guile-Sqlite3 package adding SQL query logging support.
52 ;; Remove it when next Guile-Sqlite3 release is out.
53 (define-public guile-sqlite3-dev
54 (let ((commit "22ef45d268de7707cbbb943c404f9b0c1668e2e1")
55 (revision "1"))
56 (package
57 (inherit guile-sqlite3)
58 (name "guile-sqlite3")
59 (version (git-version "0.1.2" revision commit))
60 (home-page "https://notabug.org/mothacehe/guile-sqlite3.git")
61 (source (origin
62 (method git-fetch)
63 (uri (git-reference
64 (url home-page)
65 (commit commit)))
66 (sha256
67 (base32
68 "1q90f8zhw9n1c39szd2ba7aj5fi92m09pnlv0z7jbhnnjam5jwcd"))
69 (file-name (string-append name "-" version "-checkout")))))))
70
71 (define-public cuirass
72 (let ((commit "da6a5c0355e72d725003c9005a9974f2a476d999")
73 (revision "58"))
74 (package
75 (name "cuirass")
76 (version (git-version "0.0.1" revision commit))
77 (source (origin
78 (method git-fetch)
79 (uri (git-reference
80 (url "https://git.savannah.gnu.org/git/guix/guix-cuirass.git")
81 (commit commit)))
82 (file-name (git-file-name name version))
83 (sha256
84 (base32
85 "0p9ad0aisbl7clb3vi7zmfbnmnsnxq90vgx8v9ly5b0dgrav91p4"))))
86 (build-system gnu-build-system)
87 (arguments
88 '(#:modules ((guix build utils)
89 (guix build gnu-build-system)
90 (ice-9 rdelim)
91 (ice-9 popen))
92 #:configure-flags '("--localstatedir=/var") ;for /var/log/cuirass
93 #:tests? #f ;requires a PostgreSQL database.
94 #:phases
95 (modify-phases %standard-phases
96 (add-after 'install 'wrap-program
97 (lambda* (#:key inputs outputs #:allow-other-keys)
98 ;; Wrap the 'cuirass' command to refer to the right modules.
99 (let* ((out (assoc-ref outputs "out"))
100 (avahi (assoc-ref inputs "guile-avahi"))
101 (gcrypt (assoc-ref inputs "guile-gcrypt"))
102 (json (assoc-ref inputs "guile-json"))
103 (zmq (assoc-ref inputs "guile-simple-zmq"))
104 (squee (assoc-ref inputs "guile-squee"))
105 (git (assoc-ref inputs "guile-git"))
106 (bytes (assoc-ref inputs "guile-bytestructures"))
107 (fibers (assoc-ref inputs "guile-fibers"))
108 (zlib (assoc-ref inputs "guile-zlib"))
109 (guix (assoc-ref inputs "guix"))
110 (deps (list avahi gcrypt json zmq squee git bytes
111 fibers zlib guix))
112 (guile (assoc-ref %build-inputs "guile"))
113 (effective (read-line
114 (open-pipe* OPEN_READ
115 (string-append guile "/bin/guile")
116 "-c" "(display (effective-version))")))
117 (mods (string-drop-right ;drop trailing colon
118 (string-join deps
119 (string-append "/share/guile/site/"
120 effective ":")
121 'suffix)
122 1))
123 (objs (string-drop-right
124 (string-join deps
125 (string-append "/lib/guile/" effective
126 "/site-ccache:")
127 'suffix)
128 1)))
129 ;; Make sure 'cuirass' can find the 'evaluate' command, as
130 ;; well as the relevant Guile modules.
131 (for-each
132 (lambda (name)
133 (wrap-program (string-append out "/bin/" name)
134 `("PATH" ":" prefix (,(string-append out "/bin")))
135 `("GUILE_LOAD_PATH" ":" prefix (,mods))
136 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))))
137 '("cuirass" "remote-server" "remote-worker"))
138 #t))))))
139 (inputs
140 `(("guile" ,guile-3.0/libgc-7)
141 ("guile-avahi" ,guile-avahi)
142 ("guile-fibers" ,guile-fibers)
143 ("guile-gcrypt" ,guile-gcrypt)
144 ("guile-json" ,guile-json-4)
145 ("guile-simple-zmq" ,guile-simple-zmq)
146 ("guile-squee" ,guile-squee)
147 ("guile-git" ,guile-git)
148 ("guile-zlib" ,guile-zlib)
149 ;; FIXME: this is propagated by "guile-git", but it needs to be among
150 ;; the inputs to add it to GUILE_LOAD_PATH.
151 ("guile-bytestructures" ,guile-bytestructures)
152 ("guix" ,guix)))
153 (native-inputs
154 `(("autoconf" ,autoconf)
155 ("automake" ,automake)
156 ("pkg-config" ,pkg-config)
157 ("texinfo" ,texinfo)))
158 (native-search-paths
159 ;; For HTTPS access, Cuirass itself honors these variables, with the
160 ;; same semantics as Git and OpenSSL (respectively).
161 (list (search-path-specification
162 (variable "GIT_SSL_CAINFO")
163 (file-type 'regular)
164 (separator #f) ;single entry
165 (files '("etc/ssl/certs/ca-certificates.crt")))
166 (search-path-specification
167 (variable "SSL_CERT_DIR")
168 (files '("etc/ssl/certs")))))
169 (synopsis "Continuous integration system")
170 (description
171 "Cuirass is a continuous integration tool using GNU Guix. It is
172 intended as a replacement for Hydra.")
173 (home-page "https://www.gnu.org/software/guix/")
174 (license l:gpl3+))))