gnu: icecat: Update to 78.10.0-guix0-preview1 [security fixes].
[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, 2018 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2016, 2018 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 ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
10 ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
11 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages tcl)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix git-download)
31 #:use-module (guix utils)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system go)
34 #:use-module (guix build-system perl)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages image)
37 #:use-module (gnu packages fontutils)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages xml)
41 #:use-module (gnu packages xorg)
42 #:use-module ((guix licenses) #:prefix license:))
43
44 (define-public tcl
45 (package
46 (name "tcl")
47 (version "8.6.10")
48 (source (origin
49 (method url-fetch)
50 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
51 version "/tcl" version "-src.tar.gz"))
52 (sha256
53 (base32
54 "1vc7imilx6kcb5319r7hnrp4jn5pqb41an3vr3azhgcfcgvdp5ji"))
55 (patches (search-patches "tcl-fix-cross-compilation.patch"))))
56 (build-system gnu-build-system)
57 (arguments
58 `(#:phases (modify-phases %standard-phases
59 (add-before 'configure 'pre-configure
60 (lambda _ (chdir "unix") #t))
61 (add-after 'install 'install-private-headers
62 (lambda* (#:key outputs #:allow-other-keys)
63 ;; Private headers are needed by Expect.
64 (invoke "make" "install-private-headers")
65 (let ((bin (string-append (assoc-ref outputs "out")
66 "/bin")))
67 ;; Create a tclsh -> tclsh8.6 symlink.
68 ;; Programs such as Ghostscript rely on it.
69 (with-directory-excursion bin
70 (symlink (car (find-files "." "tclsh"))
71 "tclsh"))
72 #t))))
73
74 ;; By default, man pages are put in PREFIX/man, but we want them in
75 ;; PREFIX/share/man. The 'validate-documentation-location' phase is
76 ;; not able to fix this up because the default install populates both
77 ;; PREFIX/man and PREFIX/share/man.
78 #:configure-flags
79 (list (string-append "--mandir="
80 (assoc-ref %outputs "out")
81 "/share/man")
82 ;; This is needed when cross-compiling, see:
83 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
84 ,@(if (%current-target-system)
85 '("tcl_cv_strtod_buggy=1"
86 "ac_cv_func_strtod=yes")
87 '()))
88
89 ;; XXX: There are a few test failures (related to HTTP, most
90 ;; likely related to name resolution), but that doesn't cause
91 ;; `make' to fail.
92 #:test-target "test"))
93 (home-page "https://www.tcl.tk/")
94 (synopsis "The Tcl scripting language")
95 (description "The Tcl (Tool Command Language) scripting language.")
96 (license license:tcl/tk)))
97
98 (define-public itcl
99 (package
100 (name "itcl")
101 (version "4.2.0")
102 (source
103 (origin
104 (method url-fetch)
105 (uri (string-append
106 "mirror://sourceforge/incrtcl/%5Bincr%20Tcl_Tk%5D-4-source/itcl%20"
107 version "/itcl" version ".tar.gz"))
108 (file-name (string-append "incrtcl-" version ".tar.gz"))
109 (sha256
110 (base32 "0w28v0zaraxcq1s9pa6cihqqwqvvwfgz275lks7w4gl7hxjxmasw"))))
111 (build-system gnu-build-system)
112 (arguments
113 `(#:configure-flags
114 (list
115 (string-append
116 "--exec-prefix=" (assoc-ref %outputs "out"))
117 (string-append
118 "--with-tclinclude=" (assoc-ref %build-inputs "tcl") "/include")
119 (string-append
120 "--with-tcl=" (assoc-ref %build-inputs "tcl") "/lib"))
121 #:test-target "test"
122 #:phases
123 (modify-phases %standard-phases
124 (add-after 'install 'cleanup-bin-and-lib
125 (lambda* (#:key outputs #:allow-other-keys)
126 ;; NOTE: (Sharlatan-20210213T204336+0000): libraries appearer in
127 ;; "out/lib/itcl{{version}}" and there are no binaries, some extra
128 ;; rename and remove spells are to be applied.
129 (let ((out (assoc-ref outputs "out")))
130 (rmdir
131 (string-append out "/bin"))
132 (rename-file
133 (string-append out "/lib/itcl" ,version) (string-append out "/libtmp"))
134 (rename-file
135 (string-append out "/libtmp") (string-append out "/lib")))
136 #t)))))
137 (native-inputs
138 `(("tcl" ,tcl)))
139 (inputs
140 `(("tcllib" ,tcllib)))
141 (home-page "http://incrtcl.sourceforge.net/")
142 (synopsis "Object Oriented programming (OOP) extension for Tcl")
143 (description
144 "[incr Tcl] is a widely used object-oriented system for Tcl. The name is
145 a play on C++, and [incr Tcl] provides a similar object model, including
146 multiple inheritance and public and private classes and variables.")
147 (license license:public-domain)))
148
149 (define-public expect
150 (package
151 (name "expect")
152 (version "5.45.4")
153 (source
154 (origin
155 (method url-fetch)
156 (uri (string-append "mirror://sourceforge/expect/Expect/"
157 version "/expect" version ".tar.gz"))
158 (sha256
159 (base32
160 "0d1cp5hggjl93xwc8h1y6adbnrvpkk0ywkd00inz9ndxn21xm9s9"))))
161 (build-system gnu-build-system)
162 (inputs
163 `(;; TODO: Add these optional dependencies.
164 ;; ("libX11" ,libX11)
165 ;; ("xorgproto" ,xorgproto)
166 ;; ("tk" ,tk)
167 ("tcl" ,tcl)))
168 (arguments
169 '(#:configure-flags
170 (let ((out (assoc-ref %outputs "out"))
171 (tcl (assoc-ref %build-inputs "tcl")))
172 (list (string-append "--with-tcl=" tcl "/lib")
173 (string-append "--with-tclinclude=" tcl "/include")
174 (string-append "--exec-prefix=" out)
175 (string-append "--mandir=" out "/share/man")))
176
177 #:phases
178 (modify-phases %standard-phases
179 (add-before 'configure 'set-path-to-stty
180 (lambda _
181 (substitute* "configure"
182 (("STTY_BIN=/bin/stty")
183 (string-append "STTY_BIN=" (which "stty"))))
184 #t)))
185
186 #:test-target "test"))
187 (home-page "http://expect.sourceforge.net/")
188 (synopsis "Tool for automating interactive applications")
189 (description
190 "Expect is a tool for automating interactive applications such as
191 telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this
192 stuff trivial. Expect is also useful for testing these same
193 applications. And by adding Tk, you can wrap interactive applications in
194 X11 GUIs.")
195 (license license:public-domain))) ; as written in `license.terms'
196
197 (define-public tk
198 (package
199 (name "tk")
200 (version "8.6.10")
201 (source (origin
202 (method url-fetch)
203 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
204 (version-prefix version 3) "/tk"
205 version "-src.tar.gz"))
206 (sha256
207 (base32
208 "11p3ycqbr5116vpaxv6fl6md6gcav1ffspgr8wrlc2lxhn543pv3"))
209 (patches (search-patches "tk-find-library.patch"))))
210 (build-system gnu-build-system)
211 (arguments
212 `(#:phases (modify-phases %standard-phases
213 (add-before
214 'configure 'pre-configure
215 (lambda _
216 (chdir "unix")
217 #t))
218 (add-after
219 'install 'create-wish-symlink
220 (lambda* (#:key outputs #:allow-other-keys)
221 (let ((out (assoc-ref outputs "out")))
222 (symlink (string-append out "/bin/wish"
223 ,(version-major+minor
224 (package-version tk)))
225 (string-append out "/bin/wish")))
226 #t))
227 (add-after
228 'install 'add-fontconfig-flag
229 (lambda* (#:key inputs outputs #:allow-other-keys)
230 ;; Add the missing -L flag for Fontconfig in 'tk.pc' and
231 ;; 'tkConfig.sh'.
232 (let ((out (assoc-ref outputs "out"))
233 (fontconfig (assoc-ref inputs "fontconfig")))
234 (substitute* (find-files out
235 "^(tkConfig\\.sh|tk\\.pc)$")
236 (("-lfontconfig")
237 (string-append "-L" fontconfig
238 "/lib -lfontconfig")))
239 #t))))
240
241 #:configure-flags
242 (list (string-append "--with-tcl="
243 (assoc-ref %build-inputs "tcl")
244 "/lib")
245 ;; This is needed when cross-compiling, see:
246 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
247 ,@(if (%current-target-system)
248 '("tcl_cv_strtod_buggy=1"
249 "ac_cv_func_strtod=yes")
250 '()))
251
252 ;; The tests require a running X server, so we just skip them.
253 #:tests? #f))
254 (native-inputs `(("pkg-config" ,pkg-config)))
255 (inputs `(("libxft" ,libxft)
256 ("fontconfig" ,fontconfig)
257 ("tcl" ,tcl)))
258 ;; tk.h refers to X11 headers, hence the propagation.
259 (propagated-inputs `(("libx11" ,libx11)
260 ("libxext" ,libxext)))
261
262 (home-page "https://www.tcl.tk/")
263 (synopsis "Graphical user interface toolkit for Tcl")
264 (description
265 "Tk is a graphical toolkit for building graphical user
266 interfaces (GUIs) in the Tcl language.")
267 (license (package-license tcl))))
268
269 (define-public perl-tk
270 (package
271 (name "perl-tk")
272 (version "804.034")
273 (source (origin
274 (method url-fetch)
275 (uri (string-append
276 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
277 version ".tar.gz"))
278 (sha256
279 (base32
280 "1qiz55dmw7hm1wgpjdzf2jffwcj0hisr3kf80qi8lli3qx2b39py"))))
281 (build-system perl-build-system)
282 (native-inputs `(("pkg-config" ,pkg-config)))
283 (inputs `(("libx11" ,libx11)
284 ("libpng" ,libpng)
285 ("libjpeg" ,libjpeg-turbo)))
286 (arguments
287 `(#:make-maker-flags `(,(string-append
288 "X11=" (assoc-ref %build-inputs "libx11")))
289
290 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
291 #:parallel-build? #f))
292 (synopsis "Graphical user interface toolkit for Perl")
293 (description
294 "Tk is a Graphical User Interface ToolKit.")
295 (home-page "https://metacpan.org/release/Tk")
296 ;; From the package README: "... you can redistribute it and/or modify it
297 ;; under the same terms as Perl itself, with the exception of all the
298 ;; files in the pTk sub-directory which have separate terms derived from
299 ;; those of the orignal Tix4.1.3 or Tk8.4.* sources. See the files
300 ;; pTk/license.terms, pTk/license.html_lib, and pTk/Tix.license for
301 ;; details of this license."
302 (license license:perl-license)))
303
304 (define-public tcllib
305 (package
306 (name "tcllib")
307 (version "1.19")
308 (source (origin
309 (method url-fetch)
310 (uri (string-append "mirror://sourceforge/tcllib/tcllib/"
311 version "/tcllib-" version ".tar.gz"))
312 (sha256
313 (base32
314 "173abxaazdmf210v651708ab6h7xhskvd52krxk6ifam337qgzh1"))))
315 (build-system gnu-build-system)
316 (native-inputs
317 `(("tcl" ,tcl)))
318 (native-search-paths
319 (list (search-path-specification
320 (variable "TCLLIBPATH")
321 (separator " ")
322 (files (list (string-append "lib/tcllib" version))))))
323 (home-page "https://core.tcl.tk/tcllib/home")
324 (synopsis "Standard Tcl Library")
325 (description "Tcllib, the standard Tcl library, is a collection of common
326 utility functions and modules all written in high-level Tcl.")
327 (license (package-license tcl))))
328
329 (define-public tklib
330 (package
331 (name "tklib")
332 (version "0.6")
333 (source (origin
334 (method url-fetch)
335 (uri (string-append "https://core.tcl.tk/tklib/tarball/tklib-"
336 version ".tar.gz?uuid=tklib-0-6"))
337 (sha256
338 (base32
339 "03y0bzgwbh7nnyqkh8n00bbkq2fyblq39s3bdb6mawna0bbn0wwg"))))
340 (build-system gnu-build-system)
341 (native-inputs
342 `(("tcl" ,tcl)))
343 (propagated-inputs
344 `(("tcllib" ,tcllib)
345 ("tk" ,tk))) ; for "wish"
346 (native-search-paths
347 (list (search-path-specification
348 (variable "TCLLIBPATH")
349 (separator " ")
350 (files (list (string-append "lib/tklib" version))))))
351 (home-page "https://www.tcl.tk/software/tklib/")
352 (synopsis "Tk utility modules for Tcl")
353 (description "Tklib is a collection of common utility functions and
354 modules for Tk, all written in high-level Tcl. Examples of provided widgets:
355 @enumerate
356 @item @code{chatwidget}
357 @item @code{datefield}
358 @item @code{tooltip}
359 @item @code{cursor}
360 @item @code{ipentry}
361 @item @code{tablelist}
362 @item @code{history}
363 @item @code{tkpiechart}
364 @item @code{ico}
365 @item @code{crosshair}
366 @item @code{ntext}
367 @item @code{plotchart}
368 @item @code{ctext}
369 @item @code{autosscroll}
370 @item @code{canvas}
371 @end enumerate")
372 (license (package-license tcl))))
373
374 (define-public tclxml
375 (package
376 (name "tclxml")
377 (version "3.2")
378 (source (origin
379 (method url-fetch)
380 (uri (string-append "mirror://sourceforge/" name "/TclXML/"
381 version "/" name "-" version ".tar.gz"))
382 (sha256
383 (base32
384 "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
385 (patches (search-patches "tclxml-3.2-install.patch"))))
386 (build-system gnu-build-system)
387 (native-inputs
388 `(("tcl" ,tcl)
389 ("libxml2" ,libxml2)
390 ("libxslt" ,libxslt)))
391 (propagated-inputs
392 `(("tcllib" ,tcllib))) ; uri
393 (native-search-paths
394 (list (search-path-specification
395 (variable "TCLLIBPATH")
396 (separator " ")
397 (files (list (string-append "lib/Tclxml" version))))))
398 (arguments
399 `(#:configure-flags
400 (list (string-append "--exec-prefix=" (assoc-ref %outputs "out"))
401 (string-append "--with-tclconfig="
402 (assoc-ref %build-inputs "tcl") "/lib")
403 (string-append "--with-xml2-config="
404 (assoc-ref %build-inputs "libxml2")
405 "/bin/xml2-config")
406 (string-append "--with-xslt-config="
407 (assoc-ref %build-inputs "libxslt")
408 "/bin/xslt-config"))
409 #:test-target "test"))
410 (home-page "http://tclxml.sourceforge.net/")
411 (synopsis "Tcl library for XML parsing")
412 (description "TclXML provides event-based parsing of XML documents. The
413 application may register callback scripts for certain document features, and
414 when the parser encounters those features while parsing the document the
415 callback is evaluated.")
416 (license (license:non-copyleft
417 "file://LICENCE"
418 "See LICENCE in the distribution."))))
419
420 (define-public tclx
421 (package
422 (name "tclx")
423 (version "8.4.1")
424 (source (origin
425 (method url-fetch)
426 (uri (string-append "mirror://sourceforge/tclx/TclX/"
427 version "/tclx" version ".tar.bz2"))
428 (sha256
429 (base32
430 "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59"))))
431 (build-system gnu-build-system)
432 (arguments
433 '(#:tests? #f ; a test named profile.test segfaults
434 #:configure-flags (list (string-append "--with-tcl="
435 (assoc-ref %build-inputs "tcl")
436 "/lib")
437 (string-append "--libdir="
438 (assoc-ref %outputs "out")
439 "/lib"))))
440 (inputs
441 `(("tcl" ,tcl)
442 ("tk" ,tk)))
443 (home-page "http://tclx.sourceforge.net/")
444 (synopsis "System programming extensions for Tcl")
445 (description
446 "Extended Tcl is oriented towards system programming tasks and large
447 application development. TclX provides additional interfaces to the operating
448 system, and adds many new programming constructs, text manipulation tools, and
449 debugging tools.")
450 (license license:tcl/tk)))
451
452 (define-public go-github.com-nsf-gothic
453 (let ((commit "97dfcc195b9de36c911a69a6ec2b5b2659c05652")
454 (revision "0"))
455 (package
456 (name "go-github.com-nsf-gothic")
457 (version (git-version "0.0.0" revision commit))
458 (source (origin
459 (method git-fetch)
460 (uri (git-reference
461 (url "https://github.com/nsf/gothic")
462 (commit commit)))
463 (sha256
464 (base32
465 "1lrhbml6r4sh22rrn3m9bck70pv0g0c1diprg7cil90x0jidxczr"))
466 (file-name (git-file-name name version))))
467 (build-system go-build-system)
468 (arguments
469 `(#:import-path "github.com/nsf/gothic"))
470 (propagated-inputs
471 `(("tk" ,tk)
472 ("tcl" ,tcl)))
473 (home-page "https://github.com/nsf/gothic")
474 (synopsis "Tcl/Tk Go bindings")
475 (description "Gothic contains Go bindings for Tcl/Tk. The package contains
476 only one type and one function that can be used to create a Tk interpreter.")
477 (license license:expat))))