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