gnu: guile-cairo: Honor the Guile effective version.

* gnu/packages/gtk.scm (guile-cairo)[arguments]: Add #:modules.
Get the effective version of Guile and use that in installation
directory names.
This commit is contained in:
Ludovic Courtès 2017-03-13 22:26:54 +01:00
parent b97438650d
commit 0f11f64022
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 24 additions and 8 deletions

View File

@ -740,26 +740,42 @@ application suites.")
"1f5nd9n46n6cwfl1byjml02q3y2hgn7nkx98km1czgwarxl7ws3x")))) "1f5nd9n46n6cwfl1byjml02q3y2hgn7nkx98km1czgwarxl7ws3x"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(#:phases (modify-phases %standard-phases '(#:modules ((guix build utils)
(guix build gnu-build-system)
(ice-9 popen)
(ice-9 rdelim))
#:phases (modify-phases %standard-phases
(add-before 'configure 'set-module-directory (add-before 'configure 'set-module-directory
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
;; Install modules under $out/share/guile/site/2.0. ;; Install modules under $out/share/guile/site/2.0.
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out"))
(effective
(read-line
(open-pipe* OPEN_READ "guile" "-c"
"(display (effective-version))"))))
(substitute* "Makefile.in" (substitute* "Makefile.in"
(("scmdir = ([[:graph:]]+).*" _ value) (("scmdir = ([[:graph:]]+).*" _ value)
(string-append "scmdir = " value "/2.0\n"))) (string-append "scmdir = " value "/" effective "\n")))
(substitute* "cairo/Makefile.in" (substitute* "cairo/Makefile.in"
(("moduledir = ([[:graph:]]+).*" _ value) (("moduledir = ([[:graph:]]+).*" _ value)
(string-append "moduledir = " (string-append "moduledir = "
"$(prefix)/share/guile/site/2.0/cairo\n'")))))) "$(prefix)/share/guile/site/"
effective "/cairo\n'")))
#t)))
(add-after 'install 'install-missing-file (add-after 'install 'install-missing-file
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
;; By default 'vector-types.scm' is not installed, so do ;; By default 'vector-types.scm' is not installed, so do
;; it here. ;; it here.
(let ((out (assoc-ref outputs "out"))) (let ((out (assoc-ref outputs "out"))
(copy-file "cairo/vector-types.scm" (effective
(string-append out "/share/guile/site/2.0" (read-line
"/cairo/vector-types.scm")))))))) (open-pipe* OPEN_READ "guile" "-c"
"(display (effective-version))"))))
(install-file "cairo/vector-types.scm"
(string-append out "/share/guile/site/"
effective "/cairo"))
#t))))))
(inputs (inputs
`(("guile-lib" ,guile-lib) `(("guile-lib" ,guile-lib)
("expat" ,expat) ("expat" ,expat)