summaryrefslogtreecommitdiff
path: root/gnu/packages/autotools.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-07-17 00:00:48 +0200
committerMarius Bakke <marius@gnu.org>2022-07-23 19:43:10 +0200
commit9e4b3391c559ac4c6b5bedf08f8350b51948eaa2 (patch)
tree320c6ece8def1ba5a46196889f087c084a0ee2ae /gnu/packages/autotools.scm
parent8fa17cb6d51901b2c8a0e20954c5b19f8057c217 (diff)
gnu: make-autoconf-wrapper: Remove input labels.
* gnu/packages/autotools.scm (make-autoconf-wrapper)[inputs]: Remove labels. [arguments]: Use G-expression and SEARCH-INPUT-FILE.
Diffstat (limited to 'gnu/packages/autotools.scm')
-rw-r--r--gnu/packages/autotools.scm99
1 files changed, 47 insertions, 52 deletions
diff --git a/gnu/packages/autotools.scm b/gnu/packages/autotools.scm
index fb1b4751ee3..c702be43fac 100644
--- a/gnu/packages/autotools.scm
+++ b/gnu/packages/autotools.scm
@@ -205,70 +205,65 @@ know anything about Autoconf or M4.")
205use our own Bash instead of /bin/sh in shebangs. For that reason, it should 205use our own Bash instead of /bin/sh in shebangs. For that reason, it should
206only be used internally---users should not end up distributing `configure' 206only be used internally---users should not end up distributing `configure'
207files with a system-specific shebang." 207files with a system-specific shebang."
208 (package (inherit autoconf) 208 (package
209 (inherit autoconf)
209 (name (string-append (package-name autoconf) "-wrapper")) 210 (name (string-append (package-name autoconf) "-wrapper"))
210 (build-system trivial-build-system) 211 (build-system trivial-build-system)
211 (inputs `(("guile" 212 (inputs
212 ;; XXX: Kludge to hide the circular dependency. 213 (list
213 ,(module-ref (resolve-interface '(gnu packages guile)) 214 ;; XXX: Kludge to hide the circular dependency.
214 'guile-3.0/fixed)) 215 (module-ref (resolve-interface '(gnu packages guile))
215 ("autoconf" ,autoconf) 216 'guile-3.0/fixed)
216 ("bash" ,bash-minimal))) 217 autoconf
218 bash-minimal))
217 (arguments 219 (arguments
218 '(#:modules ((guix build utils)) 220 (list
219 #:builder 221 #:modules '((guix build utils))
220 (begin 222 #:builder
221 (use-modules (guix build utils)) 223 #~(begin
222 (let* ((out (assoc-ref %outputs "out")) 224 (use-modules (guix build utils))
223 (bin (string-append out "/bin")) 225 (let ((bin (string-append #$output "/bin"))
224 (autoconf (string-append 226 (autoconf (search-input-file %build-inputs "/bin/autoconf"))
225 (assoc-ref %build-inputs "autoconf") 227 (guile (search-input-file %build-inputs "/bin/guile"))
226 "/bin/autoconf")) 228 (sh (search-input-file %build-inputs "/bin/sh"))
227 (guile (string-append
228 (assoc-ref %build-inputs "guile")
229 "/bin/guile"))
230 (sh (string-append
231 (assoc-ref %build-inputs "bash")
232 "/bin/sh"))
233 (modules ((compose dirname dirname dirname) 229 (modules ((compose dirname dirname dirname)
234 (search-path %load-path 230 (search-path %load-path
235 "guix/build/utils.scm")))) 231 "guix/build/utils.scm"))))
236 (mkdir-p bin) 232 (mkdir-p bin)
237 233
238 ;; Symlink all the binaries but `autoconf'. 234 ;; Symlink all the binaries but `autoconf'.
239 (with-directory-excursion bin 235 (with-directory-excursion bin
240 (for-each (lambda (file) 236 (for-each (lambda (file)
241 (unless (string=? (basename file) "autoconf") 237 (unless (string=? (basename file) "autoconf")
242 (symlink file (basename file)))) 238 (symlink file (basename file))))
243 (find-files (dirname autoconf) ".*"))) 239 (find-files (dirname autoconf) ".*")))
244 240
245 ;; Add an `autoconf' binary that wraps the real one. 241 ;; Add an `autoconf' binary that wraps the real one.
246 (call-with-output-file (string-append bin "/autoconf") 242 (call-with-output-file (string-append bin "/autoconf")
247 (lambda (port) 243 (lambda (port)
248 ;; Shamefully, Guile can be used in shebangs only if a 244 ;; Shamefully, Guile can be used in shebangs only if a
249 ;; single argument is passed (-ds); otherwise it gets 245 ;; single argument is passed (-ds); otherwise it gets
250 ;; them all as a single argument and fails to parse them. 246 ;; them all as a single argument and fails to parse them.
251 (format port "#!~a 247 (format port "#!~a
252export GUILE_LOAD_PATH=\"~a\" 248export GUILE_LOAD_PATH=\"~a\"
253export GUILE_LOAD_COMPILED_PATH=\"~a\" 249export GUILE_LOAD_COMPILED_PATH=\"~a\"
254exec ~a --no-auto-compile \"$0\" \"$@\" 250exec ~a --no-auto-compile \"$0\" \"$@\"
255!#~%" 251!#~%"
256 sh modules modules guile) 252 sh modules modules guile)
257 (write 253 (write
258 `(begin 254 `(begin
259 (use-modules (guix build utils)) 255 (use-modules (guix build utils))
260 (let ((result (apply system* ,autoconf 256 (let ((result (apply system* ,autoconf
261 (cdr (command-line))))) 257 (cdr (command-line)))))
262 (when (and (file-exists? "configure") 258 (when (and (file-exists? "configure")
263 (not (file-exists? "/bin/sh"))) 259 (not (file-exists? "/bin/sh")))
264 ;; Patch regardless of RESULT, because `autoconf 260 ;; Patch regardless of RESULT, because `autoconf
265 ;; -Werror' can both create a `configure' file and 261 ;; -Werror' can both create a `configure' file and
266 ;; return a non-zero exit code. 262 ;; return a non-zero exit code.
267 (patch-shebang "configure")) 263 (patch-shebang "configure"))
268 (exit (status:exit-val result)))) 264 (exit (status:exit-val result))))
269 port))) 265 port)))
270 (chmod (string-append bin "/autoconf") #o555) 266 (chmod (string-append bin "/autoconf") #o555)))))
271 #t))))
272 267
273 ;; Do not show it in the UI since it's meant for internal use. 268 ;; Do not show it in the UI since it's meant for internal use.
274 (properties '((hidden? . #t))))) 269 (properties '((hidden? . #t)))))