gnu: cuirass: Update to 0.0.1-76.5f830da.
[jackhill/guix/guix.git] / gnu / packages / ci.scm
CommitLineData
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>
0f01493d 5;;; Copyright © 2017, 2020, 2021 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)
0f01493d 29 #:use-module (guix download)
0061079a
EB
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)
0791437f 36 #:use-module (gnu packages guile-xyz)
7903f00a 37 #:use-module (gnu packages gnupg)
0061079a 38 #:use-module (gnu packages mail)
0061079a
EB
39 #:use-module (gnu packages package-management)
40 #:use-module (gnu packages perl)
21b41a79 41 #:use-module (gnu packages perl-compression)
0061079a 42 #:use-module (gnu packages pkg-config)
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
dbc10e74
MO
50(define-public guile-mastodon-dev
51 (let ((commit "88115d85221876b1baea4accb7c76995da32f479")
52 (revision "1"))
53 (package
54 (inherit guile-mastodon)
55 (name "guile-mastodon")
56 (version (git-version "0.0.1" revision commit))
57 (home-page "https://framagit.org/mothacehe/guile-mastodon.git")
58 (source (origin
59 (method git-fetch)
60 (uri (git-reference
61 (url home-page)
62 (commit commit)))
63 (sha256
64 (base32
65 "04dgxliz9bmhn0f7h1n0dj0r5h0fzhg80nxl1rpbxh4zs1yw9qvj"))
66 (file-name (string-append name "-" version "-checkout")))))))
67
365de1e7 68(define-public cuirass
c1baf9b8
MO
69 (let ((commit "5f830da3e3fde58044f189a0dfc30fe6aa0d8db6")
70 (revision "76"))
365de1e7
ML
71 (package
72 (name "cuirass")
8f0b41c8 73 (version (git-version "0.0.1" revision commit))
ff52d115
MO
74 (source
75 (origin
76 (method git-fetch)
77 (uri (git-reference
78 (url "https://git.savannah.gnu.org/git/guix/guix-cuirass.git")
79 (commit commit)))
80 (file-name (git-file-name name version))
81 (sha256
82 (base32
c1baf9b8 83 "1wkrpxpf52pf37k1v1rnlscmnj64qvpqv3rgx46x4iah0jf57yyc"))))
365de1e7
ML
84 (build-system gnu-build-system)
85 (arguments
0d43b12d
LC
86 '(#:modules ((guix build utils)
87 (guix build gnu-build-system)
88 (ice-9 rdelim)
89 (ice-9 popen))
134a2c4a 90 #:configure-flags '("--localstatedir=/var") ;for /var/log/cuirass
0d43b12d 91 #:phases
365de1e7 92 (modify-phases %standard-phases
ff52d115
MO
93 (add-before 'check 'set-PATH-for-tests
94 (lambda* (#:key inputs #:allow-other-keys)
95 (let ((pg (assoc-ref inputs "ephemeralpg"))
96 (path (getenv "PATH")))
97 (setenv "PATH" (string-append pg "/bin:" path))
98 #t)))
365de1e7
ML
99 (add-after 'install 'wrap-program
100 (lambda* (#:key inputs outputs #:allow-other-keys)
101 ;; Wrap the 'cuirass' command to refer to the right modules.
102 (let* ((out (assoc-ref outputs "out"))
0f01493d 103 (avahi (assoc-ref inputs "guile-avahi"))
7903f00a 104 (gcrypt (assoc-ref inputs "guile-gcrypt"))
365de1e7 105 (json (assoc-ref inputs "guile-json"))
0f01493d
MO
106 (zmq (assoc-ref inputs "guile-simple-zmq"))
107 (squee (assoc-ref inputs "guile-squee"))
a6d05444
RW
108 (git (assoc-ref inputs "guile-git"))
109 (bytes (assoc-ref inputs "guile-bytestructures"))
d1688e6a 110 (fibers (assoc-ref inputs "guile-fibers"))
7f765a9d 111 (zlib (assoc-ref inputs "guile-zlib"))
0e5bc144 112 (matd (assoc-ref inputs "guile-mastodon"))
108e2c61 113 (tls (assoc-ref inputs "gnutls"))
0e5bc144 114 (mail (assoc-ref inputs "mailutils"))
365de1e7 115 (guix (assoc-ref inputs "guix"))
0f01493d 116 (deps (list avahi gcrypt json zmq squee git bytes
108e2c61 117 fibers zlib matd tls mail guix))
0d43b12d 118 (guile (assoc-ref %build-inputs "guile"))
ff52d115
MO
119 (effective
120 (read-line
121 (open-pipe* OPEN_READ
122 (string-append guile "/bin/guile")
123 "-c" "(display (effective-version))")))
124 (mods
125 (string-drop-right ;drop trailing colon
126 (string-join deps
127 (string-append "/share/guile/site/"
128 effective ":")
129 'suffix)
130 1))
131 (objs
132 (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.
0f01493d
MO
140 (for-each
141 (lambda (name)
142 (wrap-program (string-append out "/bin/" name)
143 `("PATH" ":" prefix (,(string-append out "/bin")))
144 `("GUILE_LOAD_PATH" ":" prefix (,mods))
145 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))))
146 '("cuirass" "remote-server" "remote-worker"))
2eadd828 147 #t))))))
365de1e7 148 (inputs
0b17de06 149 `(("guile" ,guile-3.0/libgc-7)
0f01493d 150 ("guile-avahi" ,guile-avahi)
d1688e6a 151 ("guile-fibers" ,guile-fibers)
7903f00a 152 ("guile-gcrypt" ,guile-gcrypt)
8f7cf3b5 153 ("guile-json" ,guile-json-4)
0f01493d
MO
154 ("guile-simple-zmq" ,guile-simple-zmq)
155 ("guile-squee" ,guile-squee)
a6d05444 156 ("guile-git" ,guile-git)
7f765a9d 157 ("guile-zlib" ,guile-zlib)
dbc10e74 158 ("guile-mastodon" ,guile-mastodon-dev)
108e2c61 159 ("gnutls" ,gnutls)
0e5bc144 160 ("mailutils" ,mailutils)
a6d05444
RW
161 ;; FIXME: this is propagated by "guile-git", but it needs to be among
162 ;; the inputs to add it to GUILE_LOAD_PATH.
163 ("guile-bytestructures" ,guile-bytestructures)
164 ("guix" ,guix)))
365de1e7
ML
165 (native-inputs
166 `(("autoconf" ,autoconf)
167 ("automake" ,automake)
44ccd962 168 ("pkg-config" ,pkg-config)
ff52d115
MO
169 ("texinfo" ,texinfo)
170 ("ephemeralpg" ,ephemeralpg)))
1501cb55
LC
171 (native-search-paths
172 ;; For HTTPS access, Cuirass itself honors these variables, with the
173 ;; same semantics as Git and OpenSSL (respectively).
174 (list (search-path-specification
175 (variable "GIT_SSL_CAINFO")
176 (file-type 'regular)
177 (separator #f) ;single entry
178 (files '("etc/ssl/certs/ca-certificates.crt")))
179 (search-path-specification
180 (variable "SSL_CERT_DIR")
181 (files '("etc/ssl/certs")))))
365de1e7
ML
182 (synopsis "Continuous integration system")
183 (description
184 "Cuirass is a continuous integration tool using GNU Guix. It is
185intended as a replacement for Hydra.")
0d43b12d 186 (home-page "https://www.gnu.org/software/guix/")
365de1e7 187 (license l:gpl3+))))