From e8374e6912718dad6b39a18ccc57fc735d2e4c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Mon, 27 Nov 2017 14:03:50 +0100 Subject: [PATCH] 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. --- gnu/packages/guile.scm | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm index 6d9c428521..fef15b4dc4 100644 --- a/gnu/packages/guile.scm +++ b/gnu/packages/guile.scm @@ -1274,8 +1274,11 @@ key-value cache and store.") "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 @@ key-value cache and store.") (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")