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