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>
9 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
44 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
45 version "/tcl" version "-src.tar.gz"))
48 "19bb09l55alz4jb38961ikd5116q80s51bjvzqy44ckkwf28ysvw"))))
49 (build-system gnu-build-system)
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")
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"))
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")
76 ;; XXX: There are a few test failures (related to HTTP, most
77 ;; likely related to name resolution), but that doesn't cause
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.")
93 (uri (string-append "mirror://sourceforge/expect/Expect/"
94 version "/expect" version ".tar.gz"))
97 "1s9ba7m0bmg6brn4x030y2xg7hqara1fr4hlrrllm54mf5xp2865"))))
98 (build-system gnu-build-system)
100 `(;; TODO: Add these optional dependencies.
101 ;; ("libX11" ,libX11)
102 ;; ("xproto" ,xproto)
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")))
115 (modify-phases %standard-phases
116 (add-before 'configure 'set-path-to-stty
118 (substitute* "configure"
119 (("STTY_BIN=/bin/stty")
120 (string-append "STTY_BIN=" (which "stty"))))
123 #:test-target "test"))
124 (home-page "http://expect.sourceforge.net/")
125 (synopsis "Tool for automating interactive applications")
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
132 (license public-domain))) ; as written in `license.terms'
140 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
141 version "/tk" version "-src.tar.gz"))
144 "1aipcf6qmbgi15av8yrpp2hx6vdwr684r6739p8cgdzrajiy4786"))
145 (patches (search-patches "tk-find-library.patch"))))
146 (build-system gnu-build-system)
148 '(#:phases (modify-phases %standard-phases
150 'configure 'pre-configure
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
158 (let ((out (assoc-ref outputs "out"))
159 (fontconfig (assoc-ref inputs "fontconfig")))
160 (substitute* (find-files out
161 "^(tkConfig\\.sh|tk\\.pc)$")
163 (string-append "-L" fontconfig
164 "/lib -lfontconfig")))
167 #:configure-flags (list (string-append "--with-tcl="
168 (assoc-ref %build-inputs "tcl")
171 ;; The tests require a running X server, so we just skip them.
173 (native-inputs `(("pkg-config" ,pkg-config)))
174 (inputs `(("libxft" ,libxft)
175 ("fontconfig" ,fontconfig)
177 ;; tk.h refers to X11 headers, hence the propagation.
178 (propagated-inputs `(("libx11" ,libx11)
179 ("libxext" ,libxext)))
181 (home-page "http://www.tcl.tk/")
182 (synopsis "Graphical user interface toolkit for Tcl")
184 "Tk is a graphical toolkit for building graphical user
185 interfaces (GUIs) in the Tcl language.")
186 (license (package-license tcl))))
188 (define-public perl-tk
195 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
199 "1qiz55dmw7hm1wgpjdzf2jffwcj0hisr3kf80qi8lli3qx2b39py"))))
200 (build-system perl-build-system)
201 (native-inputs `(("pkg-config" ,pkg-config)))
202 (inputs `(("libx11" ,libx11)
204 ("libjpeg" ,libjpeg)))
206 `(#:make-maker-flags `(,(string-append
207 "X11=" (assoc-ref %build-inputs "libx11")))
209 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
210 #:parallel-build? #f))
211 (synopsis "Graphical user interface toolkit for Perl")
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)))
223 (define-public tcllib
229 (uri (string-append "mirror://sourceforge/" name "/" name "/"
230 version "/" name "-" version ".tar.gz"))
233 "05dmrk9qsryah2n17z6z85dj9l9lfyvnsd7faw0p9bs1pp5pwrkj"))))
234 (build-system gnu-build-system)
238 (list (search-path-specification
239 (variable "TCLLIBPATH")
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))))
254 (uri (string-append "https://core.tcl.tk/tklib/tarball/tklib-"
255 version ".tar.gz?uuid=tklib-0-6"))
258 "03y0bzgwbh7nnyqkh8n00bbkq2fyblq39s3bdb6mawna0bbn0wwg"))))
259 (build-system gnu-build-system)
264 ("tk" ,tk))) ; for "wish"
266 (list (search-path-specification
267 (variable "TCLLIBPATH")
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:
275 @item @code{chatwidget}
276 @item @code{datefield}
280 @item @code{tablelist}
282 @item @code{tkpiechart}
284 @item @code{crosshair}
286 @item @code{plotchart}
288 @item @code{autosscroll}
291 (license (package-license tcl))))
293 (define-public tclxml
299 (uri (string-append "mirror://sourceforge/" name "/TclXML/"
300 version "/" name "-" version ".tar.gz"))
303 "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
304 (patches (search-patches "tclxml-3.2-install.patch"))))
305 (build-system gnu-build-system)
309 ("libxslt" ,libxslt)))
311 `(("tcllib" ,tcllib))) ; uri
313 (list (search-path-specification
314 (variable "TCLLIBPATH")
316 (files (list (string-append "lib/Tclxml" version))))))
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")
325 (string-append "--with-xslt-config="
326 (assoc-ref %build-inputs "libxslt")
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
337 "See LICENCE in the distribution."))))
345 (uri (string-append "mirror://sourceforge/tclx/TclX/"
346 version "/tclx" version ".tar.bz2"))
349 "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59"))))
350 (build-system gnu-build-system)
352 '(#:tests? #f ; a test named profile.test segfaults
353 #:configure-flags (list (string-append "--with-tcl="
354 (assoc-ref %build-inputs "tcl")
356 (string-append "--libdir="
357 (assoc-ref %outputs "out")
362 (home-page "http://tclx.sourceforge.net/")
363 (synopsis "System programming extensions for Tcl")
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