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>
8 ;;; This file is part of GNU Guix.
10 ;;; GNU Guix is free software; you can redistribute it and/or modify it
11 ;;; under the terms of the GNU General Public License as published by
12 ;;; the Free Software Foundation; either version 3 of the License, or (at
13 ;;; your option) any later version.
15 ;;; GNU Guix is distributed in the hope that it will be useful, but
16 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;;; GNU General Public License for more details.
20 ;;; You should have received a copy of the GNU General Public License
21 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23 (define-module (gnu packages tcl)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system perl)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages image)
30 #:use-module (gnu packages fontutils)
31 #:use-module (gnu packages perl)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages xml)
34 #:use-module (gnu packages xorg)
35 #:use-module (guix licenses))
43 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
44 version "/tcl" version "-src.tar.gz"))
47 "01zypqhy57wvh1ikk28bg733sk5kf4q568pq9v6fvcz4h6bl0rd2"))
48 (patches (search-patches "tcl-mkindex-deterministic.patch"))))
49 (build-system gnu-build-system)
51 '(#:phases (alist-cons-before
52 'configure 'pre-configure
56 'install 'install-private-headers
57 (lambda* (#:key outputs #:allow-other-keys)
58 ;; Private headers are needed by Expect.
59 (and (zero? (system* "make"
60 "install-private-headers"))
61 (let ((bin (string-append (assoc-ref outputs "out")
63 ;; Create a tclsh -> tclsh8.6 symlink.
64 ;; Programs such as Ghostscript rely on it.
65 (with-directory-excursion bin
66 (symlink (car (find-files "." "tclsh"))
70 ;; By default, man pages are put in PREFIX/man, but we want them in
71 ;; PREFIX/share/man. The 'validate-documentation-location' phase is
72 ;; not able to fix this up because the default install populates both
73 ;; PREFIX/man and PREFIX/share/man.
74 #:configure-flags (list (string-append "--mandir="
75 (assoc-ref %outputs "out")
78 ;; XXX: There are a few test failures (related to HTTP, most
79 ;; likely related to name resolution), but that doesn't cause
81 #:test-target "test"))
82 (home-page "http://www.tcl.tk/")
83 (synopsis "The Tcl scripting language")
84 (description "The Tcl (Tool Command Language) scripting language.")
95 (uri (string-append "mirror://sourceforge/expect/Expect/"
96 version "/expect" version ".tar.gz"))
99 "0h60bifxj876afz4im35rmnbnxjx4lbdqp2ja3k30fwa8a8cm3dj"))))
100 (build-system gnu-build-system)
102 `(;; TODO: Add these optional dependencies.
103 ;; ("libX11" ,libX11)
104 ;; ("xproto" ,xproto)
109 (let ((out (assoc-ref %outputs "out"))
110 (tcl (assoc-ref %build-inputs "tcl")))
111 (list (string-append "--with-tcl=" tcl "/lib")
112 (string-append "--with-tclinclude=" tcl "/include")
113 (string-append "--exec-prefix=" out)
114 (string-append "--mandir=" out "/share/man")))
116 #:phases (alist-cons-before
117 'configure 'set-path-to-stty
119 (substitute* "configure"
120 (("STTY_BIN=/bin/stty")
121 (string-append "STTY_BIN=" (which "stty")))))
124 #:test-target "test"))
125 (home-page "http://expect.nist.gov/")
126 (synopsis "Tool for automating interactive applications")
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
133 (license public-domain))) ; as written in `license.terms'
141 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
142 version "/tk" version "-src.tar.gz"))
145 "17diivcfcwdhp4v5zi6j9nkxncccjqkivhp363c4wx5lf4d3fb6n"))
146 (patches (search-patches "tk-find-library.patch"))))
147 (build-system gnu-build-system)
149 '(#:phases (modify-phases %standard-phases
151 'configure 'pre-configure
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
159 (let ((out (assoc-ref outputs "out"))
160 (fontconfig (assoc-ref inputs "fontconfig")))
161 (substitute* (find-files out
162 "^(tkConfig\\.sh|tk\\.pc)$")
164 (string-append "-L" fontconfig
165 "/lib -lfontconfig")))
168 #:configure-flags (list (string-append "--with-tcl="
169 (assoc-ref %build-inputs "tcl")
172 ;; The tests require a running X server, so we just skip them.
174 (native-inputs `(("pkg-config" ,pkg-config)))
175 (inputs `(("libxft" ,libxft)
176 ("fontconfig" ,fontconfig)
178 ;; tk.h refers to X11 headers, hence the propagation.
179 (propagated-inputs `(("libx11" ,libx11)
180 ("libxext" ,libxext)))
182 (home-page "http://www.tcl.tk/")
183 (synopsis "Graphical user interface toolkit for Tcl")
185 "Tk is a graphical toolkit for building graphical user
186 interfaces (GUIs) in the Tcl language.")
187 (license (package-license tcl))))
189 (define-public perl-tk
196 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
200 "1bc8bacsf95598yimrxijymb3advrgan73pqxj75qmd20ydnwxc4"))))
201 (build-system perl-build-system)
202 (native-inputs `(("pkg-config" ,pkg-config)))
203 (inputs `(("libx11" ,libx11)
205 ("libjpeg" ,libjpeg)))
207 `(#:make-maker-flags `(,(string-append
208 "X11=" (assoc-ref %build-inputs "libx11")))
210 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
211 #:parallel-build? #f))
212 (synopsis "Graphical user interface toolkit for Perl")
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 (package-license perl))))
224 (define-public tcllib
230 (uri (string-append "mirror://sourceforge/" name "/" name "/"
231 version "/" name "-" version ".tar.gz"))
234 "05dmrk9qsryah2n17z6z85dj9l9lfyvnsd7faw0p9bs1pp5pwrkj"))))
235 (build-system gnu-build-system)
239 (list (search-path-specification
240 (variable "TCLLIBPATH")
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))))
249 (define-public tclxml
255 (uri (string-append "mirror://sourceforge/" name "/TclXML/"
256 version "/" name "-" version ".tar.gz"))
259 "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
260 (patches (search-patches "tclxml-3.2-install.patch"))))
261 (build-system gnu-build-system)
266 ("libxslt" ,libxslt)))
268 (list (search-path-specification
269 (variable "TCLLIBPATH")
271 (files (list (string-append "lib/Tclxml" version))))))
274 (list (string-append "--exec-prefix=" (assoc-ref %outputs "out"))
275 (string-append "--with-tclconfig="
276 (assoc-ref %build-inputs "tcl") "/lib")
277 (string-append "--with-xml2-config="
278 (assoc-ref %build-inputs "libxml2")
280 (string-append "--with-xslt-config="
281 (assoc-ref %build-inputs "libxslt")
283 #:test-target "test"))
284 (home-page "http://tclxml.sourceforge.net/")
285 (synopsis "Tcl library for XML parsing")
286 (description "TclXML provides event-based parsing of XML documents. The
287 application may register callback scripts for certain document features, and
288 when the parser encounters those features while parsing the document the
289 callback is evaluated.")
290 (license (non-copyleft
292 "See LICENCE in the distribution."))))