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