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>
12 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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:))
50 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
51 version "/tcl" version "-src.tar.gz"))
54 "1vc7imilx6kcb5319r7hnrp4jn5pqb41an3vr3azhgcfcgvdp5ji"))
55 (patches (search-patches "tcl-fix-cross-compilation.patch"))))
56 (build-system gnu-build-system)
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")
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"))
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.
79 (list (string-append "--mandir="
80 (assoc-ref %outputs "out")
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")
89 ;; XXX: There are a few test failures (related to HTTP, most
90 ;; likely related to name resolution), but that doesn't cause
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)))
106 "mirror://sourceforge/incrtcl/%5Bincr%20Tcl_Tk%5D-4-source/itcl%20"
107 version "/itcl" version ".tar.gz"))
108 (file-name (string-append "incrtcl-" version ".tar.gz"))
110 (base32 "0w28v0zaraxcq1s9pa6cihqqwqvvwfgz275lks7w4gl7hxjxmasw"))))
111 (build-system gnu-build-system)
116 "--exec-prefix=" (assoc-ref %outputs "out"))
118 "--with-tclinclude=" (assoc-ref %build-inputs "tcl") "/include")
120 "--with-tcl=" (assoc-ref %build-inputs "tcl") "/lib"))
123 (modify-phases %standard-phases
124 (add-after 'install 'cleanup-bin-and-lib
125 (lambda* (#:key outputs #:allow-other-keys)
126 ;; NOTE: (Sharlatan-20210213T204336+0000): libraries appearer in
127 ;; "out/lib/itcl{{version}}" and there are no binaries, some extra
128 ;; rename and remove spells are to be applied.
129 (let ((out (assoc-ref outputs "out")))
131 (string-append out "/bin"))
133 (string-append out "/lib/itcl" ,version) (string-append out "/libtmp"))
135 (string-append out "/libtmp") (string-append out "/lib")))
140 `(("tcllib" ,tcllib)))
141 (home-page "http://incrtcl.sourceforge.net/")
142 (synopsis "Object Oriented programming (OOP) extension for Tcl")
144 "[incr Tcl] is a widely used object-oriented system for Tcl. The name is
145 a play on C++, and [incr Tcl] provides a similar object model, including
146 multiple inheritance and public and private classes and variables.")
147 (license license:public-domain)))
149 (define-public expect
156 (uri (string-append "mirror://sourceforge/expect/Expect/"
157 version "/expect" version ".tar.gz"))
160 "0d1cp5hggjl93xwc8h1y6adbnrvpkk0ywkd00inz9ndxn21xm9s9"))))
161 (build-system gnu-build-system)
163 `(;; TODO: Add these optional dependencies.
164 ;; ("libX11" ,libX11)
165 ;; ("xorgproto" ,xorgproto)
170 (let ((out (assoc-ref %outputs "out"))
171 (tcl (assoc-ref %build-inputs "tcl")))
172 (list (string-append "--with-tcl=" tcl "/lib")
173 (string-append "--with-tclinclude=" tcl "/include")
174 (string-append "--exec-prefix=" out)
175 (string-append "--mandir=" out "/share/man")))
178 (modify-phases %standard-phases
179 (add-before 'configure 'set-path-to-stty
181 (substitute* "configure"
182 (("STTY_BIN=/bin/stty")
183 (string-append "STTY_BIN=" (which "stty"))))
186 #:test-target "test"))
187 (home-page "http://expect.sourceforge.net/")
188 (synopsis "Tool for automating interactive applications")
190 "Expect is a tool for automating interactive applications such as
191 telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this
192 stuff trivial. Expect is also useful for testing these same
193 applications. And by adding Tk, you can wrap interactive applications in
195 (license license:public-domain))) ; as written in `license.terms'
203 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
204 (version-prefix version 3) "/tk"
205 version "-src.tar.gz"))
208 "11p3ycqbr5116vpaxv6fl6md6gcav1ffspgr8wrlc2lxhn543pv3"))
209 (patches (search-patches "tk-find-library.patch"))))
210 (build-system gnu-build-system)
212 `(#:phases (modify-phases %standard-phases
214 'configure 'pre-configure
219 'install 'create-wish-symlink
220 (lambda* (#:key outputs #:allow-other-keys)
221 (let ((out (assoc-ref outputs "out")))
222 (symlink (string-append out "/bin/wish"
223 ,(version-major+minor
224 (package-version tk)))
225 (string-append out "/bin/wish")))
228 'install 'add-fontconfig-flag
229 (lambda* (#:key inputs outputs #:allow-other-keys)
230 ;; Add the missing -L flag for Fontconfig in 'tk.pc' and
232 (let ((out (assoc-ref outputs "out"))
233 (fontconfig (assoc-ref inputs "fontconfig")))
234 (substitute* (find-files out
235 "^(tkConfig\\.sh|tk\\.pc)$")
237 (string-append "-L" fontconfig
238 "/lib -lfontconfig")))
242 (list (string-append "--with-tcl="
243 (assoc-ref %build-inputs "tcl")
245 ;; This is needed when cross-compiling, see:
246 ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
247 ,@(if (%current-target-system)
248 '("tcl_cv_strtod_buggy=1"
249 "ac_cv_func_strtod=yes")
252 ;; The tests require a running X server, so we just skip them.
254 (native-inputs `(("pkg-config" ,pkg-config)))
255 (inputs `(("libxft" ,libxft)
256 ("fontconfig" ,fontconfig)
258 ;; tk.h refers to X11 headers, hence the propagation.
259 (propagated-inputs `(("libx11" ,libx11)
260 ("libxext" ,libxext)))
262 (home-page "https://www.tcl.tk/")
263 (synopsis "Graphical user interface toolkit for Tcl")
265 "Tk is a graphical toolkit for building graphical user
266 interfaces (GUIs) in the Tcl language.")
267 (license (package-license tcl))))
269 (define-public perl-tk
276 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
280 "1qiz55dmw7hm1wgpjdzf2jffwcj0hisr3kf80qi8lli3qx2b39py"))))
281 (build-system perl-build-system)
282 (native-inputs `(("pkg-config" ,pkg-config)))
283 (inputs `(("libx11" ,libx11)
285 ("libjpeg" ,libjpeg-turbo)))
287 `(#:make-maker-flags `(,(string-append
288 "X11=" (assoc-ref %build-inputs "libx11")))
290 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
291 #:parallel-build? #f))
292 (synopsis "Graphical user interface toolkit for Perl")
294 "Tk is a Graphical User Interface ToolKit.")
295 (home-page "https://metacpan.org/release/Tk")
296 ;; From the package README: "... you can redistribute it and/or modify it
297 ;; under the same terms as Perl itself, with the exception of all the
298 ;; files in the pTk sub-directory which have separate terms derived from
299 ;; those of the orignal Tix4.1.3 or Tk8.4.* sources. See the files
300 ;; pTk/license.terms, pTk/license.html_lib, and pTk/Tix.license for
301 ;; details of this license."
302 (license license:perl-license)))
304 (define-public tcllib
310 (uri (string-append "mirror://sourceforge/tcllib/tcllib/"
311 version "/tcllib-" version ".tar.gz"))
314 "173abxaazdmf210v651708ab6h7xhskvd52krxk6ifam337qgzh1"))))
315 (build-system gnu-build-system)
319 (list (search-path-specification
320 (variable "TCLLIBPATH")
322 (files (list (string-append "lib/tcllib" version))))))
323 (home-page "https://core.tcl.tk/tcllib/home")
324 (synopsis "Standard Tcl Library")
325 (description "Tcllib, the standard Tcl library, is a collection of common
326 utility functions and modules all written in high-level Tcl.")
327 (license (package-license tcl))))
335 (uri (string-append "https://core.tcl.tk/tklib/tarball/tklib-"
336 version ".tar.gz?uuid=tklib-0-6"))
339 "03y0bzgwbh7nnyqkh8n00bbkq2fyblq39s3bdb6mawna0bbn0wwg"))))
340 (build-system gnu-build-system)
345 ("tk" ,tk))) ; for "wish"
347 (list (search-path-specification
348 (variable "TCLLIBPATH")
350 (files (list (string-append "lib/tklib" version))))))
351 (home-page "https://www.tcl.tk/software/tklib/")
352 (synopsis "Tk utility modules for Tcl")
353 (description "Tklib is a collection of common utility functions and
354 modules for Tk, all written in high-level Tcl. Examples of provided widgets:
356 @item @code{chatwidget}
357 @item @code{datefield}
361 @item @code{tablelist}
363 @item @code{tkpiechart}
365 @item @code{crosshair}
367 @item @code{plotchart}
369 @item @code{autosscroll}
372 (license (package-license tcl))))
374 (define-public tclxml
380 (uri (string-append "mirror://sourceforge/" name "/TclXML/"
381 version "/" name "-" version ".tar.gz"))
384 "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
385 (patches (search-patches "tclxml-3.2-install.patch"))))
386 (build-system gnu-build-system)
390 ("libxslt" ,libxslt)))
392 `(("tcllib" ,tcllib))) ; uri
394 (list (search-path-specification
395 (variable "TCLLIBPATH")
397 (files (list (string-append "lib/Tclxml" version))))))
400 (list (string-append "--exec-prefix=" (assoc-ref %outputs "out"))
401 (string-append "--with-tclconfig="
402 (assoc-ref %build-inputs "tcl") "/lib")
403 (string-append "--with-xml2-config="
404 (assoc-ref %build-inputs "libxml2")
406 (string-append "--with-xslt-config="
407 (assoc-ref %build-inputs "libxslt")
409 #:test-target "test"))
410 (home-page "http://tclxml.sourceforge.net/")
411 (synopsis "Tcl library for XML parsing")
412 (description "TclXML provides event-based parsing of XML documents. The
413 application may register callback scripts for certain document features, and
414 when the parser encounters those features while parsing the document the
415 callback is evaluated.")
416 (license (license:non-copyleft
418 "See LICENCE in the distribution."))))
426 (uri (string-append "mirror://sourceforge/tclx/TclX/"
427 version "/tclx" version ".tar.bz2"))
430 "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59"))))
431 (build-system gnu-build-system)
433 '(#:tests? #f ; a test named profile.test segfaults
434 #:configure-flags (list (string-append "--with-tcl="
435 (assoc-ref %build-inputs "tcl")
437 (string-append "--libdir="
438 (assoc-ref %outputs "out")
443 (home-page "http://tclx.sourceforge.net/")
444 (synopsis "System programming extensions for Tcl")
446 "Extended Tcl is oriented towards system programming tasks and large
447 application development. TclX provides additional interfaces to the operating
448 system, and adds many new programming constructs, text manipulation tools, and
450 (license license:tcl/tk)))
452 (define-public go-github.com-nsf-gothic
453 (let ((commit "97dfcc195b9de36c911a69a6ec2b5b2659c05652")
456 (name "go-github.com-nsf-gothic")
457 (version (git-version "0.0.0" revision commit))
461 (url "https://github.com/nsf/gothic")
465 "1lrhbml6r4sh22rrn3m9bck70pv0g0c1diprg7cil90x0jidxczr"))
466 (file-name (git-file-name name version))))
467 (build-system go-build-system)
469 `(#:import-path "github.com/nsf/gothic"))
473 (home-page "https://github.com/nsf/gothic")
474 (synopsis "Tcl/Tk Go bindings")
475 (description "Gothic contains Go bindings for Tcl/Tk. The package contains
476 only one type and one function that can be used to create a Tk interpreter.")
477 (license license:expat))))