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