summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-10-12 22:05:39 +0200
committerLudovic Courtès <ludo@gnu.org>2023-10-12 22:14:34 +0200
commitf0c929f1e672a9c77ec681f7d548c26c63ff7b83 (patch)
tree4ba504e9cc64b2894d1afc6b7474cea3fe2f9d9d
parent2588fb98f0a99dc90aa70b45039b56a15d1f6cb1 (diff)
gnu: cuirass: Use gexps.
* gnu/packages/ci.scm (cuirass)[arguments]: Rewrite as per ‘guix style -S arguments’.
-rw-r--r--gnu/packages/ci.scm107
1 files changed, 56 insertions, 51 deletions
diff --git a/gnu/packages/ci.scm b/gnu/packages/ci.scm
index fb6ad49a413..e0bf59b6163 100644
--- a/gnu/packages/ci.scm
+++ b/gnu/packages/ci.scm
@@ -29,6 +29,7 @@
29 #:use-module (guix download) 29 #:use-module (guix download)
30 #:use-module (guix git-download) 30 #:use-module (guix git-download)
31 #:use-module (guix download) 31 #:use-module (guix download)
32 #:use-module (guix gexp)
32 #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR)) 33 #:use-module ((guix search-paths) #:select ($SSL_CERT_DIR))
33 #:use-module (gnu packages autotools) 34 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages base) 35 #:use-module (gnu packages base)
@@ -75,59 +76,63 @@
75 "16d9ylzk8mwsgppfdxyl0k2mkwll7fq17d6v09406rqkgddxg3m2")))) 76 "16d9ylzk8mwsgppfdxyl0k2mkwll7fq17d6v09406rqkgddxg3m2"))))
76 (build-system gnu-build-system) 77 (build-system gnu-build-system)
77 (arguments 78 (arguments
78 `(#:modules ((guix build utils) 79 (list #:modules `((guix build utils)
79 (guix build gnu-build-system) 80 (guix build gnu-build-system)
80 (ice-9 match) 81 (ice-9 match)
81 (ice-9 rdelim) 82 (ice-9 rdelim)
82 (ice-9 popen) 83 (ice-9 popen)
83 (srfi srfi-1)) 84 (srfi srfi-1))
84 #:configure-flags '("--localstatedir=/var") ;for /var/log/cuirass 85 #:configure-flags #~'("--localstatedir=/var") ;for /var/log/cuirass
85 ;; XXX: HTTP tests fail on aarch64 due to Fibers errors, disable them 86 ;; XXX: HTTP tests fail on aarch64 due to Fibers errors, disable them
86 ;; on that architecture for now. 87 ;; on that architecture for now.
87 #:tests? ,(let ((s (or (%current-target-system) 88 #:tests? (let ((s (or (%current-target-system)
88 (%current-system)))) 89 (%current-system))))
89 (not (string-prefix? "aarch64" s))) 90 (not (string-prefix? "aarch64" s)))
90 #:parallel-tests? #f 91 #:parallel-tests? #f
91 #:phases 92 #:phases
92 (modify-phases %standard-phases 93 #~(modify-phases %standard-phases
93 (add-before 'bootstrap 'fix-version-gen 94 (add-before 'bootstrap 'fix-version-gen
94 (lambda _ 95 (lambda _
95 (patch-shebang "build-aux/git-version-gen") 96 (patch-shebang "build-aux/git-version-gen")
96 97
97 (call-with-output-file ".tarball-version" 98 (call-with-output-file ".tarball-version"
98 (lambda (port) 99 (lambda (port)
99 (display ,version port))))) 100 (display #$(package-version this-package) port)))))
100 (add-after 'install 'wrap-program 101 (add-after 'install 'wrap-program
101 (lambda* (#:key inputs outputs #:allow-other-keys) 102 (lambda* (#:key inputs outputs #:allow-other-keys)
102 ;; Wrap the 'cuirass' command to refer to the right modules. 103 ;; Wrap the 'cuirass' command to refer to the right modules.
103 ;; Do so by collecting the subset of INPUTS that provides Guile 104 ;; Do so by collecting the subset of INPUTS that provides Guile
104 ;; modules. This includes direct inputs as well as their 105 ;; modules. This includes direct inputs as well as their
105 ;; propagated inputs--e.g., 'guix' propagates 'guile-zstd'. 106 ;; propagated inputs--e.g., 'guix' propagates 'guile-zstd'.
106 (define (sub-directory suffix) 107 (define (sub-directory suffix)
107 (match-lambda 108 (match-lambda
108 ((label . directory) 109 ((label . directory)
109 (let ((directory (string-append directory suffix))) 110 (let ((directory (string-append directory suffix)))
110 (and (directory-exists? directory) 111 (and (directory-exists? directory)
111 directory))))) 112 directory)))))
112 113
113 (let* ((out (assoc-ref outputs "out")) 114 (let* ((out (assoc-ref outputs "out"))
114 (effective 115 (effective
115 (read-line 116 (read-line
116 (open-pipe* OPEN_READ (which "guile") 117 (open-pipe* OPEN_READ (which "guile") "-c"
117 "-c" "(display (effective-version))"))) 118 "(display (effective-version))")))
118 (mods (filter-map (sub-directory 119 (mods (filter-map (sub-directory
119 (string-append "/share/guile/site/" 120 (string-append
120 effective)) 121 "/share/guile/site/"
121 inputs)) 122 effective))
122 (objs (filter-map (sub-directory 123 inputs))
123 (string-append "/lib/guile/" 124 (objs (filter-map (sub-directory
124 effective 125 (string-append
125 "/site-ccache")) 126 "/lib/guile/" effective
126 inputs))) 127 "/site-ccache"))
127 (wrap-program (string-append out "/bin/cuirass") 128 inputs)))
128 `("PATH" ":" prefix (,(string-append out "/bin"))) 129 (wrap-program (string-append out "/bin/cuirass")
129 `("GUILE_LOAD_PATH" ":" prefix ,mods) 130 `("PATH" ":" prefix
130 `("GUILE_LOAD_COMPILED_PATH" ":" prefix ,objs)))))))) 131 (,(string-append out "/bin")))
132 `("GUILE_LOAD_PATH" ":" prefix
133 ,mods)
134 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
135 ,objs))))))))
131 (inputs 136 (inputs
132 (list guile-3.0-latest 137 (list guile-3.0-latest
133 guile-avahi 138 guile-avahi