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 "e49368a8b30190c0e4351e78d21ae2d22b51a878")
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 "0kfaqrz2ajwvrii6lf4748wsx73vwv5bfhlr1r666wxrcszpqka7"))))
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
80 ;; XXX: HTTP tests fail on aarch64 due to Fibers errors, disable them
81 ;; on that architecture for now.
82 #:tests? ,(let ((s (or (%current-target-system)
84 (not (string-prefix? "aarch64" s)))
87 (modify-phases %standard-phases
88 (add-before 'bootstrap 'fix-version-gen
90 (patch-shebang "build-aux/git-version-gen")
92 (call-with-output-file ".tarball-version"
94 (display ,version port)))))
95 (add-before 'check 'set-PATH-for-tests
96 (lambda* (#:key inputs #:allow-other-keys)
97 (let ((pg (assoc-ref inputs "ephemeralpg"))
98 (path (getenv "PATH")))
99 (setenv "PATH" (string-append pg "/bin:" path))
101 ;; Disable the remote tests that require a Guix daemon connection.
102 (add-before 'check 'disable-remote-tests
104 (substitute* "Makefile.am"
105 (("tests/remote.scm") ""))
107 (add-after 'install 'wrap-program
108 (lambda* (#:key inputs outputs #:allow-other-keys)
109 ;; Wrap the 'cuirass' command to refer to the right modules.
110 (let* ((out (assoc-ref outputs "out"))
111 (avahi (assoc-ref inputs "guile-avahi"))
112 (gcrypt (assoc-ref inputs "guile-gcrypt"))
113 (json (assoc-ref inputs "guile-json"))
114 (zmq (assoc-ref inputs "guile-simple-zmq"))
115 (squee (assoc-ref inputs "guile-squee"))
116 (git (assoc-ref inputs "guile-git"))
117 (bytes (assoc-ref inputs "guile-bytestructures"))
118 (fibers (assoc-ref inputs "guile-fibers"))
119 (zlib (assoc-ref inputs "guile-zlib"))
120 (matd (assoc-ref inputs "guile-mastodon"))
121 (tls (assoc-ref inputs "gnutls"))
122 (mail (assoc-ref inputs "mailutils"))
123 (guix (assoc-ref inputs "guix"))
124 (deps (list avahi gcrypt json zmq squee git bytes
125 fibers zlib matd tls mail guix))
126 (guile (assoc-ref %build-inputs "guile"))
129 (open-pipe* OPEN_READ
130 (string-append guile "/bin/guile")
131 "-c" "(display (effective-version))")))
133 (string-drop-right ;drop trailing colon
135 (string-append "/share/guile/site/"
142 (string-append "/lib/guile/" effective
146 ;; Make sure 'cuirass' can find the relevant Guile modules.
147 (wrap-program (string-append out "/bin/cuirass")
148 `("PATH" ":" prefix (,(string-append out "/bin")))
149 `("GUILE_LOAD_PATH" ":" prefix (,mods))
150 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,objs)))
153 `(("guile" ,guile-3.0/libgc-7)
154 ("guile-avahi" ,guile-avahi)
155 ("guile-fibers" ,guile-fibers)
156 ("guile-gcrypt" ,guile-gcrypt)
157 ("guile-json" ,guile-json-4)
158 ("guile-simple-zmq" ,guile-simple-zmq)
159 ("guile-squee" ,guile-squee)
160 ("guile-git" ,guile-git)
161 ("guile-zlib" ,guile-zlib)
162 ("guile-mastodon" ,guile-mastodon)
164 ("mailutils" ,mailutils)
165 ;; FIXME: this is propagated by "guile-git", but it needs to be among
166 ;; the inputs to add it to GUILE_LOAD_PATH.
167 ("guile-bytestructures" ,guile-bytestructures)
170 `(("autoconf" ,autoconf)
171 ("automake" ,automake)
172 ("pkg-config" ,pkg-config)
174 ("ephemeralpg" ,ephemeralpg)))
176 ;; For HTTPS access, Cuirass itself honors these variables, with the
177 ;; same semantics as Git and OpenSSL (respectively).
178 (list (search-path-specification
179 (variable "GIT_SSL_CAINFO")
181 (separator #f) ;single entry
182 (files '("etc/ssl/certs/ca-certificates.crt")))
183 (search-path-specification
184 (variable "SSL_CERT_DIR")
185 (files '("etc/ssl/certs")))))
186 (synopsis "Continuous integration system")
188 "Cuirass is a continuous integration tool using GNU Guix. It is
189 intended as a replacement for Hydra.")
190 (home-page "https://guix.gnu.org/cuirass/")
193 (define-public laminar
198 (origin (method url-fetch)
199 (uri (string-append "https://github.com/ohwgiles/laminar/archive/"
202 (file-name (string-append name "-" version ".tar.gz"))
205 "11m6h3rdmj2rsmsryy7r40gqccj4gg1cnqwy6blscs87gx4s423g"))))
206 (build-system cmake-build-system)
208 `(#:tests? #f ; TODO Can't build tests
210 (list "-DCMAKE_CXX_STANDARD=17"
211 ;; "-DBUILD_TESTS=true" TODO: objcopy: js/stPskyUS: can't add
212 ;; section '.note.GNU-stack': file format not recognized
213 (string-append "-DLAMINAR_VERSION=" ,version))
215 (modify-phases %standard-phases
216 (add-after 'unpack 'patch-CMakeLists.txt
218 (substitute* "CMakeLists.txt"
219 (("file\\(DOWNLOAD.*\n$")
220 "# file download removed by Guix --")
221 (("install\\(FILES etc/laminar.service DESTINATION \\$\\{SYSTEMD\\_UNITDIR\\}\\)")
223 (("install\\(FILES \\$\\{CMAKE\\_CURRENT\\_BINARY\\_DIR\\}\\/laminar\\.service DESTINATION \\$\\{SYSTEMD\\_UNITDIR\\}\\)")
225 (("install\\(FILES etc/laminar\\.conf DESTINATION \\/etc\\)") "")
228 (add-after 'configure 'copy-in-javascript-and-css
229 (lambda* (#:key inputs outputs #:allow-other-keys)
230 (use-modules (ice-9 popen))
232 (mkdir-p "../build/js")
233 (for-each (lambda (name)
235 (assoc-ref inputs (string-append name ".js")))
237 (open-pipe* OPEN_READ "uglify-js" file))
240 "../build/js/" name ".min.js")))
242 (call-with-output-file destination
243 (lambda (output-port)
244 (dump-port port output-port)))
246 (let ((exit (close-pipe port)))
248 (error "uglify-js failed" exit)))))
254 ;; ansi_up.js isn't minified
255 (copy-file (assoc-ref inputs "ansi_up.js")
256 "../build/js/ansi_up.js")
260 `(("capnproto" ,capnproto)
261 ("rapidjson" ,rapidjson)
266 `(("googletest" ,googletest)
267 ("uglify-js" ,uglify-js)
270 ,(origin (method url-fetch)
271 (uri (string-append "https://raw.githubusercontent.com/"
272 "vuejs/vue/v2.6.12/dist/vue.js"))
275 "1mq2dn6yqbmzar77xf4x2bvvanf9xc9nwfq06sksl5zmr300m7qm"))))
277 ,(origin (method url-fetch)
278 (uri (string-append "https://raw.githubusercontent.com/"
279 "vuejs/vue-router/v3.4.8/dist/vue-router.js"))
282 "1hkrbgzhpnrsb4zdafslqagy1vkac6bkdj7kh49js2lhkp9z4nj5"))))
284 ,(origin (method url-fetch)
285 (uri (string-append "https://raw.githubusercontent.com/"
286 "drudru/ansi_up/v1.3.0/ansi_up.js"))
289 "1993dywxqi2ylnxybwk7m0s0bg2bq7kfllpyr0s8ck6chd0p8i6r"))))
291 ,(origin (method url-fetch)
292 (uri (string-append "https://github.com/chartjs/Chart.js/"
293 "releases/download/v2.7.2/Chart.js"))
296 "05m3gk6hqjx92j20drnk7q075qpjraywqaf25lnglmsgsgpiqsr7"))))))
297 (synopsis "Lightweight continuous integration service")
299 "Laminar is a lightweight and modular continuous integration service. It
300 doesn't have a configuration web UI instead uses version-controllable
301 configuration files and scripts.
303 Laminar encourages the use of existing tools such as bash and cron instead of
305 (home-page "https://laminar.ohwg.net/")