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 (uri (string-append "mirror://sourceforge/expect/Expect/"
107 version "/expect" version ".tar.gz"))
110 "0d1cp5hggjl93xwc8h1y6adbnrvpkk0ywkd00inz9ndxn21xm9s9"))))
111 (build-system gnu-build-system)
113 `(;; TODO: Add these optional dependencies.
114 ;; ("libX11" ,libX11)
115 ;; ("xorgproto" ,xorgproto)
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")))
128 (modify-phases %standard-phases
129 (add-before 'configure 'set-path-to-stty
131 (substitute* "configure"
132 (("STTY_BIN=/bin/stty")
133 (string-append "STTY_BIN=" (which "stty"))))
136 #:test-target "test"))
137 (home-page "http://expect.sourceforge.net/")
138 (synopsis "Tool for automating interactive applications")
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
145 (license license:public-domain))) ; as written in `license.terms'
153 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
154 (version-prefix version 3) "/tk"
155 version "-src.tar.gz"))
158 "11p3ycqbr5116vpaxv6fl6md6gcav1ffspgr8wrlc2lxhn543pv3"))
159 (patches (search-patches "tk-find-library.patch"))))
160 (build-system gnu-build-system)
162 `(#:phases (modify-phases %standard-phases
164 'configure 'pre-configure
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")))
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
182 (let ((out (assoc-ref outputs "out"))
183 (fontconfig (assoc-ref inputs "fontconfig")))
184 (substitute* (find-files out
185 "^(tkConfig\\.sh|tk\\.pc)$")
187 (string-append "-L" fontconfig
188 "/lib -lfontconfig")))
192 (list (string-append "--with-tcl="
193 (assoc-ref %build-inputs "tcl")
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")
202 ;; The tests require a running X server, so we just skip them.
204 (native-inputs `(("pkg-config" ,pkg-config)))
205 (inputs `(("libxft" ,libxft)
206 ("fontconfig" ,fontconfig)
208 ;; tk.h refers to X11 headers, hence the propagation.
209 (propagated-inputs `(("libx11" ,libx11)
210 ("libxext" ,libxext)))
212 (home-page "https://www.tcl.tk/")
213 (synopsis "Graphical user interface toolkit for Tcl")
215 "Tk is a graphical toolkit for building graphical user
216 interfaces (GUIs) in the Tcl language.")
217 (license (package-license tcl))))
219 (define-public perl-tk
226 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
230 "1qiz55dmw7hm1wgpjdzf2jffwcj0hisr3kf80qi8lli3qx2b39py"))))
231 (build-system perl-build-system)
232 (native-inputs `(("pkg-config" ,pkg-config)))
233 (inputs `(("libx11" ,libx11)
235 ("libjpeg" ,libjpeg)))
237 `(#:make-maker-flags `(,(string-append
238 "X11=" (assoc-ref %build-inputs "libx11")))
240 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
241 #:parallel-build? #f))
242 (synopsis "Graphical user interface toolkit for Perl")
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)))
254 (define-public tcllib
260 (uri (string-append "mirror://sourceforge/tcllib/tcllib/"
261 version "/tcllib-" version ".tar.gz"))
264 "173abxaazdmf210v651708ab6h7xhskvd52krxk6ifam337qgzh1"))))
265 (build-system gnu-build-system)
269 (list (search-path-specification
270 (variable "TCLLIBPATH")
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))))
285 (uri (string-append "https://core.tcl.tk/tklib/tarball/tklib-"
286 version ".tar.gz?uuid=tklib-0-6"))
289 "03y0bzgwbh7nnyqkh8n00bbkq2fyblq39s3bdb6mawna0bbn0wwg"))))
290 (build-system gnu-build-system)
295 ("tk" ,tk))) ; for "wish"
297 (list (search-path-specification
298 (variable "TCLLIBPATH")
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:
306 @item @code{chatwidget}
307 @item @code{datefield}
311 @item @code{tablelist}
313 @item @code{tkpiechart}
315 @item @code{crosshair}
317 @item @code{plotchart}
319 @item @code{autosscroll}
322 (license (package-license tcl))))
324 (define-public tclxml
330 (uri (string-append "mirror://sourceforge/" name "/TclXML/"
331 version "/" name "-" version ".tar.gz"))
334 "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
335 (patches (search-patches "tclxml-3.2-install.patch"))))
336 (build-system gnu-build-system)
340 ("libxslt" ,libxslt)))
342 `(("tcllib" ,tcllib))) ; uri
344 (list (search-path-specification
345 (variable "TCLLIBPATH")
347 (files (list (string-append "lib/Tclxml" version))))))
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")
356 (string-append "--with-xslt-config="
357 (assoc-ref %build-inputs "libxslt")
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
368 "See LICENCE in the distribution."))))
376 (uri (string-append "mirror://sourceforge/tclx/TclX/"
377 version "/tclx" version ".tar.bz2"))
380 "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59"))))
381 (build-system gnu-build-system)
383 '(#:tests? #f ; a test named profile.test segfaults
384 #:configure-flags (list (string-append "--with-tcl="
385 (assoc-ref %build-inputs "tcl")
387 (string-append "--libdir="
388 (assoc-ref %outputs "out")
393 (home-page "http://tclx.sourceforge.net/")
394 (synopsis "System programming extensions for Tcl")
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
400 (license license:tcl/tk)))
402 (define-public go-github.com-nsf-gothic
403 (let ((commit "97dfcc195b9de36c911a69a6ec2b5b2659c05652")
406 (name "go-github.com-nsf-gothic")
407 (version (git-version "0.0.0" revision commit))
411 (url "https://github.com/nsf/gothic")
415 "1lrhbml6r4sh22rrn3m9bck70pv0g0c1diprg7cil90x0jidxczr"))
416 (file-name (git-file-name name version))))
417 (build-system go-build-system)
419 `(#:import-path "github.com/nsf/gothic"))
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))))