Commit | Line | Data |
---|---|---|
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> |
7a9ca44a | 5 | ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> |
a6d05444 | 6 | ;;; Copyright © 2017 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) | |
0061079a EB |
47 | #:use-module (guix build-system gnu)) |
48 | ||
365de1e7 | 49 | (define-public cuirass |
08759829 LC |
50 | (let ((commit "0b40dca734468e8b12b3ff58e3e779679f17d38e") |
51 | (revision "21")) | |
365de1e7 ML |
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 | |
0d43b12d | 58 | (url "https://git.savannah.gnu.org/git/guix/guix-cuirass.git") |
365de1e7 ML |
59 | (commit commit))) |
60 | (file-name (string-append name "-" version)) | |
61 | (sha256 | |
62 | (base32 | |
08759829 | 63 | "1kdxs8dzdyldfs4wsz5hb64hprkbrnq5ljdll631f3bj8pbvvvc1")))) |
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 | ||
71 | #:phases | |
365de1e7 | 72 | (modify-phases %standard-phases |
04927b6f ML |
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)) | |
4561498e KK |
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)) | |
365de1e7 ML |
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")) | |
7903f00a | 88 | (gcrypt (assoc-ref inputs "guile-gcrypt")) |
365de1e7 ML |
89 | (json (assoc-ref inputs "guile-json")) |
90 | (sqlite (assoc-ref inputs "guile-sqlite3")) | |
a6d05444 RW |
91 | (git (assoc-ref inputs "guile-git")) |
92 | (bytes (assoc-ref inputs "guile-bytestructures")) | |
d1688e6a | 93 | (fibers (assoc-ref inputs "guile-fibers")) |
365de1e7 | 94 | (guix (assoc-ref inputs "guix")) |
7903f00a | 95 | (deps (list gcrypt json sqlite git bytes fibers guix)) |
0d43b12d LC |
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))"))) | |
7903f00a LC |
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))) | |
a6d05444 RW |
113 | ;; Make sure 'cuirass' can find the 'evaluate' command, as |
114 | ;; well as the relevant Guile modules. | |
365de1e7 | 115 | (wrap-program (string-append out "/bin/cuirass") |
a6d05444 | 116 | `("PATH" ":" prefix (,(string-append out "/bin"))) |
365de1e7 | 117 | `("GUILE_LOAD_PATH" ":" prefix (,mods)) |
7903f00a | 118 | `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))) |
2eadd828 | 119 | #t)))))) |
365de1e7 | 120 | (inputs |
0d43b12d | 121 | `(("guile" ,guile-2.2) |
d1688e6a | 122 | ("guile-fibers" ,guile-fibers) |
7903f00a | 123 | ("guile-gcrypt" ,guile-gcrypt) |
2252f087 | 124 | ("guile-json" ,guile-json) |
365de1e7 | 125 | ("guile-sqlite3" ,guile-sqlite3) |
a6d05444 RW |
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))) | |
365de1e7 ML |
131 | (native-inputs |
132 | `(("autoconf" ,autoconf) | |
133 | ("automake" ,automake) | |
44ccd962 ML |
134 | ("pkg-config" ,pkg-config) |
135 | ("texinfo" ,texinfo))) | |
1501cb55 LC |
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"))))) | |
365de1e7 ML |
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.") | |
0d43b12d | 151 | (home-page "https://www.gnu.org/software/guix/") |
365de1e7 | 152 | (license l:gpl3+)))) |