guile-gdbm-ffi: Write to correct guile output directory and use guild.

* gnu/packages/guile.scm (guile-gdbm-ffi): Check guile for effective version
before writing to output path.  Also fixes a bug where the guild command was
not getting called, and instead was calling the internal guile compile-file
procedure.  This meant that the package produced was dependent on whatever
version of guile was powering Guix at the time.  Also set GUILE_AUTO_COMPILE
to 0 to avoid gnarly looking warnings during build.
This commit is contained in:
Christopher Allan Webber 2017-02-10 19:24:57 -06:00
parent 80345600fa
commit a5bd6a5e15
No known key found for this signature in database
GPG Key ID: 4BC025925FF8F4D3
1 changed files with 19 additions and 5 deletions

View File

@ -846,10 +846,22 @@ inspired by the SCSH regular expression system.")
#:builder #:builder
(begin (begin
(use-modules (guix build utils) (use-modules (guix build utils)
(system base compile)) (ice-9 rdelim)
(ice-9 popen))
;; Avoid warnings we can safely ignore
(setenv "GUILE_AUTO_COMPILE" "0")
(let* ((out (assoc-ref %outputs "out")) (let* ((out (assoc-ref %outputs "out"))
(module-dir (string-append out "/share/guile/site/2.0")) (effective-version
(read-line
(open-pipe* OPEN_READ
(string-append
(assoc-ref %build-inputs "guile")
"/bin/guile")
"-c" "(display (effective-version))")))
(module-dir (string-append out "/share/guile/site/"
effective-version))
(source (assoc-ref %build-inputs "source")) (source (assoc-ref %build-inputs "source"))
(doc (string-append out "/share/doc")) (doc (string-append out "/share/doc"))
(guild (string-append (assoc-ref %build-inputs "guile") (guild (string-append (assoc-ref %build-inputs "guile")
@ -857,7 +869,10 @@ inspired by the SCSH regular expression system.")
(gdbm.scm-dest (gdbm.scm-dest
(string-append module-dir "/gdbm.scm")) (string-append module-dir "/gdbm.scm"))
(gdbm.go-dest (gdbm.go-dest
(string-append module-dir "/gdbm.go"))) (string-append module-dir "/gdbm.go"))
(compile-file
(lambda (in-file out-file)
(system* guild "compile" "-o" out-file in-file))))
;; Make installation directories. ;; Make installation directories.
(mkdir-p module-dir) (mkdir-p module-dir)
(mkdir-p doc) (mkdir-p doc)
@ -875,8 +890,7 @@ inspired by the SCSH regular expression system.")
(assoc-ref %build-inputs "gdbm")))) (assoc-ref %build-inputs "gdbm"))))
;; compile to the destination ;; compile to the destination
(compile-file gdbm.scm-dest (compile-file gdbm.scm-dest gdbm.go-dest)))))
#:output-file gdbm.go-dest)))))
(inputs (inputs
`(("guile" ,guile-2.0))) `(("guile" ,guile-2.0)))
(propagated-inputs (propagated-inputs