gnu: Add texlive-latex-etoolbox.
[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 <kei@openmailbox.org>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
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.
15 ;;;
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.
20 ;;;
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/>.
23
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))
37
38 (define-public tcl
39 (package
40 (name "tcl")
41 (version "8.6.6")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
45 version "/tcl" version "-src.tar.gz"))
46 (sha256
47 (base32
48 "01zypqhy57wvh1ikk28bg733sk5kf4q568pq9v6fvcz4h6bl0rd2"))
49 (patches (search-patches "tcl-mkindex-deterministic.patch"))))
50 (build-system gnu-build-system)
51 (arguments
52 '(#:phases (alist-cons-before
53 'configure 'pre-configure
54 (lambda _
55 (chdir "unix"))
56 (alist-cons-after
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")
63 "/bin")))
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"))
68 "tclsh")))))
69 %standard-phases))
70
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")
77 "/share/man"))
78
79 ;; XXX: There are a few test failures (related to HTTP, most
80 ;; likely related to name resolution), but that doesn't cause
81 ;; `make' to fail.
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.")
86 (license tcl/tk)))
87
88
89 (define-public expect
90 (package
91 (name "expect")
92 (version "5.45")
93 (source
94 (origin
95 (method url-fetch)
96 (uri (string-append "mirror://sourceforge/expect/Expect/"
97 version "/expect" version ".tar.gz"))
98 (sha256
99 (base32
100 "0h60bifxj876afz4im35rmnbnxjx4lbdqp2ja3k30fwa8a8cm3dj"))))
101 (build-system gnu-build-system)
102 (inputs
103 `(;; TODO: Add these optional dependencies.
104 ;; ("libX11" ,libX11)
105 ;; ("xproto" ,xproto)
106 ;; ("tk" ,tk)
107 ("tcl" ,tcl)))
108 (arguments
109 '(#:configure-flags
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")))
116
117 #:phases (alist-cons-before
118 'configure 'set-path-to-stty
119 (lambda _
120 (substitute* "configure"
121 (("STTY_BIN=/bin/stty")
122 (string-append "STTY_BIN=" (which "stty")))))
123 %standard-phases)
124
125 #:test-target "test"))
126 (home-page "http://expect.nist.gov/")
127 (synopsis "Tool for automating interactive applications")
128 (description
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
133 X11 GUIs.")
134 (license public-domain))) ; as written in `license.terms'
135
136 (define-public tk
137 (package
138 (name "tk")
139 (version "8.6.6")
140 (source (origin
141 (method url-fetch)
142 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
143 version "/tk" version "-src.tar.gz"))
144 (sha256
145 (base32
146 "17diivcfcwdhp4v5zi6j9nkxncccjqkivhp363c4wx5lf4d3fb6n"))
147 (patches (search-patches "tk-find-library.patch"))))
148 (build-system gnu-build-system)
149 (arguments
150 '(#:phases (modify-phases %standard-phases
151 (add-before
152 'configure 'pre-configure
153 (lambda _
154 (chdir "unix")))
155 (add-after
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
159 ;; 'tkConfig.sh'.
160 (let ((out (assoc-ref outputs "out"))
161 (fontconfig (assoc-ref inputs "fontconfig")))
162 (substitute* (find-files out
163 "^(tkConfig\\.sh|tk\\.pc)$")
164 (("-lfontconfig")
165 (string-append "-L" fontconfig
166 "/lib -lfontconfig")))
167 #t))))
168
169 #:configure-flags (list (string-append "--with-tcl="
170 (assoc-ref %build-inputs "tcl")
171 "/lib"))
172
173 ;; The tests require a running X server, so we just skip them.
174 #:tests? #f))
175 (native-inputs `(("pkg-config" ,pkg-config)))
176 (inputs `(("libxft" ,libxft)
177 ("fontconfig" ,fontconfig)
178 ("tcl" ,tcl)))
179 ;; tk.h refers to X11 headers, hence the propagation.
180 (propagated-inputs `(("libx11" ,libx11)
181 ("libxext" ,libxext)))
182
183 (home-page "http://www.tcl.tk/")
184 (synopsis "Graphical user interface toolkit for Tcl")
185 (description
186 "Tk is a graphical toolkit for building graphical user
187 interfaces (GUIs) in the Tcl language.")
188 (license (package-license tcl))))
189
190 (define-public perl-tk
191 (package
192 (name "perl-tk")
193 (version "804.033")
194 (source (origin
195 (method url-fetch)
196 (uri (string-append
197 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
198 version ".tar.gz"))
199 (sha256
200 (base32
201 "1bc8bacsf95598yimrxijymb3advrgan73pqxj75qmd20ydnwxc4"))))
202 (build-system perl-build-system)
203 (native-inputs `(("pkg-config" ,pkg-config)))
204 (inputs `(("libx11" ,libx11)
205 ("libpng" ,libpng)
206 ("libjpeg" ,libjpeg)))
207 (arguments
208 `(#:make-maker-flags `(,(string-append
209 "X11=" (assoc-ref %build-inputs "libx11")))
210
211 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
212 #:parallel-build? #f))
213 (synopsis "Graphical user interface toolkit for Perl")
214 (description
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)))
224
225 (define-public tcllib
226 (package
227 (name "tcllib")
228 (version "1.18")
229 (source (origin
230 (method url-fetch)
231 (uri (string-append "mirror://sourceforge/" name "/" name "/"
232 version "/" name "-" version ".tar.gz"))
233 (sha256
234 (base32
235 "05dmrk9qsryah2n17z6z85dj9l9lfyvnsd7faw0p9bs1pp5pwrkj"))))
236 (build-system gnu-build-system)
237 (native-inputs
238 `(("tcl" ,tcl)))
239 (native-search-paths
240 (list (search-path-specification
241 (variable "TCLLIBPATH")
242 (separator " ")
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))))
249
250 (define-public tclxml
251 (package
252 (name "tclxml")
253 (version "3.2")
254 (source (origin
255 (method url-fetch)
256 (uri (string-append "mirror://sourceforge/" name "/TclXML/"
257 version "/" name "-" version ".tar.gz"))
258 (sha256
259 (base32
260 "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
261 (patches (search-patches "tclxml-3.2-install.patch"))))
262 (build-system gnu-build-system)
263 (native-inputs
264 `(("tcl" ,tcl)
265 ("tcllib" ,tcllib)
266 ("libxml2" ,libxml2)
267 ("libxslt" ,libxslt)))
268 (native-search-paths
269 (list (search-path-specification
270 (variable "TCLLIBPATH")
271 (separator " ")
272 (files (list (string-append "lib/Tclxml" version))))))
273 (arguments
274 `(#:configure-flags
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")
280 "/bin/xml2-config")
281 (string-append "--with-xslt-config="
282 (assoc-ref %build-inputs "libxslt")
283 "/bin/xslt-config"))
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
292 "file://LICENCE"
293 "See LICENCE in the distribution."))))
294
295 (define-public tclx
296 (package
297 (name "tclx")
298 (version "8.4.1")
299 (source (origin
300 (method url-fetch)
301 (uri (string-append "mirror://sourceforge/tclx/TclX/"
302 version "/tclx" version ".tar.bz2"))
303 (sha256
304 (base32
305 "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59"))))
306 (build-system gnu-build-system)
307 (arguments
308 '(#:tests? #f ; a test named profile.test segfaults
309 #:configure-flags (list (string-append "--with-tcl="
310 (assoc-ref %build-inputs "tcl")
311 "/lib")
312 (string-append "--libdir="
313 (assoc-ref %outputs "out")
314 "/lib"))))
315 (inputs
316 `(("tcl" ,tcl)
317 ("tk" ,tk)))
318 (home-page "http://tclx.sourceforge.net/")
319 (synopsis "System programming extensions for Tcl")
320 (description
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
324 debugging tools.")
325 (license tcl/tk)))