tcl.scm 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469
  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>
  11. ;;;
  12. ;;; This file is part of GNU Guix.
  13. ;;;
  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.
  18. ;;;
  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.
  23. ;;;
  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/>.
  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:))
  42. (define-public tcl
  43. (package
  44. (name "tcl")
  45. (version "8.6.11")
  46. (source (origin
  47. (method url-fetch)
  48. (uri (string-append "mirror://sourceforge/tcl/Tcl/"
  49. version "/tcl" version "-src.tar.gz"))
  50. (sha256
  51. (base32
  52. "0n4211j80mxr6ql0xx52rig8r885rcbminfpjdb2qrw6hmk8c14c"))))
  53. (build-system gnu-build-system)
  54. (arguments
  55. `(#:phases (modify-phases %standard-phases
  56. (add-before 'configure 'pre-configure
  57. (lambda _ (chdir "unix")))
  58. (add-after 'install 'install-private-headers
  59. (lambda* (#:key outputs #:allow-other-keys)
  60. ;; Private headers are needed by Expect.
  61. (invoke "make" "install-private-headers")
  62. (let ((bin (string-append (assoc-ref outputs "out")
  63. "/bin")))
  64. ;; Create a tclsh -> tclsh8.6 symlink.
  65. ;; Programs such as Ghostscript rely on it.
  66. (with-directory-excursion bin
  67. (symlink (car (find-files "." "tclsh"))
  68. "tclsh"))))))
  69. ;; By default, man pages are put in PREFIX/man, but we want them in
  70. ;; PREFIX/share/man. The 'validate-documentation-location' phase is
  71. ;; not able to fix this up because the default install populates both
  72. ;; PREFIX/man and PREFIX/share/man.
  73. #:configure-flags
  74. (list (string-append "--mandir="
  75. (assoc-ref %outputs "out")
  76. "/share/man")
  77. ;; This is needed when cross-compiling, see:
  78. ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
  79. ,@(if (%current-target-system)
  80. '("tcl_cv_strtod_buggy=1"
  81. "ac_cv_func_strtod=yes")
  82. '()))
  83. ;; XXX: There are a few test failures (related to HTTP, most
  84. ;; likely related to name resolution), but that doesn't cause
  85. ;; `make' to fail.
  86. #:test-target "test"))
  87. (home-page "https://www.tcl.tk/")
  88. (synopsis "The Tcl scripting language")
  89. (description "The Tcl (Tool Command Language) scripting language.")
  90. (license license:tcl/tk)))
  91. (define-public itcl
  92. (package
  93. (name "itcl")
  94. (version "4.2.0")
  95. (source
  96. (origin
  97. (method url-fetch)
  98. (uri (string-append
  99. "mirror://sourceforge/incrtcl/%5Bincr%20Tcl_Tk%5D-4-source/itcl%20"
  100. version "/itcl" version ".tar.gz"))
  101. (file-name (string-append "incrtcl-" version ".tar.gz"))
  102. (sha256
  103. (base32 "0w28v0zaraxcq1s9pa6cihqqwqvvwfgz275lks7w4gl7hxjxmasw"))))
  104. (build-system gnu-build-system)
  105. (arguments
  106. `(#:configure-flags
  107. (list
  108. (string-append
  109. "--exec-prefix=" (assoc-ref %outputs "out"))
  110. (string-append
  111. "--with-tclinclude=" (assoc-ref %build-inputs "tcl") "/include")
  112. (string-append
  113. "--with-tcl=" (assoc-ref %build-inputs "tcl") "/lib"))
  114. #:test-target "test"
  115. #:phases
  116. (modify-phases %standard-phases
  117. (add-after 'install 'cleanup-bin-and-lib
  118. (lambda* (#:key outputs #:allow-other-keys)
  119. ;; NOTE: (Sharlatan-20210213T204336+0000): libraries appearer in
  120. ;; "out/lib/itcl{{version}}" and there are no binaries, some extra
  121. ;; rename and remove spells are to be applied.
  122. (let ((out (assoc-ref outputs "out")))
  123. (rmdir
  124. (string-append out "/bin"))
  125. (rename-file
  126. (string-append out "/lib/itcl" ,version) (string-append out "/libtmp"))
  127. (rename-file
  128. (string-append out "/libtmp") (string-append out "/lib")))
  129. #t)))))
  130. (native-inputs
  131. `(("tcl" ,tcl)))
  132. (inputs
  133. `(("tcllib" ,tcllib)))
  134. (home-page "http://incrtcl.sourceforge.net/")
  135. (synopsis "Object Oriented programming (OOP) extension for Tcl")
  136. (description
  137. "[incr Tcl] is a widely used object-oriented system for Tcl. The name is
  138. a play on C++, and [incr Tcl] provides a similar object model, including
  139. multiple inheritance and public and private classes and variables.")
  140. (license license:public-domain)))
  141. (define-public expect
  142. (package
  143. (name "expect")
  144. (version "5.45.4")
  145. (source
  146. (origin
  147. (method url-fetch)
  148. (uri (string-append "mirror://sourceforge/expect/Expect/"
  149. version "/expect" version ".tar.gz"))
  150. (sha256
  151. (base32
  152. "0d1cp5hggjl93xwc8h1y6adbnrvpkk0ywkd00inz9ndxn21xm9s9"))))
  153. (build-system gnu-build-system)
  154. (inputs
  155. `(;; TODO: Add these optional dependencies.
  156. ;; ("libX11" ,libX11)
  157. ;; ("xorgproto" ,xorgproto)
  158. ;; ("tk" ,tk)
  159. ("tcl" ,tcl)))
  160. (arguments
  161. '(#:configure-flags
  162. (let ((out (assoc-ref %outputs "out"))
  163. (tcl (assoc-ref %build-inputs "tcl")))
  164. (list (string-append "--with-tcl=" tcl "/lib")
  165. (string-append "--with-tclinclude=" tcl "/include")
  166. (string-append "--exec-prefix=" out)
  167. (string-append "--mandir=" out "/share/man")))
  168. #:phases
  169. (modify-phases %standard-phases
  170. (add-before 'configure 'set-path-to-stty
  171. (lambda _
  172. (substitute* "configure"
  173. (("STTY_BIN=/bin/stty")
  174. (string-append "STTY_BIN=" (which "stty"))))
  175. #t)))
  176. #:test-target "test"))
  177. (home-page "http://expect.sourceforge.net/")
  178. (synopsis "Tool for automating interactive applications")
  179. (description
  180. "Expect is a tool for automating interactive applications such as
  181. telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this
  182. stuff trivial. Expect is also useful for testing these same
  183. applications. And by adding Tk, you can wrap interactive applications in
  184. X11 GUIs.")
  185. (license license:public-domain))) ; as written in `license.terms'
  186. (define-public tk
  187. (package
  188. (name "tk")
  189. (version "8.6.11.1")
  190. (source (origin
  191. (method url-fetch)
  192. (uri (string-append "mirror://sourceforge/tcl/Tcl/"
  193. (version-prefix version 3) "/tk"
  194. version "-src.tar.gz"))
  195. (sha256
  196. (base32
  197. "1gh9k7l76qg9l0sb78ijw9xz4xl1af47aqbdifb6mjpf3cbsnv00"))
  198. (patches (search-patches "tk-find-library.patch"))))
  199. (build-system gnu-build-system)
  200. (arguments
  201. `(#:phases (modify-phases %standard-phases
  202. (add-before 'configure 'pre-configure
  203. (lambda _ (chdir "unix")))
  204. (add-after 'install 'create-wish-symlink
  205. (lambda* (#:key outputs #:allow-other-keys)
  206. (let ((out (assoc-ref outputs "out")))
  207. (symlink (string-append out "/bin/wish"
  208. ,(version-major+minor
  209. (package-version tk)))
  210. (string-append out "/bin/wish")))))
  211. (add-after 'install 'add-fontconfig-flag
  212. (lambda* (#:key inputs outputs #:allow-other-keys)
  213. ;; Add the missing -L flag for Fontconfig in 'tk.pc' and
  214. ;; 'tkConfig.sh'.
  215. (let ((out (assoc-ref outputs "out"))
  216. (fontconfig (assoc-ref inputs "fontconfig")))
  217. (substitute* (find-files out
  218. "^(tkConfig\\.sh|tk\\.pc)$")
  219. (("-lfontconfig")
  220. (string-append "-L" fontconfig
  221. "/lib -lfontconfig")))))))
  222. #:configure-flags
  223. (list (string-append "--with-tcl="
  224. (assoc-ref %build-inputs "tcl")
  225. "/lib")
  226. ;; This is needed when cross-compiling, see:
  227. ;; https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719247
  228. ,@(if (%current-target-system)
  229. '("tcl_cv_strtod_buggy=1"
  230. "ac_cv_func_strtod=yes")
  231. '()))
  232. ;; The tests require a running X server, so we just skip them.
  233. #:tests? #f))
  234. (native-inputs `(("pkg-config" ,pkg-config)))
  235. (inputs `(("libxft" ,libxft)
  236. ("fontconfig" ,fontconfig)
  237. ("tcl" ,tcl)))
  238. ;; tk.h refers to X11 headers, hence the propagation.
  239. (propagated-inputs `(("libx11" ,libx11)
  240. ("libxext" ,libxext)))
  241. (home-page "https://www.tcl.tk/")
  242. (synopsis "Graphical user interface toolkit for Tcl")
  243. (description
  244. "Tk is a graphical toolkit for building graphical user
  245. interfaces (GUIs) in the Tcl language.")
  246. (license (package-license tcl))))
  247. (define-public perl-tk
  248. (package
  249. (name "perl-tk")
  250. (version "804.034")
  251. (source (origin
  252. (method url-fetch)
  253. (uri (string-append
  254. "mirror://cpan/authors/id/S/SR/SREZIC/Tk-"
  255. version ".tar.gz"))
  256. (sha256
  257. (base32
  258. "1qiz55dmw7hm1wgpjdzf2jffwcj0hisr3kf80qi8lli3qx2b39py"))))
  259. (build-system perl-build-system)
  260. (native-inputs `(("pkg-config" ,pkg-config)))
  261. (inputs `(("libx11" ,libx11)
  262. ("libpng" ,libpng)
  263. ("libjpeg" ,libjpeg-turbo)))
  264. (arguments
  265. `(#:make-maker-flags `(,(string-append
  266. "X11=" (assoc-ref %build-inputs "libx11")))
  267. ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
  268. #:parallel-build? #f))
  269. (synopsis "Graphical user interface toolkit for Perl")
  270. (description
  271. "Tk is a Graphical User Interface ToolKit.")
  272. (home-page "https://metacpan.org/release/Tk")
  273. ;; From the package README: "... you can redistribute it and/or modify it
  274. ;; under the same terms as Perl itself, with the exception of all the
  275. ;; files in the pTk sub-directory which have separate terms derived from
  276. ;; those of the orignal Tix4.1.3 or Tk8.4.* sources. See the files
  277. ;; pTk/license.terms, pTk/license.html_lib, and pTk/Tix.license for
  278. ;; details of this license."
  279. (license license:perl-license)))
  280. (define-public tcllib
  281. (package
  282. (name "tcllib")
  283. (version "1.19")
  284. (source (origin
  285. (method url-fetch)
  286. (uri (string-append "mirror://sourceforge/tcllib/tcllib/"
  287. version "/tcllib-" version ".tar.gz"))
  288. (sha256
  289. (base32
  290. "173abxaazdmf210v651708ab6h7xhskvd52krxk6ifam337qgzh1"))))
  291. (build-system gnu-build-system)
  292. (native-inputs
  293. `(("tcl" ,tcl)))
  294. (native-search-paths
  295. (list (search-path-specification
  296. (variable "TCLLIBPATH")
  297. (separator " ")
  298. (files (list (string-append "lib/tcllib" version))))))
  299. (home-page "https://core.tcl.tk/tcllib/home")
  300. (synopsis "Standard Tcl Library")
  301. (description "Tcllib, the standard Tcl library, is a collection of common
  302. utility functions and modules all written in high-level Tcl.")
  303. (license (package-license tcl))))
  304. (define-public tklib
  305. (package
  306. (name "tklib")
  307. (version "0.6")
  308. (source (origin
  309. (method url-fetch)
  310. (uri (string-append "https://core.tcl.tk/tklib/tarball/tklib-"
  311. version ".tar.gz?uuid=tklib-0-6"))
  312. (sha256
  313. (base32
  314. "03y0bzgwbh7nnyqkh8n00bbkq2fyblq39s3bdb6mawna0bbn0wwg"))))
  315. (build-system gnu-build-system)
  316. (native-inputs
  317. `(("tcl" ,tcl)))
  318. (propagated-inputs
  319. `(("tcllib" ,tcllib)
  320. ("tk" ,tk))) ; for "wish"
  321. (native-search-paths
  322. (list (search-path-specification
  323. (variable "TCLLIBPATH")
  324. (separator " ")
  325. (files (list (string-append "lib/tklib" version))))))
  326. (home-page "https://www.tcl.tk/software/tklib/")
  327. (synopsis "Tk utility modules for Tcl")
  328. (description "Tklib is a collection of common utility functions and
  329. modules for Tk, all written in high-level Tcl. Examples of provided widgets:
  330. @enumerate
  331. @item @code{chatwidget}
  332. @item @code{datefield}
  333. @item @code{tooltip}
  334. @item @code{cursor}
  335. @item @code{ipentry}
  336. @item @code{tablelist}
  337. @item @code{history}
  338. @item @code{tkpiechart}
  339. @item @code{ico}
  340. @item @code{crosshair}
  341. @item @code{ntext}
  342. @item @code{plotchart}
  343. @item @code{ctext}
  344. @item @code{autosscroll}
  345. @item @code{canvas}
  346. @end enumerate")
  347. (license (package-license tcl))))
  348. (define-public tclxml
  349. (package
  350. (name "tclxml")
  351. (version "3.2")
  352. (source (origin
  353. (method url-fetch)
  354. (uri (string-append "mirror://sourceforge/" name "/TclXML/"
  355. version "/" name "-" version ".tar.gz"))
  356. (sha256
  357. (base32
  358. "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
  359. (patches (search-patches "tclxml-3.2-install.patch"))))
  360. (build-system gnu-build-system)
  361. (native-inputs
  362. `(("tcl" ,tcl)
  363. ("libxml2" ,libxml2)
  364. ("libxslt" ,libxslt)))
  365. (propagated-inputs
  366. `(("tcllib" ,tcllib))) ; uri
  367. (native-search-paths
  368. (list (search-path-specification
  369. (variable "TCLLIBPATH")
  370. (separator " ")
  371. (files (list (string-append "lib/Tclxml" version))))))
  372. (arguments
  373. `(#:configure-flags
  374. (list (string-append "--exec-prefix=" (assoc-ref %outputs "out"))
  375. (string-append "--with-tclconfig="
  376. (assoc-ref %build-inputs "tcl") "/lib")
  377. (string-append "--with-xml2-config="
  378. (assoc-ref %build-inputs "libxml2")
  379. "/bin/xml2-config")
  380. (string-append "--with-xslt-config="
  381. (assoc-ref %build-inputs "libxslt")
  382. "/bin/xslt-config"))
  383. #:test-target "test"))
  384. (home-page "http://tclxml.sourceforge.net/")
  385. (synopsis "Tcl library for XML parsing")
  386. (description "TclXML provides event-based parsing of XML documents. The
  387. application may register callback scripts for certain document features, and
  388. when the parser encounters those features while parsing the document the
  389. callback is evaluated.")
  390. (license (license:non-copyleft
  391. "file://LICENCE"
  392. "See LICENCE in the distribution."))))
  393. (define-public tclx
  394. (package
  395. (name "tclx")
  396. (version "8.4.1")
  397. (source (origin
  398. (method url-fetch)
  399. (uri (string-append "mirror://sourceforge/tclx/TclX/"
  400. version "/tclx" version ".tar.bz2"))
  401. (sha256
  402. (base32
  403. "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59"))))
  404. (build-system gnu-build-system)
  405. (arguments
  406. '(#:tests? #f ; a test named profile.test segfaults
  407. #:configure-flags (list (string-append "--with-tcl="
  408. (assoc-ref %build-inputs "tcl")
  409. "/lib")
  410. (string-append "--libdir="
  411. (assoc-ref %outputs "out")
  412. "/lib"))))
  413. (inputs
  414. `(("tcl" ,tcl)
  415. ("tk" ,tk)))
  416. (home-page "http://tclx.sourceforge.net/")
  417. (synopsis "System programming extensions for Tcl")
  418. (description
  419. "Extended Tcl is oriented towards system programming tasks and large
  420. application development. TclX provides additional interfaces to the operating
  421. system, and adds many new programming constructs, text manipulation tools, and
  422. debugging tools.")
  423. (license license:tcl/tk)))
  424. (define-public go-github.com-nsf-gothic
  425. (let ((commit "97dfcc195b9de36c911a69a6ec2b5b2659c05652")
  426. (revision "0"))
  427. (package
  428. (name "go-github.com-nsf-gothic")
  429. (version (git-version "0.0.0" revision commit))
  430. (source (origin
  431. (method git-fetch)
  432. (uri (git-reference
  433. (url "https://github.com/nsf/gothic")
  434. (commit commit)))
  435. (sha256
  436. (base32
  437. "1lrhbml6r4sh22rrn3m9bck70pv0g0c1diprg7cil90x0jidxczr"))
  438. (file-name (git-file-name name version))))
  439. (build-system go-build-system)
  440. (arguments
  441. `(#:import-path "github.com/nsf/gothic"))
  442. (propagated-inputs
  443. `(("tk" ,tk)
  444. ("tcl" ,tcl)))
  445. (home-page "https://github.com/nsf/gothic")
  446. (synopsis "Tcl/Tk Go bindings")
  447. (description "Gothic contains Go bindings for Tcl/Tk. The package contains
  448. only one type and one function that can be used to create a Tk interpreter.")
  449. (license license:expat))))