gnu: guile-wisp: Simplify arguments and fix indentation.

* gnu/packages/guile.scm (guile-wisp)[arguments]: Slightly simplify and fix
indentation.
This commit is contained in:
Ricardo Wurmus 2019-01-23 12:26:48 +01:00
parent ef841dca91
commit a38fa63b4b
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 29 additions and 38 deletions

View File

@ -1303,49 +1303,40 @@ key-value cache and store.")
(guix build utils) (guix build utils)
(ice-9 rdelim) (ice-9 rdelim)
(ice-9 popen)) (ice-9 popen))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-before 'configure 'substitute-before-config (add-before 'configure 'patch-/usr/bin/env
(lambda _
(lambda* (#:key inputs #:allow-other-keys) (substitute* "Makefile.in"
(let ((bash (assoc-ref inputs "bash"))) (("/usr/bin/env bash") (which "bash"))
;; Puts together some test files with /bin/bash hardcoded (("\\$\\(GUILE_EFFECTIVE_VERSION\\)/site")
(substitute* "Makefile.in" "site/$(GUILE_EFFECTIVE_VERSION)")) ;use the right order
(("/usr/bin/env bash") #t))
(string-append bash "/bin/bash"))
(("\\$\\(GUILE_EFFECTIVE_VERSION\\)/site")
"site/$(GUILE_EFFECTIVE_VERSION)")) ;use the right order
#t)))
;; auto compilation breaks, but if we set HOME to /tmp, ;; auto compilation breaks, but if we set HOME to /tmp,
;; that works ok ;; that works ok
(add-before (add-before 'check 'auto-compile-hacky-workaround
'check 'auto-compile-hacky-workaround (lambda _ (setenv "HOME" "/tmp") #t))
(lambda _
(setenv "HOME" "/tmp")
#t))
(add-after 'install 'install-go-files (add-after 'install 'install-go-files
(lambda* (#:key outputs inputs #:allow-other-keys) (lambda* (#:key outputs inputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
(effective (read-line (effective (read-line
(open-pipe* OPEN_READ (open-pipe* OPEN_READ
"guile" "-c" "guile" "-c"
"(display (effective-version))"))) "(display (effective-version))")))
(module-dir (string-append out "/share/guile/site/" (module-dir (string-append out "/share/guile/site/"
effective)) effective))
(object-dir (string-append out "/lib/guile/" effective (object-dir (string-append out "/lib/guile/" effective
"/site-ccache")) "/site-ccache"))
(prefix (string-length module-dir))) (prefix (string-length module-dir)))
;; compile to the destination ;; compile to the destination
(for-each (lambda (file) (for-each (lambda (file)
(let* ((base (string-drop (string-drop-right file 4) (let* ((base (string-drop (string-drop-right file 4)
prefix)) prefix))
(go (string-append object-dir base ".go"))) (go (string-append object-dir base ".go")))
(invoke "guild" "compile" "-L" module-dir (invoke "guild" "compile" "-L" module-dir
file "-o" go))) file "-o" go)))
(find-files module-dir "\\.scm$")) (find-files module-dir "\\.scm$"))
#t)))))) #t))))))
(home-page "https://draketo.de/english/wisp") (home-page "https://draketo.de/english/wisp")
(inputs (inputs
`(("guile" ,guile-2.2))) `(("guile" ,guile-2.2)))