Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / tcl.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
6 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
7 ;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages tcl)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix build-system perl)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages image)
31 #:use-module (gnu packages fontutils)
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages xml)
35 #:use-module (gnu packages xorg)
36 #:use-module (guix licenses))
37
38 (define-public tcl
39 (package
40 (name "tcl")
41 (version "8.6.7")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
45 version "/tcl" version "-src.tar.gz"))
46 (sha256
47 (base32
48 "19bb09l55alz4jb38961ikd5116q80s51bjvzqy44ckkwf28ysvw"))))
49 (build-system gnu-build-system)
50 (arguments
51 '(#:phases (modify-phases %standard-phases
52 (add-before 'configure 'pre-configure
53 (lambda _ (chdir "unix") #t))
54 (add-after 'install 'install-private-headers
55 (lambda* (#:key outputs #:allow-other-keys)
56 ;; Private headers are needed by Expect.
57 (and (zero? (system* "make"
58 "install-private-headers"))
59 (let ((bin (string-append (assoc-ref outputs "out")
60 "/bin")))
61 ;; Create a tclsh -> tclsh8.6 symlink.
62 ;; Programs such as Ghostscript rely on it.
63 (with-directory-excursion bin
64 (symlink (car (find-files "." "tclsh"))
65 "tclsh"))
66 #t)))))
67
68 ;; By default, man pages are put in PREFIX/man, but we want them in
69 ;; PREFIX/share/man. The 'validate-documentation-location' phase is
70 ;; not able to fix this up because the default install populates both
71 ;; PREFIX/man and PREFIX/share/man.
72 #:configure-flags (list (string-append "--mandir="
73 (assoc-ref %outputs "out")
74 "/share/man"))
75
76 ;; XXX: There are a few test failures (related to HTTP, most
77 ;; likely related to name resolution), but that doesn't cause
78 ;; `make' to fail.
79 #:test-target "test"))
80 (home-page "http://www.tcl.tk/")
81 (synopsis "The Tcl scripting language")
82 (description "The Tcl (Tool Command Language) scripting language.")
83 (license tcl/tk)))
84
85
86 (define-public expect
87 (package
88 (name "expect")
89 (version "5.45.3")
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 "1s9ba7m0bmg6brn4x030y2xg7hqara1fr4hlrrllm54mf5xp2865"))))
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
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")))
113
114 #:phases
115 (modify-phases %standard-phases
116 (add-before 'configure 'set-path-to-stty
117 (lambda _
118 (substitute* "configure"
119 (("STTY_BIN=/bin/stty")
120 (string-append "STTY_BIN=" (which "stty"))))
121 #t)))
122
123 #:test-target "test"))
124 (home-page "http://expect.sourceforge.net/")
125 (synopsis "Tool for automating interactive applications")
126 (description
127 "Expect is a tool for automating interactive applications such as
128 telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this
129 stuff trivial. Expect is also useful for testing these same
130 applications. And by adding Tk, you can wrap interactive applications in
131 X11 GUIs.")
132 (license public-domain))) ; as written in `license.terms'
133
134 (define-public tk
135 (package
136 (name "tk")
137 (version "8.6.7")
138 (source (origin
139 (method url-fetch)
140 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
141 version "/tk" version "-src.tar.gz"))
142 (sha256
143 (base32
144 "1aipcf6qmbgi15av8yrpp2hx6vdwr684r6739p8cgdzrajiy4786"))
145 (patches (search-patches "tk-find-library.patch"))))
146 (build-system gnu-build-system)
147 (arguments
148 '(#:phases (modify-phases %standard-phases
149 (add-before
150 'configure 'pre-configure
151 (lambda _
152 (chdir "unix")))
153 (add-after
154 'install 'add-fontconfig-flag
155 (lambda* (#:key inputs outputs #:allow-other-keys)
156 ;; Add the missing -L flag for Fontconfig in 'tk.pc' and
157 ;; 'tkConfig.sh'.
158 (let ((out (assoc-ref outputs "out"))
159 (fontconfig (assoc-ref inputs "fontconfig")))
160 (substitute* (find-files out
161 "^(tkConfig\\.sh|tk\\.pc)$")
162 (("-lfontconfig")
163 (string-append "-L" fontconfig
164 "/lib -lfontconfig")))
165 #t))))
166
167 #:configure-flags (list (string-append "--with-tcl="
168 (assoc-ref %build-inputs "tcl")
169 "/lib"))
170
171 ;; The tests require a running X server, so we just skip them.
172 #:tests? #f))
173 (native-inputs `(("pkg-config" ,pkg-config)))
174 (inputs `(("libxft" ,libxft)
175 ("fontconfig" ,fontconfig)
176 ("tcl" ,tcl)))
177 ;; tk.h refers to X11 headers, hence the propagation.
178 (propagated-inputs `(("libx11" ,libx11)
179 ("libxext" ,libxext)))
180
181 (home-page "http://www.tcl.tk/")
182 (synopsis "Graphical user interface toolkit for Tcl")
183 (description
184 "Tk is a graphical toolkit for building graphical user
185 interfaces (GUIs) in the Tcl language.")
186 (license (package-license tcl))))
187
188 (define-public perl-tk
189 (package
190 (name "perl-tk")
191 (version "804.034")
192 (source (origin
193 (method url-fetch)
194 (uri (string-append
195 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
196 version ".tar.gz"))
197 (sha256
198 (base32
199 "1qiz55dmw7hm1wgpjdzf2jffwcj0hisr3kf80qi8lli3qx2b39py"))))
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
207 "X11=" (assoc-ref %build-inputs "libx11")))
208
209 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
210 #:parallel-build? #f))
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 perl-license)))
222
223 (define-public tcllib
224 (package
225 (name "tcllib")
226 (version "1.18")
227 (source (origin
228 (method url-fetch)
229 (uri (string-append "mirror://sourceforge/" name "/" name "/"
230 version "/" name "-" version ".tar.gz"))
231 (sha256
232 (base32
233 "05dmrk9qsryah2n17z6z85dj9l9lfyvnsd7faw0p9bs1pp5pwrkj"))))
234 (build-system gnu-build-system)
235 (native-inputs
236 `(("tcl" ,tcl)))
237 (native-search-paths
238 (list (search-path-specification
239 (variable "TCLLIBPATH")
240 (separator " ")
241 (files (list (string-append "lib/tcllib" version))))))
242 (home-page "https://core.tcl.tk/tcllib/home")
243 (synopsis "Standard Tcl Library")
244 (description "Tcllib, the standard Tcl library, is a collection of common
245 utility functions and modules all written in high-level Tcl.")
246 (license (package-license tcl))))
247
248 (define-public tklib
249 (package
250 (name "tklib")
251 (version "0.6")
252 (source (origin
253 (method url-fetch)
254 (uri (string-append "https://core.tcl.tk/tklib/tarball/tklib-"
255 version ".tar.gz?uuid=tklib-0-6"))
256 (sha256
257 (base32
258 "03y0bzgwbh7nnyqkh8n00bbkq2fyblq39s3bdb6mawna0bbn0wwg"))))
259 (build-system gnu-build-system)
260 (native-inputs
261 `(("tcl" ,tcl)))
262 (propagated-inputs
263 `(("tcllib" ,tcllib)
264 ("tk" ,tk))) ; for "wish"
265 (native-search-paths
266 (list (search-path-specification
267 (variable "TCLLIBPATH")
268 (separator " ")
269 (files (list (string-append "lib/tklib" version))))))
270 (home-page "https://www.tcl.tk/software/tklib/")
271 (synopsis "Tk utility modules for Tcl")
272 (description "Tklib is a collection of common utility functions and
273 modules for Tk, all written in high-level Tcl. Examples of provided widgets:
274 @enumerate
275 @item @code{chatwidget}
276 @item @code{datefield}
277 @item @code{tooltip}
278 @item @code{cursor}
279 @item @code{ipentry}
280 @item @code{tablelist}
281 @item @code{history}
282 @item @code{tkpiechart}
283 @item @code{ico}
284 @item @code{crosshair}
285 @item @code{ntext}
286 @item @code{plotchart}
287 @item @code{ctext}
288 @item @code{autosscroll}
289 @item @code{canvas}
290 @end enumerate")
291 (license (package-license tcl))))
292
293 (define-public tclxml
294 (package
295 (name "tclxml")
296 (version "3.2")
297 (source (origin
298 (method url-fetch)
299 (uri (string-append "mirror://sourceforge/" name "/TclXML/"
300 version "/" name "-" version ".tar.gz"))
301 (sha256
302 (base32
303 "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
304 (patches (search-patches "tclxml-3.2-install.patch"))))
305 (build-system gnu-build-system)
306 (native-inputs
307 `(("tcl" ,tcl)
308 ("libxml2" ,libxml2)
309 ("libxslt" ,libxslt)))
310 (propagated-inputs
311 `(("tcllib" ,tcllib))) ; uri
312 (native-search-paths
313 (list (search-path-specification
314 (variable "TCLLIBPATH")
315 (separator " ")
316 (files (list (string-append "lib/Tclxml" version))))))
317 (arguments
318 `(#:configure-flags
319 (list (string-append "--exec-prefix=" (assoc-ref %outputs "out"))
320 (string-append "--with-tclconfig="
321 (assoc-ref %build-inputs "tcl") "/lib")
322 (string-append "--with-xml2-config="
323 (assoc-ref %build-inputs "libxml2")
324 "/bin/xml2-config")
325 (string-append "--with-xslt-config="
326 (assoc-ref %build-inputs "libxslt")
327 "/bin/xslt-config"))
328 #:test-target "test"))
329 (home-page "http://tclxml.sourceforge.net/")
330 (synopsis "Tcl library for XML parsing")
331 (description "TclXML provides event-based parsing of XML documents. The
332 application may register callback scripts for certain document features, and
333 when the parser encounters those features while parsing the document the
334 callback is evaluated.")
335 (license (non-copyleft
336 "file://LICENCE"
337 "See LICENCE in the distribution."))))
338
339 (define-public tclx
340 (package
341 (name "tclx")
342 (version "8.4.1")
343 (source (origin
344 (method url-fetch)
345 (uri (string-append "mirror://sourceforge/tclx/TclX/"
346 version "/tclx" version ".tar.bz2"))
347 (sha256
348 (base32
349 "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59"))))
350 (build-system gnu-build-system)
351 (arguments
352 '(#:tests? #f ; a test named profile.test segfaults
353 #:configure-flags (list (string-append "--with-tcl="
354 (assoc-ref %build-inputs "tcl")
355 "/lib")
356 (string-append "--libdir="
357 (assoc-ref %outputs "out")
358 "/lib"))))
359 (inputs
360 `(("tcl" ,tcl)
361 ("tk" ,tk)))
362 (home-page "http://tclx.sourceforge.net/")
363 (synopsis "System programming extensions for Tcl")
364 (description
365 "Extended Tcl is oriented towards system programming tasks and large
366 application development. TclX provides additional interfaces to the operating
367 system, and adds many new programming constructs, text manipulation tools, and
368 debugging tools.")
369 (license tcl/tk)))