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