gnu: tcl: Add missing -L flag in tk.pc and tkConfig.sh.

* gnu/packages/tcl.scm (tk)[arguments]: Use 'modify-phases'.  Add
  'add-fontconfig-flag' phase.
  [inputs]: Add FONTCONFIG.
This commit is contained in:
Ludovic Courtès 2015-09-24 23:00:02 +02:00
parent 1007b6bf0b
commit c3aeac385a
1 changed files with 20 additions and 5 deletions

View File

@ -25,6 +25,7 @@
#:use-module (guix build-system perl) #:use-module (guix build-system perl)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages image) #:use-module (gnu packages image)
#:use-module (gnu packages fontutils)
#:use-module (gnu packages perl) #:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config) #:use-module (gnu packages pkg-config)
#:use-module (gnu packages xorg) #:use-module (gnu packages xorg)
@ -142,11 +143,24 @@ X11 GUIs.")
"1h96vp15zl5xz0d4qp6wjyrchqmrmdm3q5k22wkw9jaxbvw9vy88")))) "1h96vp15zl5xz0d4qp6wjyrchqmrmdm3q5k22wkw9jaxbvw9vy88"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(#:phases (alist-cons-before '(#:phases (modify-phases %standard-phases
'configure 'pre-configure (add-before
(lambda _ 'configure 'pre-configure
(chdir "unix")) (lambda _
%standard-phases) (chdir "unix")))
(add-after
'install 'add-fontconfig-flag
(lambda* (#:key inputs outputs #:allow-other-keys)
;; Add the missing -L flag for Fontconfig in 'tk.pc' and
;; 'tkConfig.sh'.
(let ((out (assoc-ref outputs "out"))
(fontconfig (assoc-ref inputs "fontconfig")))
(substitute* (find-files out
"^(tkConfig\\.sh|tk\\.pc)$")
(("-lfontconfig")
(string-append "-L" fontconfig
"/lib -lfontconfig")))
#t))))
#:configure-flags (list (string-append "--with-tcl=" #:configure-flags (list (string-append "--with-tcl="
(assoc-ref %build-inputs "tcl") (assoc-ref %build-inputs "tcl")
@ -156,6 +170,7 @@ X11 GUIs.")
#:tests? #f)) #:tests? #f))
(native-inputs `(("pkg-config" ,pkg-config))) (native-inputs `(("pkg-config" ,pkg-config)))
(inputs `(("libxft" ,libxft) (inputs `(("libxft" ,libxft)
("fontconfig" ,fontconfig)
("tcl" ,tcl))) ("tcl" ,tcl)))
;; tk.h refers to X11 headers, hence the propagation. ;; tk.h refers to X11 headers, hence the propagation.
(propagated-inputs `(("libx11" ,libx11) (propagated-inputs `(("libx11" ,libx11)