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> |
0f01493d | 5 | ;;; Copyright © 2017, 2020, 2021 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) | |
2b469e60 | 28 | #:use-module (guix download) |
0061079a | 29 | #:use-module (guix git-download) |
0f01493d | 30 | #:use-module (guix download) |
0061079a EB |
31 | #:use-module (gnu packages autotools) |
32 | #:use-module (gnu packages base) | |
2b469e60 CB |
33 | #:use-module (gnu packages boost) |
34 | #:use-module (gnu packages check) | |
0061079a EB |
35 | #:use-module (gnu packages docbook) |
36 | #:use-module (gnu packages compression) | |
37 | #:use-module (gnu packages databases) | |
38 | #:use-module (gnu packages guile) | |
0791437f | 39 | #:use-module (gnu packages guile-xyz) |
7903f00a | 40 | #:use-module (gnu packages gnupg) |
2b469e60 | 41 | #:use-module (gnu packages lisp-xyz) |
0061079a | 42 | #:use-module (gnu packages mail) |
0061079a EB |
43 | #:use-module (gnu packages package-management) |
44 | #:use-module (gnu packages perl) | |
21b41a79 | 45 | #:use-module (gnu packages perl-compression) |
0061079a | 46 | #:use-module (gnu packages pkg-config) |
2b469e60 CB |
47 | #:use-module (gnu packages serialization) |
48 | #:use-module (gnu packages sqlite) | |
cc2b77df | 49 | #:use-module (gnu packages tls) |
44ccd962 | 50 | #:use-module (gnu packages texinfo) |
0061079a EB |
51 | #:use-module (gnu packages version-control) |
52 | #:use-module (gnu packages web) | |
53 | #:use-module (gnu packages xml) | |
2b469e60 | 54 | #:use-module (guix build-system cmake) |
b94cf161 | 55 | #:use-module (guix build-system gnu)) |
0061079a | 56 | |
744b07bd MO |
57 | (define-public guile-squee-dev |
58 | (let ((commit "e0614273ad4067af82f508db51c8a100131151ea") | |
59 | (revision "3")) | |
60 | (package | |
61 | (inherit guile-squee) | |
62 | (name "guile-squee") | |
63 | (version (string-append "0-" revision "." (string-take commit 7))) | |
64 | (home-page "https://notabug.org/mothacehe/guile-squee.git") | |
65 | (source (origin | |
66 | (method git-fetch) | |
67 | (uri (git-reference | |
68 | (url home-page) | |
69 | (commit commit))) | |
70 | (sha256 | |
71 | (base32 | |
72 | "1jps14z8653ah2kr367iayzyi3ql2s55l77xrafz7gk3mzcvgrrg")) | |
73 | (file-name (string-append name "-" version "-checkout"))))))) | |
74 | ||
365de1e7 | 75 | (define-public cuirass |
7f35431e MO |
76 | (let ((commit "f9a5dbd54eaa7fa8ac173fd5e68209f937840d90") |
77 | (revision "1")) | |
365de1e7 ML |
78 | (package |
79 | (name "cuirass") | |
7f35431e | 80 | (version (git-version "1.1.0" revision commit)) |
ff52d115 MO |
81 | (source |
82 | (origin | |
83 | (method git-fetch) | |
84 | (uri (git-reference | |
85 | (url "https://git.savannah.gnu.org/git/guix/guix-cuirass.git") | |
86 | (commit commit))) | |
87 | (file-name (git-file-name name version)) | |
88 | (sha256 | |
89 | (base32 | |
7f35431e | 90 | "0wrx2bf1gdnbkfgmmqr46s1fhvv3568yi7hxb24plf4xx5jq5yg8")))) |
365de1e7 ML |
91 | (build-system gnu-build-system) |
92 | (arguments | |
9d722958 | 93 | `(#:modules ((guix build utils) |
0d43b12d LC |
94 | (guix build gnu-build-system) |
95 | (ice-9 rdelim) | |
96 | (ice-9 popen)) | |
134a2c4a | 97 | #:configure-flags '("--localstatedir=/var") ;for /var/log/cuirass |
931572d2 MO |
98 | ;; XXX: HTTP tests fail on aarch64 due to Fibers errors, disable them |
99 | ;; on that architecture for now. | |
100 | #:tests? ,(let ((s (or (%current-target-system) | |
101 | (%current-system)))) | |
102 | (not (string-prefix? "aarch64" s))) | |
d1e16827 | 103 | #:parallel-tests? #f |
0d43b12d | 104 | #:phases |
365de1e7 | 105 | (modify-phases %standard-phases |
9d722958 MO |
106 | (add-before 'bootstrap 'fix-version-gen |
107 | (lambda _ | |
108 | (patch-shebang "build-aux/git-version-gen") | |
109 | ||
110 | (call-with-output-file ".tarball-version" | |
111 | (lambda (port) | |
112 | (display ,version port))))) | |
ff52d115 MO |
113 | (add-before 'check 'set-PATH-for-tests |
114 | (lambda* (#:key inputs #:allow-other-keys) | |
115 | (let ((pg (assoc-ref inputs "ephemeralpg")) | |
116 | (path (getenv "PATH"))) | |
117 | (setenv "PATH" (string-append pg "/bin:" path)) | |
118 | #t))) | |
d1e16827 MO |
119 | ;; Disable the remote tests that require a Guix daemon connection. |
120 | (add-before 'check 'disable-remote-tests | |
121 | (lambda _ | |
122 | (substitute* "Makefile.am" | |
123 | (("tests/remote.scm") "")) | |
124 | #t)) | |
365de1e7 ML |
125 | (add-after 'install 'wrap-program |
126 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
127 | ;; Wrap the 'cuirass' command to refer to the right modules. | |
128 | (let* ((out (assoc-ref outputs "out")) | |
0f01493d | 129 | (avahi (assoc-ref inputs "guile-avahi")) |
7903f00a | 130 | (gcrypt (assoc-ref inputs "guile-gcrypt")) |
365de1e7 | 131 | (json (assoc-ref inputs "guile-json")) |
0f01493d MO |
132 | (zmq (assoc-ref inputs "guile-simple-zmq")) |
133 | (squee (assoc-ref inputs "guile-squee")) | |
a6d05444 RW |
134 | (git (assoc-ref inputs "guile-git")) |
135 | (bytes (assoc-ref inputs "guile-bytestructures")) | |
d1688e6a | 136 | (fibers (assoc-ref inputs "guile-fibers")) |
7f765a9d | 137 | (zlib (assoc-ref inputs "guile-zlib")) |
0e5bc144 | 138 | (matd (assoc-ref inputs "guile-mastodon")) |
108e2c61 | 139 | (tls (assoc-ref inputs "gnutls")) |
0e5bc144 | 140 | (mail (assoc-ref inputs "mailutils")) |
365de1e7 | 141 | (guix (assoc-ref inputs "guix")) |
0f01493d | 142 | (deps (list avahi gcrypt json zmq squee git bytes |
108e2c61 | 143 | fibers zlib matd tls mail guix)) |
8190f5bb | 144 | (guile (assoc-ref inputs "guile")) |
ff52d115 MO |
145 | (effective |
146 | (read-line | |
147 | (open-pipe* OPEN_READ | |
148 | (string-append guile "/bin/guile") | |
149 | "-c" "(display (effective-version))"))) | |
150 | (mods | |
151 | (string-drop-right ;drop trailing colon | |
152 | (string-join deps | |
153 | (string-append "/share/guile/site/" | |
154 | effective ":") | |
155 | 'suffix) | |
156 | 1)) | |
157 | (objs | |
158 | (string-drop-right | |
159 | (string-join deps | |
160 | (string-append "/lib/guile/" effective | |
161 | "/site-ccache:") | |
162 | 'suffix) | |
163 | 1))) | |
d1e16827 MO |
164 | ;; Make sure 'cuirass' can find the relevant Guile modules. |
165 | (wrap-program (string-append out "/bin/cuirass") | |
166 | `("PATH" ":" prefix (,(string-append out "/bin"))) | |
167 | `("GUILE_LOAD_PATH" ":" prefix (,mods)) | |
168 | `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs))) | |
2eadd828 | 169 | #t)))))) |
365de1e7 | 170 | (inputs |
0b17de06 | 171 | `(("guile" ,guile-3.0/libgc-7) |
0f01493d | 172 | ("guile-avahi" ,guile-avahi) |
d1688e6a | 173 | ("guile-fibers" ,guile-fibers) |
7903f00a | 174 | ("guile-gcrypt" ,guile-gcrypt) |
8f7cf3b5 | 175 | ("guile-json" ,guile-json-4) |
0f01493d | 176 | ("guile-simple-zmq" ,guile-simple-zmq) |
83d21785 | 177 | ("guile-squee" ,guile-squee-dev) |
a6d05444 | 178 | ("guile-git" ,guile-git) |
7f765a9d | 179 | ("guile-zlib" ,guile-zlib) |
03bf951f | 180 | ("guile-mastodon" ,guile-mastodon) |
108e2c61 | 181 | ("gnutls" ,gnutls) |
0e5bc144 | 182 | ("mailutils" ,mailutils) |
a6d05444 RW |
183 | ;; FIXME: this is propagated by "guile-git", but it needs to be among |
184 | ;; the inputs to add it to GUILE_LOAD_PATH. | |
185 | ("guile-bytestructures" ,guile-bytestructures) | |
186 | ("guix" ,guix))) | |
365de1e7 ML |
187 | (native-inputs |
188 | `(("autoconf" ,autoconf) | |
189 | ("automake" ,automake) | |
44ccd962 | 190 | ("pkg-config" ,pkg-config) |
ff52d115 MO |
191 | ("texinfo" ,texinfo) |
192 | ("ephemeralpg" ,ephemeralpg))) | |
1501cb55 LC |
193 | (native-search-paths |
194 | ;; For HTTPS access, Cuirass itself honors these variables, with the | |
195 | ;; same semantics as Git and OpenSSL (respectively). | |
196 | (list (search-path-specification | |
197 | (variable "GIT_SSL_CAINFO") | |
198 | (file-type 'regular) | |
199 | (separator #f) ;single entry | |
200 | (files '("etc/ssl/certs/ca-certificates.crt"))) | |
201 | (search-path-specification | |
202 | (variable "SSL_CERT_DIR") | |
203 | (files '("etc/ssl/certs"))))) | |
365de1e7 ML |
204 | (synopsis "Continuous integration system") |
205 | (description | |
206 | "Cuirass is a continuous integration tool using GNU Guix. It is | |
207 | intended as a replacement for Hydra.") | |
bbd04a4c | 208 | (home-page "https://guix.gnu.org/cuirass/") |
365de1e7 | 209 | (license l:gpl3+)))) |
2b469e60 CB |
210 | |
211 | (define-public laminar | |
212 | (package | |
213 | (name "laminar") | |
214 | (version "1.0") | |
215 | (source | |
216 | (origin (method url-fetch) | |
217 | (uri (string-append "https://github.com/ohwgiles/laminar/archive/" | |
218 | version | |
219 | ".tar.gz")) | |
220 | (file-name (string-append name "-" version ".tar.gz")) | |
221 | (sha256 | |
222 | (base32 | |
223 | "11m6h3rdmj2rsmsryy7r40gqccj4gg1cnqwy6blscs87gx4s423g")))) | |
224 | (build-system cmake-build-system) | |
225 | (arguments | |
226 | `(#:tests? #f ; TODO Can't build tests | |
227 | #:configure-flags | |
228 | (list "-DCMAKE_CXX_STANDARD=17" | |
229 | ;; "-DBUILD_TESTS=true" TODO: objcopy: js/stPskyUS: can't add | |
230 | ;; section '.note.GNU-stack': file format not recognized | |
231 | (string-append "-DLAMINAR_VERSION=" ,version)) | |
232 | #:phases | |
233 | (modify-phases %standard-phases | |
234 | (add-after 'unpack 'patch-CMakeLists.txt | |
235 | (lambda _ | |
236 | (substitute* "CMakeLists.txt" | |
237 | (("file\\(DOWNLOAD.*\n$") | |
238 | "# file download removed by Guix --") | |
239 | (("install\\(FILES etc/laminar.service DESTINATION \\$\\{SYSTEMD\\_UNITDIR\\}\\)") | |
240 | "") | |
241 | (("install\\(FILES \\$\\{CMAKE\\_CURRENT\\_BINARY\\_DIR\\}\\/laminar\\.service DESTINATION \\$\\{SYSTEMD\\_UNITDIR\\}\\)") | |
242 | "") | |
243 | (("install\\(FILES etc/laminar\\.conf DESTINATION \\/etc\\)") "") | |
244 | (("\\/usr\\/") "")) | |
245 | #t)) | |
246 | (add-after 'configure 'copy-in-javascript-and-css | |
247 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
248 | (use-modules (ice-9 popen)) | |
249 | ||
250 | (mkdir-p "../build/js") | |
251 | (for-each (lambda (name) | |
252 | (let* ((file | |
253 | (assoc-ref inputs (string-append name ".js"))) | |
254 | (port | |
255 | (open-pipe* OPEN_READ "uglify-js" file)) | |
256 | (destination | |
257 | (string-append | |
258 | "../build/js/" name ".min.js"))) | |
259 | ||
260 | (call-with-output-file destination | |
261 | (lambda (output-port) | |
262 | (dump-port port output-port))) | |
263 | ||
264 | (let ((exit (close-pipe port))) | |
265 | (unless (zero? exit) | |
266 | (error "uglify-js failed" exit))))) | |
267 | ||
268 | '("vue" | |
269 | "vue-router" | |
270 | "Chart")) | |
271 | ||
272 | ;; ansi_up.js isn't minified | |
273 | (copy-file (assoc-ref inputs "ansi_up.js") | |
274 | "../build/js/ansi_up.js") | |
275 | ||
276 | #t))))) | |
277 | (inputs | |
278 | `(("capnproto" ,capnproto) | |
279 | ("rapidjson" ,rapidjson) | |
280 | ("sqlite" ,sqlite) | |
281 | ("boost" ,boost) | |
282 | ("zlib" ,zlib))) | |
283 | (native-inputs | |
284 | `(("googletest" ,googletest) | |
285 | ("uglify-js" ,uglify-js) | |
286 | ||
287 | ("vue.js" | |
288 | ,(origin (method url-fetch) | |
289 | (uri (string-append "https://raw.githubusercontent.com/" | |
290 | "vuejs/vue/v2.6.12/dist/vue.js")) | |
291 | (sha256 | |
292 | (base32 | |
293 | "1mq2dn6yqbmzar77xf4x2bvvanf9xc9nwfq06sksl5zmr300m7qm")))) | |
294 | ("vue-router.js" | |
295 | ,(origin (method url-fetch) | |
296 | (uri (string-append "https://raw.githubusercontent.com/" | |
297 | "vuejs/vue-router/v3.4.8/dist/vue-router.js")) | |
298 | (sha256 | |
299 | (base32 | |
300 | "1hkrbgzhpnrsb4zdafslqagy1vkac6bkdj7kh49js2lhkp9z4nj5")))) | |
301 | ("ansi_up.js" | |
302 | ,(origin (method url-fetch) | |
303 | (uri (string-append "https://raw.githubusercontent.com/" | |
304 | "drudru/ansi_up/v1.3.0/ansi_up.js")) | |
305 | (sha256 | |
306 | (base32 | |
307 | "1993dywxqi2ylnxybwk7m0s0bg2bq7kfllpyr0s8ck6chd0p8i6r")))) | |
308 | ("Chart.js" | |
309 | ,(origin (method url-fetch) | |
310 | (uri (string-append "https://github.com/chartjs/Chart.js/" | |
311 | "releases/download/v2.7.2/Chart.js")) | |
312 | (sha256 | |
313 | (base32 | |
314 | "05m3gk6hqjx92j20drnk7q075qpjraywqaf25lnglmsgsgpiqsr7")))))) | |
315 | (synopsis "Lightweight continuous integration service") | |
316 | (description | |
317 | "Laminar is a lightweight and modular continuous integration service. It | |
318 | doesn't have a configuration web UI instead uses version-controllable | |
319 | configuration files and scripts. | |
320 | ||
321 | Laminar encourages the use of existing tools such as bash and cron instead of | |
322 | reinventing them.") | |
323 | (home-page "https://laminar.ohwg.net/") | |
324 | (license l:gpl3+))) |