gnu: guile-mastodon-dev: Remove 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 tls)
44 #:use-module (gnu packages texinfo)
45 #:use-module (gnu packages version-control)
46 #:use-module (gnu packages web)
47 #:use-module (gnu packages xml)
48 #:use-module (guix build-system gnu))
49
50 (define-public cuirass
51 (let ((commit "6f4a203a0bb2d441d091d561c1735fbe2d170cf7")
52 (revision "2"))
53 (package
54 (name "cuirass")
55 (version (git-version "1.0.0" revision commit))
56 (source
57 (origin
58 (method git-fetch)
59 (uri (git-reference
60 (url "https://git.savannah.gnu.org/git/guix/guix-cuirass.git")
61 (commit commit)))
62 (file-name (git-file-name name version))
63 (sha256
64 (base32
65 "120cnnjy4j2dinfmas1ddmqzzc7ikj9c76sl4li6g6dn8g7s8f69"))))
66 (build-system gnu-build-system)
67 (arguments
68 '(#:modules ((guix build utils)
69 (guix build gnu-build-system)
70 (ice-9 rdelim)
71 (ice-9 popen))
72 #:configure-flags '("--localstatedir=/var") ;for /var/log/cuirass
73 #:parallel-tests? #f
74 #:phases
75 (modify-phases %standard-phases
76 (add-before 'check 'set-PATH-for-tests
77 (lambda* (#:key inputs #:allow-other-keys)
78 (let ((pg (assoc-ref inputs "ephemeralpg"))
79 (path (getenv "PATH")))
80 (setenv "PATH" (string-append pg "/bin:" path))
81 #t)))
82 ;; Disable the remote tests that require a Guix daemon connection.
83 (add-before 'check 'disable-remote-tests
84 (lambda _
85 (substitute* "Makefile.am"
86 (("tests/remote.scm") ""))
87 #t))
88 (add-after 'install 'wrap-program
89 (lambda* (#:key inputs outputs #:allow-other-keys)
90 ;; Wrap the 'cuirass' command to refer to the right modules.
91 (let* ((out (assoc-ref outputs "out"))
92 (avahi (assoc-ref inputs "guile-avahi"))
93 (gcrypt (assoc-ref inputs "guile-gcrypt"))
94 (json (assoc-ref inputs "guile-json"))
95 (zmq (assoc-ref inputs "guile-simple-zmq"))
96 (squee (assoc-ref inputs "guile-squee"))
97 (git (assoc-ref inputs "guile-git"))
98 (bytes (assoc-ref inputs "guile-bytestructures"))
99 (fibers (assoc-ref inputs "guile-fibers"))
100 (zlib (assoc-ref inputs "guile-zlib"))
101 (matd (assoc-ref inputs "guile-mastodon"))
102 (tls (assoc-ref inputs "gnutls"))
103 (mail (assoc-ref inputs "mailutils"))
104 (guix (assoc-ref inputs "guix"))
105 (deps (list avahi gcrypt json zmq squee git bytes
106 fibers zlib matd tls mail guix))
107 (guile (assoc-ref %build-inputs "guile"))
108 (effective
109 (read-line
110 (open-pipe* OPEN_READ
111 (string-append guile "/bin/guile")
112 "-c" "(display (effective-version))")))
113 (mods
114 (string-drop-right ;drop trailing colon
115 (string-join deps
116 (string-append "/share/guile/site/"
117 effective ":")
118 'suffix)
119 1))
120 (objs
121 (string-drop-right
122 (string-join deps
123 (string-append "/lib/guile/" effective
124 "/site-ccache:")
125 'suffix)
126 1)))
127 ;; Make sure 'cuirass' can find the relevant Guile modules.
128 (wrap-program (string-append out "/bin/cuirass")
129 `("PATH" ":" prefix (,(string-append out "/bin")))
130 `("GUILE_LOAD_PATH" ":" prefix (,mods))
131 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs)))
132 #t))))))
133 (inputs
134 `(("guile" ,guile-3.0/libgc-7)
135 ("guile-avahi" ,guile-avahi)
136 ("guile-fibers" ,guile-fibers)
137 ("guile-gcrypt" ,guile-gcrypt)
138 ("guile-json" ,guile-json-4)
139 ("guile-simple-zmq" ,guile-simple-zmq)
140 ("guile-squee" ,guile-squee)
141 ("guile-git" ,guile-git)
142 ("guile-zlib" ,guile-zlib)
143 ("guile-mastodon" ,guile-mastodon)
144 ("gnutls" ,gnutls)
145 ("mailutils" ,mailutils)
146 ;; FIXME: this is propagated by "guile-git", but it needs to be among
147 ;; the inputs to add it to GUILE_LOAD_PATH.
148 ("guile-bytestructures" ,guile-bytestructures)
149 ("guix" ,guix)))
150 (native-inputs
151 `(("autoconf" ,autoconf)
152 ("automake" ,automake)
153 ("pkg-config" ,pkg-config)
154 ("texinfo" ,texinfo)
155 ("ephemeralpg" ,ephemeralpg)))
156 (native-search-paths
157 ;; For HTTPS access, Cuirass itself honors these variables, with the
158 ;; same semantics as Git and OpenSSL (respectively).
159 (list (search-path-specification
160 (variable "GIT_SSL_CAINFO")
161 (file-type 'regular)
162 (separator #f) ;single entry
163 (files '("etc/ssl/certs/ca-certificates.crt")))
164 (search-path-specification
165 (variable "SSL_CERT_DIR")
166 (files '("etc/ssl/certs")))))
167 (synopsis "Continuous integration system")
168 (description
169 "Cuirass is a continuous integration tool using GNU Guix. It is
170 intended as a replacement for Hydra.")
171 (home-page "https://www.gnu.org/software/guix/")
172 (license l:gpl3+))))