tk: Hardcode path to TK_LIBRARY.
[jackhill/guix/guix.git] / gnu / packages / tcl.scm
CommitLineData
4a219a1a 1;;; GNU Guix --- Functional package management for GNU
9b1bf330 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
c9a46555 3;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
de0c3141 4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4a219a1a
LC
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
1ffa7090 21(define-module (gnu packages tcl)
4a219a1a
LC
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
de0c3141 25 #:use-module (guix build-system perl)
f5ea273a 26 #:use-module (gnu packages)
e55354b8 27 #:use-module (gnu packages image)
c3aeac38 28 #:use-module (gnu packages fontutils)
de0c3141
EB
29 #:use-module (gnu packages perl)
30 #:use-module (gnu packages pkg-config)
765904ce 31 #:use-module (gnu packages xorg)
4a219a1a
LC
32 #:use-module (guix licenses))
33
34(define-public tcl
35 (package
36 (name "tcl")
84439c51 37 (version "8.6.4")
4a219a1a
LC
38 (source
39 (origin
40 (method url-fetch)
41 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
42 version "/tcl" version "-src.tar.gz"))
43 (sha256
44 (base32
84439c51 45 "13cwa4bc85ylf5gfj9vk182lvgy60qni3f7gbxghq78wk16djvly"))))
4a219a1a
LC
46 (build-system gnu-build-system)
47 (arguments
48 '(#:phases (alist-cons-before
49 'configure 'pre-configure
50 (lambda _
51 (chdir "unix"))
52 (alist-cons-after
53 'install 'install-private-headers
3465eb03 54 (lambda* (#:key outputs #:allow-other-keys)
4a219a1a 55 ;; Private headers are needed by Expect.
3465eb03
LC
56 (and (zero? (system* "make"
57 "install-private-headers"))
58 (let ((bin (string-append (assoc-ref outputs "out")
59 "/bin")))
60 ;; Create a tclsh -> tclsh8.6 symlink.
61 ;; Programs such as Ghostscript rely on it.
62 (with-directory-excursion bin
63 (symlink (car (find-files "." "tclsh"))
64 "tclsh")))))
4a219a1a 65 %standard-phases))
eb6d676e 66
c9a46555
MW
67 ;; By default, man pages are put in PREFIX/man, but we want them in
68 ;; PREFIX/share/man. The 'validate-documentation-location' phase is
69 ;; not able to fix this up because the default install populates both
70 ;; PREFIX/man and PREFIX/share/man.
71 #:configure-flags (list (string-append "--mandir="
72 (assoc-ref %outputs "out")
73 "/share/man"))
74
eb6d676e
LC
75 ;; XXX: There are a few test failures (related to HTTP, most
76 ;; likely related to name resolution), but that doesn't cause
77 ;; `make' to fail.
78 #:test-target "test"))
4a219a1a
LC
79 (home-page "http://www.tcl.tk/")
80 (synopsis "The Tcl scripting language")
81 (description "The Tcl (Tool Command Language) scripting language.")
166191b3 82 (license (non-copyleft "http://www.tcl.tk/software/tcltk/license.html"
4a219a1a
LC
83 "Tcl/Tk license"))))
84
85
86(define-public expect
87 (package
88 (name "expect")
89 (version "5.45")
90 (source
91 (origin
92 (method url-fetch)
93 (uri (string-append "mirror://sourceforge/expect/Expect/"
94 version "/expect" version ".tar.gz"))
95 (sha256
96 (base32
97 "0h60bifxj876afz4im35rmnbnxjx4lbdqp2ja3k30fwa8a8cm3dj"))))
98 (build-system gnu-build-system)
99 (inputs
100 `(;; TODO: Add these optional dependencies.
101 ;; ("libX11" ,libX11)
102 ;; ("xproto" ,xproto)
103 ;; ("tk" ,tk)
104 ("tcl" ,tcl)))
105 (arguments
106 '(#:configure-flags
988cecfd
MW
107 (let ((out (assoc-ref %outputs "out"))
108 (tcl (assoc-ref %build-inputs "tcl")))
109 (list (string-append "--with-tcl=" tcl "/lib")
110 (string-append "--with-tclinclude=" tcl "/include")
111 (string-append "--exec-prefix=" out)
112 (string-append "--mandir=" out "/share/man")))
eb6d676e 113
d5529a91
LC
114 #:phases (alist-cons-before
115 'configure 'set-path-to-stty
116 (lambda _
117 (substitute* "configure"
118 (("STTY_BIN=/bin/stty")
119 (string-append "STTY_BIN=" (which "stty")))))
120 %standard-phases)
121
eb6d676e 122 #:test-target "test"))
4a219a1a 123 (home-page "http://expect.nist.gov/")
9e771e3b 124 (synopsis "Tool for automating interactive applications")
4a219a1a
LC
125 (description
126 "Expect is a tool for automating interactive applications such as
127telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this
35b9e423
EB
128stuff trivial. Expect is also useful for testing these same
129applications. And by adding Tk, you can wrap interactive applications in
4a219a1a
LC
130X11 GUIs.")
131 (license public-domain))) ; as written in `license.terms'
765904ce
LC
132
133(define-public tk
134 (package
135 (name "tk")
a6eb73a4 136 (version "8.6.4")
765904ce
LC
137 (source (origin
138 (method url-fetch)
139 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
140 version "/tk" version "-src.tar.gz"))
141 (sha256
142 (base32
79c8a071
SB
143 "1h96vp15zl5xz0d4qp6wjyrchqmrmdm3q5k22wkw9jaxbvw9vy88"))
144 (patches (list (search-patch "tk-find-library.patch")))))
765904ce
LC
145 (build-system gnu-build-system)
146 (arguments
c3aeac38
LC
147 '(#:phases (modify-phases %standard-phases
148 (add-before
149 'configure 'pre-configure
150 (lambda _
151 (chdir "unix")))
152 (add-after
153 'install 'add-fontconfig-flag
154 (lambda* (#:key inputs outputs #:allow-other-keys)
155 ;; Add the missing -L flag for Fontconfig in 'tk.pc' and
156 ;; 'tkConfig.sh'.
157 (let ((out (assoc-ref outputs "out"))
158 (fontconfig (assoc-ref inputs "fontconfig")))
159 (substitute* (find-files out
160 "^(tkConfig\\.sh|tk\\.pc)$")
161 (("-lfontconfig")
162 (string-append "-L" fontconfig
163 "/lib -lfontconfig")))
164 #t))))
765904ce
LC
165
166 #:configure-flags (list (string-append "--with-tcl="
167 (assoc-ref %build-inputs "tcl")
168 "/lib"))
169
170 ;; The tests require a running X server, so we just skip them.
171 #:tests? #f))
8a0263f1
SB
172 (native-inputs `(("pkg-config" ,pkg-config)))
173 (inputs `(("libxft" ,libxft)
c3aeac38 174 ("fontconfig" ,fontconfig)
8a0263f1 175 ("tcl" ,tcl)))
765904ce
LC
176 ;; tk.h refers to X11 headers, hence the propagation.
177 (propagated-inputs `(("libx11" ,libx11)
178 ("libxext" ,libxext)))
179
180 (home-page "http://www.tcl.tk/")
181 (synopsis "Graphical user interface toolkit for Tcl")
182 (description
cb150ca3
LC
183 "Tk is a graphical toolkit for building graphical user
184interfaces (GUIs) in the Tcl language.")
765904ce 185 (license (package-license tcl))))
de0c3141
EB
186
187(define-public perl-tk
188 (package
189 (name "perl-tk")
190 (version "804.032")
191 (source (origin
192 (method url-fetch)
193 (uri (string-append
194 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
195 version ".tar.gz"))
196 (sha256
197 (base32
f5ea273a
EB
198 "0jarvplhfvnm0shhdm2a5zczlnk9mkf8jvfjiwyhjrr3cy1gl0w0"))
199 (patches (list (search-patch "perl-tk-x11-discover.patch")))))
de0c3141
EB
200 (build-system perl-build-system)
201 (native-inputs `(("pkg-config" ,pkg-config)))
202 (inputs `(("libx11" ,libx11)
203 ("libpng" ,libpng)
204 ("libjpeg" ,libjpeg)))
205 (arguments
206 `(#:make-maker-flags `(,(string-append
cb150ca3
LC
207 "X11=" (assoc-ref %build-inputs "libx11")))
208
209 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
210 #:parallel-build? #f))
de0c3141
EB
211 (synopsis "Graphical user interface toolkit for Perl")
212 (description
213 "Tk is a Graphical User Interface ToolKit.")
214 (home-page (string-append "http://search.cpan.org/~srezic/Tk-" version))
215 ;; From the package README: "... you can redistribute it and/or modify it
216 ;; under the same terms as Perl itself, with the exception of all the
217 ;; files in the pTk sub-directory which have separate terms derived from
218 ;; those of the orignal Tix4.1.3 or Tk8.4.* sources. See the files
219 ;; pTk/license.terms, pTk/license.html_lib, and pTk/Tix.license for
220 ;; details of this license."
221 (license (package-license perl))))