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, 2021 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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 download)
29 #:use-module (guix git-download)
30 #:use-module (guix download)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages base)
33 #:use-module (gnu packages boost)
34 #:use-module (gnu packages check)
35 #:use-module (gnu packages docbook)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages databases)
38 #:use-module (gnu packages guile)
39 #:use-module (gnu packages guile-xyz)
40 #:use-module (gnu packages gnupg)
41 #:use-module (gnu packages lisp-xyz)
42 #:use-module (gnu packages mail)
43 #:use-module (gnu packages package-management)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages perl-compression)
46 #:use-module (gnu packages pkg-config)
47 #:use-module (gnu packages serialization)
48 #:use-module (gnu packages sqlite)
49 #:use-module (gnu packages tls)
50 #:use-module (gnu packages texinfo)
51 #:use-module (gnu packages version-control)
52 #:use-module (gnu packages web)
53 #:use-module (gnu packages xml)
54 #:use-module (guix build-system cmake)
55 #:use-module (guix build-system gnu))
57 (define-public cuirass
58 (let ((commit "7542d626dc476c7e00fc8e756e97f498fb272f45")
62 (version (git-version "1.0.0" revision commit))
67 (url "https://git.savannah.gnu.org/git/guix/guix-cuirass.git")
69 (file-name (git-file-name name version))
72 "0w7isma75w0m65v6mkjkg5ysd0qn9bz51rnps4g845qra2jc1h7s"))))
73 (build-system gnu-build-system)
75 `(#:modules ((guix build utils)
76 (guix build gnu-build-system)
79 #:configure-flags '("--localstatedir=/var") ;for /var/log/cuirass
82 (modify-phases %standard-phases
83 (add-before 'bootstrap 'fix-version-gen
85 (patch-shebang "build-aux/git-version-gen")
87 (call-with-output-file ".tarball-version"
89 (display ,version port)))))
90 (add-before 'check 'set-PATH-for-tests
91 (lambda* (#:key inputs #:allow-other-keys)
92 (let ((pg (assoc-ref inputs "ephemeralpg"))
93 (path (getenv "PATH")))
94 (setenv "PATH" (string-append pg "/bin:" path))
96 ;; Disable the remote tests that require a Guix daemon connection.
97 (add-before 'check 'disable-remote-tests
99 (substitute* "Makefile.am"
100 (("tests/remote.scm") ""))
102 (add-after 'install 'wrap-program
103 (lambda* (#:key inputs outputs #:allow-other-keys)
104 ;; Wrap the 'cuirass' command to refer to the right modules.
105 (let* ((out (assoc-ref outputs "out"))
106 (avahi (assoc-ref inputs "guile-avahi"))
107 (gcrypt (assoc-ref inputs "guile-gcrypt"))
108 (json (assoc-ref inputs "guile-json"))
109 (zmq (assoc-ref inputs "guile-simple-zmq"))
110 (squee (assoc-ref inputs "guile-squee"))
111 (git (assoc-ref inputs "guile-git"))
112 (bytes (assoc-ref inputs "guile-bytestructures"))
113 (fibers (assoc-ref inputs "guile-fibers"))
114 (zlib (assoc-ref inputs "guile-zlib"))
115 (matd (assoc-ref inputs "guile-mastodon"))
116 (tls (assoc-ref inputs "gnutls"))
117 (mail (assoc-ref inputs "mailutils"))
118 (guix (assoc-ref inputs "guix"))
119 (deps (list avahi gcrypt json zmq squee git bytes
120 fibers zlib matd tls mail guix))
121 (guile (assoc-ref %build-inputs "guile"))
124 (open-pipe* OPEN_READ
125 (string-append guile "/bin/guile")
126 "-c" "(display (effective-version))")))
128 (string-drop-right ;drop trailing colon
130 (string-append "/share/guile/site/"
137 (string-append "/lib/guile/" effective
141 ;; Make sure 'cuirass' can find the relevant Guile modules.
142 (wrap-program (string-append out "/bin/cuirass")
143 `("PATH" ":" prefix (,(string-append out "/bin")))
144 `("GUILE_LOAD_PATH" ":" prefix (,mods))
145 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs)))
148 `(("guile" ,guile-3.0/libgc-7)
149 ("guile-avahi" ,guile-avahi)
150 ("guile-fibers" ,guile-fibers)
151 ("guile-gcrypt" ,guile-gcrypt)
152 ("guile-json" ,guile-json-4)
153 ("guile-simple-zmq" ,guile-simple-zmq)
154 ("guile-squee" ,guile-squee)
155 ("guile-git" ,guile-git)
156 ("guile-zlib" ,guile-zlib)
157 ("guile-mastodon" ,guile-mastodon)
159 ("mailutils" ,mailutils)
160 ;; FIXME: this is propagated by "guile-git", but it needs to be among
161 ;; the inputs to add it to GUILE_LOAD_PATH.
162 ("guile-bytestructures" ,guile-bytestructures)
165 `(("autoconf" ,autoconf)
166 ("automake" ,automake)
167 ("pkg-config" ,pkg-config)
169 ("ephemeralpg" ,ephemeralpg)))
171 ;; For HTTPS access, Cuirass itself honors these variables, with the
172 ;; same semantics as Git and OpenSSL (respectively).
173 (list (search-path-specification
174 (variable "GIT_SSL_CAINFO")
176 (separator #f) ;single entry
177 (files '("etc/ssl/certs/ca-certificates.crt")))
178 (search-path-specification
179 (variable "SSL_CERT_DIR")
180 (files '("etc/ssl/certs")))))
181 (synopsis "Continuous integration system")
183 "Cuirass is a continuous integration tool using GNU Guix. It is
184 intended as a replacement for Hydra.")
185 (home-page "https://guix.gnu.org/cuirass/")
188 (define-public laminar
193 (origin (method url-fetch)
194 (uri (string-append "https://github.com/ohwgiles/laminar/archive/"
197 (file-name (string-append name "-" version ".tar.gz"))
200 "11m6h3rdmj2rsmsryy7r40gqccj4gg1cnqwy6blscs87gx4s423g"))))
201 (build-system cmake-build-system)
203 `(#:tests? #f ; TODO Can't build tests
205 (list "-DCMAKE_CXX_STANDARD=17"
206 ;; "-DBUILD_TESTS=true" TODO: objcopy: js/stPskyUS: can't add
207 ;; section '.note.GNU-stack': file format not recognized
208 (string-append "-DLAMINAR_VERSION=" ,version))
210 (modify-phases %standard-phases
211 (add-after 'unpack 'patch-CMakeLists.txt
213 (substitute* "CMakeLists.txt"
214 (("file\\(DOWNLOAD.*\n$")
215 "# file download removed by Guix --")
216 (("install\\(FILES etc/laminar.service DESTINATION \\$\\{SYSTEMD\\_UNITDIR\\}\\)")
218 (("install\\(FILES \\$\\{CMAKE\\_CURRENT\\_BINARY\\_DIR\\}\\/laminar\\.service DESTINATION \\$\\{SYSTEMD\\_UNITDIR\\}\\)")
220 (("install\\(FILES etc/laminar\\.conf DESTINATION \\/etc\\)") "")
223 (add-after 'configure 'copy-in-javascript-and-css
224 (lambda* (#:key inputs outputs #:allow-other-keys)
225 (use-modules (ice-9 popen))
227 (mkdir-p "../build/js")
228 (for-each (lambda (name)
230 (assoc-ref inputs (string-append name ".js")))
232 (open-pipe* OPEN_READ "uglify-js" file))
235 "../build/js/" name ".min.js")))
237 (call-with-output-file destination
238 (lambda (output-port)
239 (dump-port port output-port)))
241 (let ((exit (close-pipe port)))
243 (error "uglify-js failed" exit)))))
249 ;; ansi_up.js isn't minified
250 (copy-file (assoc-ref inputs "ansi_up.js")
251 "../build/js/ansi_up.js")
255 `(("capnproto" ,capnproto)
256 ("rapidjson" ,rapidjson)
261 `(("googletest" ,googletest)
262 ("uglify-js" ,uglify-js)
265 ,(origin (method url-fetch)
266 (uri (string-append "https://raw.githubusercontent.com/"
267 "vuejs/vue/v2.6.12/dist/vue.js"))
270 "1mq2dn6yqbmzar77xf4x2bvvanf9xc9nwfq06sksl5zmr300m7qm"))))
272 ,(origin (method url-fetch)
273 (uri (string-append "https://raw.githubusercontent.com/"
274 "vuejs/vue-router/v3.4.8/dist/vue-router.js"))
277 "1hkrbgzhpnrsb4zdafslqagy1vkac6bkdj7kh49js2lhkp9z4nj5"))))
279 ,(origin (method url-fetch)
280 (uri (string-append "https://raw.githubusercontent.com/"
281 "drudru/ansi_up/v1.3.0/ansi_up.js"))
284 "1993dywxqi2ylnxybwk7m0s0bg2bq7kfllpyr0s8ck6chd0p8i6r"))))
286 ,(origin (method url-fetch)
287 (uri (string-append "https://github.com/chartjs/Chart.js/"
288 "releases/download/v2.7.2/Chart.js"))
291 "05m3gk6hqjx92j20drnk7q075qpjraywqaf25lnglmsgsgpiqsr7"))))))
292 (synopsis "Lightweight continuous integration service")
294 "Laminar is a lightweight and modular continuous integration service. It
295 doesn't have a configuration web UI instead uses version-controllable
296 configuration files and scripts.
298 Laminar encourages the use of existing tools such as bash and cron instead of
300 (home-page "https://laminar.ohwg.net/")