Merge remote-tracking branch 'origin/master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / tcl.scm
CommitLineData
4a219a1a 1;;; GNU Guix --- Functional package management for GNU
9b1bf330 2;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
6fea8ade 3;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
de0c3141 4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
49b92a24 5;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
50fe318c 6;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
3c8ba11a 7;;; Copyright © 2017 Kei Kebreau <kkebreau@posteo.net>
9cc03bbf 8;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
d9d836c3 9;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
4a219a1a
LC
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
1ffa7090 26(define-module (gnu packages tcl)
4a219a1a
LC
27 #:use-module (guix packages)
28 #:use-module (guix download)
d9d836c3 29 #:use-module (guix git-download)
49b92a24 30 #:use-module (guix utils)
4a219a1a 31 #:use-module (guix build-system gnu)
d9d836c3 32 #:use-module (guix build-system go)
de0c3141 33 #:use-module (guix build-system perl)
f5ea273a 34 #:use-module (gnu packages)
e55354b8 35 #:use-module (gnu packages image)
c3aeac38 36 #:use-module (gnu packages fontutils)
de0c3141
EB
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages pkg-config)
511539ae 39 #:use-module (gnu packages xml)
765904ce 40 #:use-module (gnu packages xorg)
d9d836c3 41 #:use-module ((guix licenses) #:prefix license:))
4a219a1a
LC
42
43(define-public tcl
44 (package
45 (name "tcl")
72c7788f 46 (version "8.6.10")
f8e7fdc4
LC
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
72c7788f 53 "1vc7imilx6kcb5319r7hnrp4jn5pqb41an3vr3azhgcfcgvdp5ji"))))
4a219a1a
LC
54 (build-system gnu-build-system)
55 (arguments
2ce30a37 56 `(#:phases (modify-phases %standard-phases
1004a92c
MB
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.
6fea8ade
MW
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))))
eb6d676e 71
c9a46555
MW
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.
2ce30a37
MO
76 #:configure-flags
77 (list (string-append "--mandir="
78 (assoc-ref %outputs "out")
79 "/share/man")
80 ;; This is needed when cross-compiling, see:
81 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
82 ,@(if (%current-target-system)
83 '("tcl_cv_strtod_buggy=1"
84 "ac_cv_func_strtod=yes")
85 '()))
c9a46555 86
eb6d676e
LC
87 ;; XXX: There are a few test failures (related to HTTP, most
88 ;; likely related to name resolution), but that doesn't cause
89 ;; `make' to fail.
90 #:test-target "test"))
068d0a1c 91 (home-page "https://www.tcl.tk/")
4a219a1a
LC
92 (synopsis "The Tcl scripting language")
93 (description "The Tcl (Tool Command Language) scripting language.")
d9d836c3 94 (license license:tcl/tk)))
4a219a1a
LC
95
96
97(define-public expect
98 (package
99 (name "expect")
9cc03bbf 100 (version "5.45.4")
4a219a1a
LC
101 (source
102 (origin
103 (method url-fetch)
104 (uri (string-append "mirror://sourceforge/expect/Expect/"
105 version "/expect" version ".tar.gz"))
106 (sha256
107 (base32
9cc03bbf 108 "0d1cp5hggjl93xwc8h1y6adbnrvpkk0ywkd00inz9ndxn21xm9s9"))))
4a219a1a
LC
109 (build-system gnu-build-system)
110 (inputs
111 `(;; TODO: Add these optional dependencies.
112 ;; ("libX11" ,libX11)
6a6db57f 113 ;; ("xorgproto" ,xorgproto)
4a219a1a
LC
114 ;; ("tk" ,tk)
115 ("tcl" ,tcl)))
116 (arguments
117 '(#:configure-flags
988cecfd
MW
118 (let ((out (assoc-ref %outputs "out"))
119 (tcl (assoc-ref %build-inputs "tcl")))
120 (list (string-append "--with-tcl=" tcl "/lib")
121 (string-append "--with-tclinclude=" tcl "/include")
122 (string-append "--exec-prefix=" out)
123 (string-append "--mandir=" out "/share/man")))
eb6d676e 124
dc1d3cde
KK
125 #:phases
126 (modify-phases %standard-phases
127 (add-before 'configure 'set-path-to-stty
128 (lambda _
129 (substitute* "configure"
130 (("STTY_BIN=/bin/stty")
131 (string-append "STTY_BIN=" (which "stty"))))
132 #t)))
d5529a91 133
eb6d676e 134 #:test-target "test"))
ad549242 135 (home-page "http://expect.sourceforge.net/")
9e771e3b 136 (synopsis "Tool for automating interactive applications")
4a219a1a
LC
137 (description
138 "Expect is a tool for automating interactive applications such as
139telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this
35b9e423
EB
140stuff trivial. Expect is also useful for testing these same
141applications. And by adding Tk, you can wrap interactive applications in
4a219a1a 142X11 GUIs.")
d9d836c3 143 (license license:public-domain))) ; as written in `license.terms'
765904ce
LC
144
145(define-public tk
146 (package
147 (name "tk")
72c7788f 148 (version "8.6.10")
765904ce
LC
149 (source (origin
150 (method url-fetch)
151 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
b5a72640
MB
152 (version-prefix version 3) "/tk"
153 version "-src.tar.gz"))
765904ce
LC
154 (sha256
155 (base32
72c7788f 156 "11p3ycqbr5116vpaxv6fl6md6gcav1ffspgr8wrlc2lxhn543pv3"))
fc1adab1 157 (patches (search-patches "tk-find-library.patch"))))
765904ce
LC
158 (build-system gnu-build-system)
159 (arguments
49b92a24 160 `(#:phases (modify-phases %standard-phases
c3aeac38
LC
161 (add-before
162 'configure 'pre-configure
163 (lambda _
eed6985f
MW
164 (chdir "unix")
165 #t))
49b92a24
EF
166 (add-after
167 'install 'create-wish-symlink
168 (lambda* (#:key outputs #:allow-other-keys)
169 (let ((out (assoc-ref outputs "out")))
170 (symlink (string-append out "/bin/wish"
171 ,(version-major+minor
172 (package-version tk)))
173 (string-append out "/bin/wish")))
174 #t))
c3aeac38
LC
175 (add-after
176 'install 'add-fontconfig-flag
177 (lambda* (#:key inputs outputs #:allow-other-keys)
178 ;; Add the missing -L flag for Fontconfig in 'tk.pc' and
179 ;; 'tkConfig.sh'.
180 (let ((out (assoc-ref outputs "out"))
181 (fontconfig (assoc-ref inputs "fontconfig")))
182 (substitute* (find-files out
183 "^(tkConfig\\.sh|tk\\.pc)$")
184 (("-lfontconfig")
185 (string-append "-L" fontconfig
186 "/lib -lfontconfig")))
187 #t))))
765904ce 188
ee4c8c89
MO
189 #:configure-flags
190 (list (string-append "--with-tcl="
191 (assoc-ref %build-inputs "tcl")
192 "/lib")
193 ;; This is needed when cross-compiling, see:
194 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
195 ,@(if (%current-target-system)
196 '("tcl_cv_strtod_buggy=1"
197 "ac_cv_func_strtod=yes")
198 '()))
765904ce
LC
199
200 ;; The tests require a running X server, so we just skip them.
201 #:tests? #f))
8a0263f1
SB
202 (native-inputs `(("pkg-config" ,pkg-config)))
203 (inputs `(("libxft" ,libxft)
c3aeac38 204 ("fontconfig" ,fontconfig)
8a0263f1 205 ("tcl" ,tcl)))
765904ce
LC
206 ;; tk.h refers to X11 headers, hence the propagation.
207 (propagated-inputs `(("libx11" ,libx11)
208 ("libxext" ,libxext)))
209
49b92a24 210 (home-page "https://www.tcl.tk/")
765904ce
LC
211 (synopsis "Graphical user interface toolkit for Tcl")
212 (description
cb150ca3
LC
213 "Tk is a graphical toolkit for building graphical user
214interfaces (GUIs) in the Tcl language.")
765904ce 215 (license (package-license tcl))))
de0c3141
EB
216
217(define-public perl-tk
218 (package
219 (name "perl-tk")
b1c699c4 220 (version "804.034")
de0c3141
EB
221 (source (origin
222 (method url-fetch)
223 (uri (string-append
224 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
225 version ".tar.gz"))
226 (sha256
227 (base32
b1c699c4 228 "1qiz55dmw7hm1wgpjdzf2jffwcj0hisr3kf80qi8lli3qx2b39py"))))
de0c3141
EB
229 (build-system perl-build-system)
230 (native-inputs `(("pkg-config" ,pkg-config)))
231 (inputs `(("libx11" ,libx11)
232 ("libpng" ,libpng)
233 ("libjpeg" ,libjpeg)))
234 (arguments
235 `(#:make-maker-flags `(,(string-append
cb150ca3
LC
236 "X11=" (assoc-ref %build-inputs "libx11")))
237
238 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
239 #:parallel-build? #f))
de0c3141
EB
240 (synopsis "Graphical user interface toolkit for Perl")
241 (description
242 "Tk is a Graphical User Interface ToolKit.")
9aba9b12 243 (home-page "https://metacpan.org/release/Tk")
de0c3141
EB
244 ;; From the package README: "... you can redistribute it and/or modify it
245 ;; under the same terms as Perl itself, with the exception of all the
246 ;; files in the pTk sub-directory which have separate terms derived from
247 ;; those of the orignal Tix4.1.3 or Tk8.4.* sources. See the files
248 ;; pTk/license.terms, pTk/license.html_lib, and pTk/Tix.license for
249 ;; details of this license."
d9d836c3 250 (license license:perl-license)))
50fe318c
JN
251
252(define-public tcllib
253 (package
254 (name "tcllib")
345eec82 255 (version "1.19")
50fe318c
JN
256 (source (origin
257 (method url-fetch)
f86f1531
TGR
258 (uri (string-append "mirror://sourceforge/tcllib/tcllib/"
259 version "/tcllib-" version ".tar.gz"))
50fe318c
JN
260 (sha256
261 (base32
345eec82 262 "173abxaazdmf210v651708ab6h7xhskvd52krxk6ifam337qgzh1"))))
50fe318c
JN
263 (build-system gnu-build-system)
264 (native-inputs
265 `(("tcl" ,tcl)))
266 (native-search-paths
267 (list (search-path-specification
268 (variable "TCLLIBPATH")
269 (separator " ")
270 (files (list (string-append "lib/tcllib" version))))))
271 (home-page "https://core.tcl.tk/tcllib/home")
272 (synopsis "Standard Tcl Library")
273 (description "Tcllib, the standard Tcl library, is a collection of common
274utility functions and modules all written in high-level Tcl.")
275 (license (package-license tcl))))
511539ae 276
1966481f
DM
277(define-public tklib
278 (package
279 (name "tklib")
280 (version "0.6")
281 (source (origin
282 (method url-fetch)
283 (uri (string-append "https://core.tcl.tk/tklib/tarball/tklib-"
284 version ".tar.gz?uuid=tklib-0-6"))
285 (sha256
286 (base32
287 "03y0bzgwbh7nnyqkh8n00bbkq2fyblq39s3bdb6mawna0bbn0wwg"))))
288 (build-system gnu-build-system)
289 (native-inputs
290 `(("tcl" ,tcl)))
291 (propagated-inputs
292 `(("tcllib" ,tcllib)
293 ("tk" ,tk))) ; for "wish"
294 (native-search-paths
295 (list (search-path-specification
296 (variable "TCLLIBPATH")
297 (separator " ")
298 (files (list (string-append "lib/tklib" version))))))
299 (home-page "https://www.tcl.tk/software/tklib/")
300 (synopsis "Tk utility modules for Tcl")
301 (description "Tklib is a collection of common utility functions and
302modules for Tk, all written in high-level Tcl. Examples of provided widgets:
303@enumerate
304@item @code{chatwidget}
305@item @code{datefield}
958be7a4 306@item @code{tooltip}
1966481f
DM
307@item @code{cursor}
308@item @code{ipentry}
309@item @code{tablelist}
310@item @code{history}
311@item @code{tkpiechart}
312@item @code{ico}
313@item @code{crosshair}
314@item @code{ntext}
315@item @code{plotchart}
316@item @code{ctext}
317@item @code{autosscroll}
318@item @code{canvas}
eb52d637 319@end enumerate")
1966481f
DM
320 (license (package-license tcl))))
321
511539ae
JN
322(define-public tclxml
323 (package
324 (name "tclxml")
325 (version "3.2")
326 (source (origin
327 (method url-fetch)
de67e922
LF
328 (uri (string-append "mirror://sourceforge/" name "/TclXML/"
329 version "/" name "-" version ".tar.gz"))
511539ae
JN
330 (sha256
331 (base32
332 "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
fc1adab1 333 (patches (search-patches "tclxml-3.2-install.patch"))))
511539ae
JN
334 (build-system gnu-build-system)
335 (native-inputs
336 `(("tcl" ,tcl)
511539ae
JN
337 ("libxml2" ,libxml2)
338 ("libxslt" ,libxslt)))
bc01c891
DM
339 (propagated-inputs
340 `(("tcllib" ,tcllib))) ; uri
511539ae
JN
341 (native-search-paths
342 (list (search-path-specification
343 (variable "TCLLIBPATH")
344 (separator " ")
345 (files (list (string-append "lib/Tclxml" version))))))
346 (arguments
347 `(#:configure-flags
348 (list (string-append "--exec-prefix=" (assoc-ref %outputs "out"))
349 (string-append "--with-tclconfig="
350 (assoc-ref %build-inputs "tcl") "/lib")
351 (string-append "--with-xml2-config="
352 (assoc-ref %build-inputs "libxml2")
353 "/bin/xml2-config")
354 (string-append "--with-xslt-config="
355 (assoc-ref %build-inputs "libxslt")
356 "/bin/xslt-config"))
357 #:test-target "test"))
358 (home-page "http://tclxml.sourceforge.net/")
359 (synopsis "Tcl library for XML parsing")
360 (description "TclXML provides event-based parsing of XML documents. The
361application may register callback scripts for certain document features, and
362when the parser encounters those features while parsing the document the
363callback is evaluated.")
d9d836c3 364 (license (license:non-copyleft
511539ae
JN
365 "file://LICENCE"
366 "See LICENCE in the distribution."))))
0ef83ec9
KK
367
368(define-public tclx
369 (package
370 (name "tclx")
371 (version "8.4.1")
372 (source (origin
373 (method url-fetch)
374 (uri (string-append "mirror://sourceforge/tclx/TclX/"
375 version "/tclx" version ".tar.bz2"))
376 (sha256
377 (base32
378 "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59"))))
379 (build-system gnu-build-system)
380 (arguments
381 '(#:tests? #f ; a test named profile.test segfaults
382 #:configure-flags (list (string-append "--with-tcl="
383 (assoc-ref %build-inputs "tcl")
384 "/lib")
385 (string-append "--libdir="
386 (assoc-ref %outputs "out")
387 "/lib"))))
388 (inputs
389 `(("tcl" ,tcl)
390 ("tk" ,tk)))
391 (home-page "http://tclx.sourceforge.net/")
392 (synopsis "System programming extensions for Tcl")
393 (description
394 "Extended Tcl is oriented towards system programming tasks and large
395application development. TclX provides additional interfaces to the operating
396system, and adds many new programming constructs, text manipulation tools, and
397debugging tools.")
d9d836c3 398 (license license:tcl/tk)))
a5c86aa0
JL
399
400(define-public go-github.com-nsf-gothic
401 (let ((commit "97dfcc195b9de36c911a69a6ec2b5b2659c05652")
402 (revision "0"))
403 (package
404 (name "go-github.com-nsf-gothic")
405 (version (git-version "0.0.0" revision commit))
406 (source (origin
407 (method git-fetch)
408 (uri (git-reference
409 (url "https://github.com/nsf/gothic")
410 (commit commit)))
411 (sha256
412 (base32
413 "1lrhbml6r4sh22rrn3m9bck70pv0g0c1diprg7cil90x0jidxczr"))
414 (file-name (git-file-name name version))))
415 (build-system go-build-system)
416 (arguments
417 `(#:import-path "github.com/nsf/gothic"))
418 (propagated-inputs
419 `(("tk" ,tk)
420 ("tcl" ,tcl)))
421 (home-page "https://github.com/nsf/gothic")
422 (synopsis "Tcl/Tk Go bindings")
423 (description "Gothic contains Go bindings for Tcl/Tk. The package contains
424only one type and one function that can be used to create a Tk interpreter.")
425 (license license:expat))))