gnu: guile-wisp: Move .go files to 'lib/guile/2.2/site-ccache'.

* gnu/packages/guile.scm (guile-wisp)[arguments]: Remove (system base
compile) from #:modules, and (ice-9 rdelim) and (ice-9 popen).
In 'install-go-files' phase, invoke 'guild' to compile, and write to
lib/guile/X.Y/site-ccache.
This commit is contained in:
Ludovic Courtès 2017-11-27 14:03:50 +01:00 committed by Ludovic Courtès
parent 89c4bfe7f8
commit e8374e6912
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1274,8 +1274,11 @@ (define-public guile-wisp
"1f2bbicq1rxnwmiplrm4r75wj06w385mjkyvi7g4k740bgwcrzxr"))))
(build-system gnu-build-system)
(arguments
`(#:modules ((system base compile)
,@%gnu-build-system-modules)
`(#:modules ((guix build gnu-build-system)
(guix build utils)
(ice-9 rdelim)
(ice-9 popen))
#:phases
(modify-phases %standard-phases
(add-before 'configure 'substitute-before-config
@ -1300,14 +1303,22 @@ (define-public guile-wisp
(add-after 'install 'install-go-files
(lambda* (#:key outputs inputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(module-dir (string-append out "/share/guile/site")))
(effective (read-line
(open-pipe* OPEN_READ
"guile" "-c"
"(display (effective-version))")))
(module-dir (string-append out "/share/guile/site/"
effective))
(object-dir (string-append out "/lib/guile/" effective
"/site-ccache"))
(prefix (string-length module-dir)))
;; compile to the destination
(for-each (lambda (file)
(compile-file file
#:output-file
(string-append
(string-drop-right file 4)
".go")))
(let* ((base (string-drop (string-drop-right file 4)
prefix))
(go (string-append object-dir base ".go")))
(invoke "guild" "compile" "-L" module-dir
file "-o" go)))
(find-files module-dir "\\.scm$"))
#t))))))
(home-page "http://draketo.de/english/wisp")