gnu: cuirass: Update to 0.0.1-52.38ee2c5.
[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 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 (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)
35 #:use-module (gnu packages guile-xyz)
36 #:use-module (gnu packages gnupg)
37 #:use-module (gnu packages mail)
38 #:use-module (gnu packages package-management)
39 #:use-module (gnu packages perl)
40 #:use-module (gnu packages perl-compression)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages sqlite)
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 ;; 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
70 (define-public cuirass
71 (let ((commit "38ee2c5b5b21404f383fc5066af8141785676e56")
72 (revision "52"))
73 (package
74 (name "cuirass")
75 (version (git-version "0.0.1" revision commit))
76 (source (origin
77 (method git-fetch)
78 (uri (git-reference
79 (url "https://git.savannah.gnu.org/git/guix/guix-cuirass.git")
80 (commit commit)))
81 (file-name (git-file-name name version))
82 (sha256
83 (base32
84 "13z862i668v2c6w3ajb1mddkzfcdc16myjqz7gss59bykzag728p"))))
85 (build-system gnu-build-system)
86 (arguments
87 '(#:modules ((guix build utils)
88 (guix build gnu-build-system)
89 (ice-9 rdelim)
90 (ice-9 popen))
91
92 #:configure-flags '("--localstatedir=/var") ;for /var/log/cuirass
93
94 #:phases
95 (modify-phases %standard-phases
96 (add-after 'unpack 'disable-repo-tests
97 (λ _
98 ;; Disable tests that use a connection to the Guix daemon.
99 (substitute* "Makefile.am"
100 (("tests/repo.scm \\\\") "\\"))
101 #t))
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))
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"))
111 (gcrypt (assoc-ref inputs "guile-gcrypt"))
112 (json (assoc-ref inputs "guile-json"))
113 (sqlite (assoc-ref inputs "guile-sqlite3"))
114 (git (assoc-ref inputs "guile-git"))
115 (bytes (assoc-ref inputs "guile-bytestructures"))
116 (fibers (assoc-ref inputs "guile-fibers"))
117 (zlib (assoc-ref inputs "guile-zlib"))
118 (guix (assoc-ref inputs "guix"))
119 (deps (list gcrypt json sqlite git bytes fibers
120 zlib guix))
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))")))
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)))
138 ;; Make sure 'cuirass' can find the 'evaluate' command, as
139 ;; well as the relevant Guile modules.
140 (wrap-program (string-append out "/bin/cuirass")
141 `("PATH" ":" prefix (,(string-append out "/bin")))
142 `("GUILE_LOAD_PATH" ":" prefix (,mods))
143 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs)))
144 #t))))))
145 (inputs
146 `(("guile" ,guile-3.0/libgc-7)
147 ("guile-fibers" ,guile-fibers)
148 ("guile-gcrypt" ,guile-gcrypt)
149 ("guile-json" ,guile-json-4)
150 ("guile-sqlite3" ,guile-sqlite3-dev)
151 ("guile-git" ,guile-git)
152 ("guile-zlib" ,guile-zlib)
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)))
157 (native-inputs
158 `(("autoconf" ,autoconf)
159 ("automake" ,automake)
160 ("pkg-config" ,pkg-config)
161 ("texinfo" ,texinfo)))
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")))))
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.")
177 (home-page "https://www.gnu.org/software/guix/")
178 (license l:gpl3+))))