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