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>
11 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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:))
49 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
50 version "/tcl" version "-src.tar.gz"))
53 "0kjzj7mkzfnb7ksxanbibibfpciyvsh5ffdlhs0bmfc75kgd435d"))))
54 (build-system gnu-build-system)
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")
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"))
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")
80 ;; XXX: There are a few test failures (related to HTTP, most
81 ;; likely related to name resolution), but that doesn't cause
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)))
97 (uri (string-append "mirror://sourceforge/expect/Expect/"
98 version "/expect" version ".tar.gz"))
101 "0d1cp5hggjl93xwc8h1y6adbnrvpkk0ywkd00inz9ndxn21xm9s9"))))
102 (build-system gnu-build-system)
104 `(;; TODO: Add these optional dependencies.
105 ;; ("libX11" ,libX11)
106 ;; ("xorgproto" ,xorgproto)
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")))
119 (modify-phases %standard-phases
120 (add-before 'configure 'set-path-to-stty
122 (substitute* "configure"
123 (("STTY_BIN=/bin/stty")
124 (string-append "STTY_BIN=" (which "stty"))))
127 #:test-target "test"))
128 (home-page "http://expect.sourceforge.net/")
129 (synopsis "Tool for automating interactive applications")
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
136 (license license:public-domain))) ; as written in `license.terms'
144 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
145 (version-prefix version 3) "/tk"
146 version "-src.tar.gz"))
149 "1d7bfkxpacy33w5nahf73lkwxqpff44w1jplg7i2gmwgiaawvjwg"))
150 (patches (search-patches "tk-find-library.patch"))))
151 (build-system gnu-build-system)
153 `(#:phases (modify-phases %standard-phases
155 'configure 'pre-configure
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")))
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
173 (let ((out (assoc-ref outputs "out"))
174 (fontconfig (assoc-ref inputs "fontconfig")))
175 (substitute* (find-files out
176 "^(tkConfig\\.sh|tk\\.pc)$")
178 (string-append "-L" fontconfig
179 "/lib -lfontconfig")))
182 #:configure-flags (list (string-append "--with-tcl="
183 (assoc-ref %build-inputs "tcl")
186 ;; The tests require a running X server, so we just skip them.
188 (native-inputs `(("pkg-config" ,pkg-config)))
189 (inputs `(("libxft" ,libxft)
190 ("fontconfig" ,fontconfig)
192 ;; tk.h refers to X11 headers, hence the propagation.
193 (propagated-inputs `(("libx11" ,libx11)
194 ("libxext" ,libxext)))
196 (home-page "https://www.tcl.tk/")
197 (synopsis "Graphical user interface toolkit for Tcl")
199 "Tk is a graphical toolkit for building graphical user
200 interfaces (GUIs) in the Tcl language.")
201 (license (package-license tcl))))
203 (define-public perl-tk
210 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
214 "1qiz55dmw7hm1wgpjdzf2jffwcj0hisr3kf80qi8lli3qx2b39py"))))
215 (build-system perl-build-system)
216 (native-inputs `(("pkg-config" ,pkg-config)))
217 (inputs `(("libx11" ,libx11)
219 ("libjpeg" ,libjpeg)))
221 `(#:make-maker-flags `(,(string-append
222 "X11=" (assoc-ref %build-inputs "libx11")))
224 ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
225 #:parallel-build? #f))
226 (synopsis "Graphical user interface toolkit for Perl")
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)))
238 (define-public tcllib
244 (uri (string-append "mirror://sourceforge/tcllib/tcllib/"
245 version "/tcllib-" version ".tar.gz"))
248 "173abxaazdmf210v651708ab6h7xhskvd52krxk6ifam337qgzh1"))))
249 (build-system gnu-build-system)
253 (list (search-path-specification
254 (variable "TCLLIBPATH")
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))))
269 (uri (string-append "https://core.tcl.tk/tklib/tarball/tklib-"
270 version ".tar.gz?uuid=tklib-0-6"))
273 "03y0bzgwbh7nnyqkh8n00bbkq2fyblq39s3bdb6mawna0bbn0wwg"))))
274 (build-system gnu-build-system)
279 ("tk" ,tk))) ; for "wish"
281 (list (search-path-specification
282 (variable "TCLLIBPATH")
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:
290 @item @code{chatwidget}
291 @item @code{datefield}
295 @item @code{tablelist}
297 @item @code{tkpiechart}
299 @item @code{crosshair}
301 @item @code{plotchart}
303 @item @code{autosscroll}
306 (license (package-license tcl))))
308 (define-public tclxml
314 (uri (string-append "mirror://sourceforge/" name "/TclXML/"
315 version "/" name "-" version ".tar.gz"))
318 "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
319 (patches (search-patches "tclxml-3.2-install.patch"))))
320 (build-system gnu-build-system)
324 ("libxslt" ,libxslt)))
326 `(("tcllib" ,tcllib))) ; uri
328 (list (search-path-specification
329 (variable "TCLLIBPATH")
331 (files (list (string-append "lib/Tclxml" version))))))
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")
340 (string-append "--with-xslt-config="
341 (assoc-ref %build-inputs "libxslt")
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
352 "See LICENCE in the distribution."))))
360 (uri (string-append "mirror://sourceforge/tclx/TclX/"
361 version "/tclx" version ".tar.bz2"))
364 "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59"))))
365 (build-system gnu-build-system)
367 '(#:tests? #f ; a test named profile.test segfaults
368 #:configure-flags (list (string-append "--with-tcl="
369 (assoc-ref %build-inputs "tcl")
371 (string-append "--libdir="
372 (assoc-ref %outputs "out")
377 (home-page "http://tclx.sourceforge.net/")
378 (synopsis "System programming extensions for Tcl")
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
384 (license license:tcl/tk)))
386 (define-public go-github.com-nsf-gothic
387 (let ((commit "97dfcc195b9de36c911a69a6ec2b5b2659c05652")
390 (name "go-github.com-nsf-gothic")
391 (version (git-version "0.0.0" revision commit))
395 (url "https://github.com/nsf/gothic")
399 "1lrhbml6r4sh22rrn3m9bck70pv0g0c1diprg7cil90x0jidxczr"))
400 (file-name (git-file-name name version))))
401 (build-system go-build-system)
403 `(#:import-path "github.com/nsf/gothic"))
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))))