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 <kei@openmailbox.org>
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 "01zypqhy57wvh1ikk28bg733sk5kf4q568pq9v6fvcz4h6bl0rd2"))
49 (patches (search-patches "tcl-mkindex-deterministic.patch"))))
50 (build-system gnu-build-system)
52 '(#:phases (alist-cons-before
53 'configure 'pre-configure
57 'install 'install-private-headers
58 (lambda* (#:key outputs #:allow-other-keys)
59 ;; Private headers are needed by Expect.
60 (and (zero? (system* "make"
61 "install-private-headers"))
62 (let ((bin (string-append (assoc-ref outputs "out")
64 ;; Create a tclsh -> tclsh8.6 symlink.
65 ;; Programs such as Ghostscript rely on it.
66 (with-directory-excursion bin
67 (symlink (car (find-files "." "tclsh"))
71 ;; By default, man pages are put in PREFIX/man, but we want them in
72 ;; PREFIX/share/man. The 'validate-documentation-location' phase is
73 ;; not able to fix this up because the default install populates both
74 ;; PREFIX/man and PREFIX/share/man.
75 #:configure-flags (list (string-append "--mandir="
76 (assoc-ref %outputs "out")
79 ;; XXX: There are a few test failures (related to HTTP, most
80 ;; likely related to name resolution), but that doesn't cause
82 #:test-target "test"))
83 (home-page "http://www.tcl.tk/")
84 (synopsis "The Tcl scripting language")
85 (description "The Tcl (Tool Command Language) scripting language.")
96 (uri (string-append "mirror://sourceforge/expect/Expect/"
97 version "/expect" version ".tar.gz"))
100 "0h60bifxj876afz4im35rmnbnxjx4lbdqp2ja3k30fwa8a8cm3dj"))))
101 (build-system gnu-build-system)
103 `(;; TODO: Add these optional dependencies.
104 ;; ("libX11" ,libX11)
105 ;; ("xproto" ,xproto)
110 (let ((out (assoc-ref %outputs "out"))
111 (tcl (assoc-ref %build-inputs "tcl")))
112 (list (string-append "--with-tcl=" tcl "/lib")
113 (string-append "--with-tclinclude=" tcl "/include")
114 (string-append "--exec-prefix=" out)
115 (string-append "--mandir=" out "/share/man")))
117 #:phases (alist-cons-before
118 'configure 'set-path-to-stty
120 (substitute* "configure"
121 (("STTY_BIN=/bin/stty")
122 (string-append "STTY_BIN=" (which "stty")))))
125 #:test-target "test"))
126 (home-page "http://expect.nist.gov/")
127 (synopsis "Tool for automating interactive applications")
129 "Expect is a tool for automating interactive applications such as
130 telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this
131 stuff trivial. Expect is also useful for testing these same
132 applications. And by adding Tk, you can wrap interactive applications in
134 (license public-domain))) ; as written in `license.terms'
142 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
143 version "/tk" version "-src.tar.gz"))
146 "17diivcfcwdhp4v5zi6j9nkxncccjqkivhp363c4wx5lf4d3fb6n"))
147 (patches (search-patches "tk-find-library.patch"))))
148 (build-system gnu-build-system)
150 '(#:phases (modify-phases %standard-phases
152 'configure 'pre-configure
156 'install 'add-fontconfig-flag
157 (lambda* (#:key inputs outputs #:allow-other-keys)
158 ;; Add the missing -L flag for Fontconfig in 'tk.pc' and
160 (let ((out (assoc-ref outputs "out"))
161 (fontconfig (assoc-ref inputs "fontconfig")))
162 (substitute* (find-files out
163 "^(tkConfig\\.sh|tk\\.pc)$")
165 (string-append "-L" fontconfig
166 "/lib -lfontconfig")))
169 #:configure-flags (list (string-append "--with-tcl="
170 (assoc-ref %build-inputs "tcl")
173 ;; The tests require a running X server, so we just skip them.
175 (native-inputs `(("pkg-config" ,pkg-config)))
176 (inputs `(("libxft" ,libxft)
177 ("fontconfig" ,fontconfig)
179 ;; tk.h refers to X11 headers, hence the propagation.
180 (propagated-inputs `(("libx11" ,libx11)
181 ("libxext" ,libxext)))
183 (home-page "http://www.tcl.tk/")
184 (synopsis "Graphical user interface toolkit for Tcl")
186 "Tk is a graphical toolkit for building graphical user
187 interfaces (GUIs) in the Tcl language.")
188 (license (package-license tcl))))
190 (define-public perl-tk
197 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
201 "1bc8bacsf95598yimrxijymb3advrgan73pqxj75qmd20ydnwxc4"))))
202 (build-system perl-build-system)
203 (native-inputs `(("pkg-config" ,pkg-config)))
204 (inputs `(("libx11" ,libx11)
206 ("libjpeg" ,libjpeg)))
208 `(#:make-maker-flags `(,(string-append
209 "X11=" (assoc-ref %build-inputs "libx11")))
211 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
212 #:parallel-build? #f))
213 (synopsis "Graphical user interface toolkit for Perl")
215 "Tk is a Graphical User Interface ToolKit.")
216 (home-page (string-append "http://search.cpan.org/~srezic/Tk-" version))
217 ;; From the package README: "... you can redistribute it and/or modify it
218 ;; under the same terms as Perl itself, with the exception of all the
219 ;; files in the pTk sub-directory which have separate terms derived from
220 ;; those of the orignal Tix4.1.3 or Tk8.4.* sources. See the files
221 ;; pTk/license.terms, pTk/license.html_lib, and pTk/Tix.license for
222 ;; details of this license."
223 (license perl-license)))
225 (define-public tcllib
231 (uri (string-append "mirror://sourceforge/" name "/" name "/"
232 version "/" name "-" version ".tar.gz"))
235 "05dmrk9qsryah2n17z6z85dj9l9lfyvnsd7faw0p9bs1pp5pwrkj"))))
236 (build-system gnu-build-system)
240 (list (search-path-specification
241 (variable "TCLLIBPATH")
243 (files (list (string-append "lib/tcllib" version))))))
244 (home-page "https://core.tcl.tk/tcllib/home")
245 (synopsis "Standard Tcl Library")
246 (description "Tcllib, the standard Tcl library, is a collection of common
247 utility functions and modules all written in high-level Tcl.")
248 (license (package-license tcl))))
250 (define-public tclxml
256 (uri (string-append "mirror://sourceforge/" name "/TclXML/"
257 version "/" name "-" version ".tar.gz"))
260 "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
261 (patches (search-patches "tclxml-3.2-install.patch"))))
262 (build-system gnu-build-system)
267 ("libxslt" ,libxslt)))
269 (list (search-path-specification
270 (variable "TCLLIBPATH")
272 (files (list (string-append "lib/Tclxml" version))))))
275 (list (string-append "--exec-prefix=" (assoc-ref %outputs "out"))
276 (string-append "--with-tclconfig="
277 (assoc-ref %build-inputs "tcl") "/lib")
278 (string-append "--with-xml2-config="
279 (assoc-ref %build-inputs "libxml2")
281 (string-append "--with-xslt-config="
282 (assoc-ref %build-inputs "libxslt")
284 #:test-target "test"))
285 (home-page "http://tclxml.sourceforge.net/")
286 (synopsis "Tcl library for XML parsing")
287 (description "TclXML provides event-based parsing of XML documents. The
288 application may register callback scripts for certain document features, and
289 when the parser encounters those features while parsing the document the
290 callback is evaluated.")
291 (license (non-copyleft
293 "See LICENCE in the distribution."))))
301 (uri (string-append "mirror://sourceforge/tclx/TclX/"
302 version "/tclx" version ".tar.bz2"))
305 "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59"))))
306 (build-system gnu-build-system)
308 '(#:tests? #f ; a test named profile.test segfaults
309 #:configure-flags (list (string-append "--with-tcl="
310 (assoc-ref %build-inputs "tcl")
312 (string-append "--libdir="
313 (assoc-ref %outputs "out")
318 (home-page "http://tclx.sourceforge.net/")
319 (synopsis "System programming extensions for Tcl")
321 "Extended Tcl is oriented towards system programming tasks and large
322 application development. TclX provides additional interfaces to the operating
323 system, and adds many new programming constructs, text manipulation tools, and