gnu: qemu: Remove dependency on Samba.
[jackhill/guix/guix.git] / gnu / packages / tcl.scm
CommitLineData
4a219a1a
LC
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
15f682f4 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
de0c3141 4;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4a219a1a
LC
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
1ffa7090 21(define-module (gnu packages tcl)
4a219a1a
LC
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
de0c3141 25 #:use-module (guix build-system perl)
f5ea273a 26 #:use-module (gnu packages)
de0c3141
EB
27 #:use-module (gnu packages libpng)
28 #:use-module (gnu packages libjpeg)
29 #:use-module (gnu packages perl)
30 #:use-module (gnu packages pkg-config)
765904ce 31 #:use-module (gnu packages xorg)
4a219a1a
LC
32 #:use-module (guix licenses))
33
34(define-public tcl
35 (package
36 (name "tcl")
37 (version "8.6.0")
38 (source
39 (origin
40 (method url-fetch)
41 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
42 version "/tcl" version "-src.tar.gz"))
43 (sha256
44 (base32
45 "1pnabp3xsja4rc8c01l9q1avb65a3zhdzci3j54qa5krqjwj4i1m"))))
46 (build-system gnu-build-system)
47 (arguments
48 '(#:phases (alist-cons-before
49 'configure 'pre-configure
50 (lambda _
51 (chdir "unix"))
52 (alist-cons-after
53 'install 'install-private-headers
3465eb03 54 (lambda* (#:key outputs #:allow-other-keys)
4a219a1a 55 ;; Private headers are needed by Expect.
3465eb03
LC
56 (and (zero? (system* "make"
57 "install-private-headers"))
58 (let ((bin (string-append (assoc-ref outputs "out")
59 "/bin")))
60 ;; Create a tclsh -> tclsh8.6 symlink.
61 ;; Programs such as Ghostscript rely on it.
62 (with-directory-excursion bin
63 (symlink (car (find-files "." "tclsh"))
64 "tclsh")))))
4a219a1a 65 %standard-phases))
eb6d676e 66
15f682f4
MW
67 ;; By default, man pages are put in PREFIX/man,
68 ;; but we want them in PREFIX/share/man.
69 #:configure-flags (list (string-append "--mandir="
70 (assoc-ref %outputs "out")
71 "/share/man"))
72
eb6d676e
LC
73 ;; XXX: There are a few test failures (related to HTTP, most
74 ;; likely related to name resolution), but that doesn't cause
75 ;; `make' to fail.
76 #:test-target "test"))
4a219a1a
LC
77 (home-page "http://www.tcl.tk/")
78 (synopsis "The Tcl scripting language")
79 (description "The Tcl (Tool Command Language) scripting language.")
80 (license (bsd-style "http://www.tcl.tk/software/tcltk/license.html"
81 "Tcl/Tk license"))))
82
83
84(define-public expect
85 (package
86 (name "expect")
87 (version "5.45")
88 (source
89 (origin
90 (method url-fetch)
91 (uri (string-append "mirror://sourceforge/expect/Expect/"
92 version "/expect" version ".tar.gz"))
93 (sha256
94 (base32
95 "0h60bifxj876afz4im35rmnbnxjx4lbdqp2ja3k30fwa8a8cm3dj"))))
96 (build-system gnu-build-system)
97 (inputs
98 `(;; TODO: Add these optional dependencies.
99 ;; ("libX11" ,libX11)
100 ;; ("xproto" ,xproto)
101 ;; ("tk" ,tk)
102 ("tcl" ,tcl)))
103 (arguments
104 '(#:configure-flags
988cecfd
MW
105 (let ((out (assoc-ref %outputs "out"))
106 (tcl (assoc-ref %build-inputs "tcl")))
107 (list (string-append "--with-tcl=" tcl "/lib")
108 (string-append "--with-tclinclude=" tcl "/include")
109 (string-append "--exec-prefix=" out)
110 (string-append "--mandir=" out "/share/man")))
eb6d676e 111
d5529a91
LC
112 #:phases (alist-cons-before
113 'configure 'set-path-to-stty
114 (lambda _
115 (substitute* "configure"
116 (("STTY_BIN=/bin/stty")
117 (string-append "STTY_BIN=" (which "stty")))))
118 %standard-phases)
119
eb6d676e 120 #:test-target "test"))
4a219a1a
LC
121 (home-page "http://expect.nist.gov/")
122 (synopsis
123 "A tool for automating interactive applications")
124 (description
125 "Expect is a tool for automating interactive applications such as
126telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this
127stuff trivial. Expect is also useful for testing these same
128applications. And by adding Tk, you can wrap interactive applications in
129X11 GUIs.")
130 (license public-domain))) ; as written in `license.terms'
765904ce
LC
131
132(define-public tk
133 (package
134 (name "tk")
135 (version "8.6.0")
136 (source (origin
137 (method url-fetch)
138 (uri (string-append "mirror://sourceforge/tcl/Tcl/"
139 version "/tk" version "-src.tar.gz"))
140 (sha256
141 (base32
142 "1rld0l7p1h31z488w44j170jpsm11xsjf2qrb7gid2b5dwmqnw2w"))))
143 (build-system gnu-build-system)
144 (arguments
145 '(#:phases (alist-cons-before
146 'configure 'pre-configure
147 (lambda _
148 (chdir "unix"))
149 %standard-phases)
150
151 #:configure-flags (list (string-append "--with-tcl="
152 (assoc-ref %build-inputs "tcl")
153 "/lib"))
154
155 ;; The tests require a running X server, so we just skip them.
156 #:tests? #f))
157 (inputs `(("tcl" ,tcl)))
158
159 ;; tk.h refers to X11 headers, hence the propagation.
160 (propagated-inputs `(("libx11" ,libx11)
161 ("libxext" ,libxext)))
162
163 (home-page "http://www.tcl.tk/")
164 (synopsis "Graphical user interface toolkit for Tcl")
165 (description
166 "Tk is a graphical toolkit for building graphical user interfaces
167(GUIs) in the Tcl language.")
168 (license (package-license tcl))))
de0c3141
EB
169
170(define-public perl-tk
171 (package
172 (name "perl-tk")
173 (version "804.032")
174 (source (origin
175 (method url-fetch)
176 (uri (string-append
177 "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
178 version ".tar.gz"))
179 (sha256
180 (base32
f5ea273a
EB
181 "0jarvplhfvnm0shhdm2a5zczlnk9mkf8jvfjiwyhjrr3cy1gl0w0"))
182 (patches (list (search-patch "perl-tk-x11-discover.patch")))))
de0c3141
EB
183 (build-system perl-build-system)
184 (native-inputs `(("pkg-config" ,pkg-config)))
185 (inputs `(("libx11" ,libx11)
186 ("libpng" ,libpng)
187 ("libjpeg" ,libjpeg)))
188 (arguments
189 `(#:make-maker-flags `(,(string-append
190 "X11=" (assoc-ref %build-inputs "libx11")))))
191 (synopsis "Graphical user interface toolkit for Perl")
192 (description
193 "Tk is a Graphical User Interface ToolKit.")
194 (home-page (string-append "http://search.cpan.org/~srezic/Tk-" version))
195 ;; From the package README: "... you can redistribute it and/or modify it
196 ;; under the same terms as Perl itself, with the exception of all the
197 ;; files in the pTk sub-directory which have separate terms derived from
198 ;; those of the orignal Tix4.1.3 or Tk8.4.* sources. See the files
199 ;; pTk/license.terms, pTk/license.html_lib, and pTk/Tix.license for
200 ;; details of this license."
201 (license (package-license perl))))