gnu: Add pdfposter.
[jackhill/guix/guix.git] / gnu / packages / tcl.scm
index 4859c2b..4cd9429 100644 (file)
@@ -1,7 +1,9 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
-;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
   #:use-module (gnu packages)
-  #:use-module (gnu packages libpng)
-  #:use-module (gnu packages libjpeg)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages fontutils)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix licenses))
 
 (define-public tcl
   (package
     (name "tcl")
-    (version "8.6.0")
-    (source
-     (origin
-      (method url-fetch)
-      (uri (string-append "mirror://sourceforge/tcl/Tcl/"
-                          version "/tcl" version "-src.tar.gz"))
-      (sha256
-       (base32
-        "1pnabp3xsja4rc8c01l9q1avb65a3zhdzci3j54qa5krqjwj4i1m"))))
+    (version "8.6.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/tcl/Tcl/"
+                                  version "/tcl" version "-src.tar.gz"))
+              (sha256
+               (base32
+                "13cwa4bc85ylf5gfj9vk182lvgy60qni3f7gbxghq78wk16djvly"))
+              (patches (search-patches "tcl-mkindex-deterministic.patch"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases (alist-cons-before
                                       "tclsh")))))
                   %standard-phases))
 
-       ;; By default, man pages are put in PREFIX/man,
-       ;; but we want them in PREFIX/share/man.
+       ;; By default, man pages are put in PREFIX/man, but we want them in
+       ;; PREFIX/share/man.  The 'validate-documentation-location' phase is
+       ;; not able to fix this up because the default install populates both
+       ;; PREFIX/man and PREFIX/share/man.
        #:configure-flags (list (string-append "--mandir="
                                               (assoc-ref %outputs "out")
                                               "/share/man"))
@@ -77,8 +82,7 @@
     (home-page "http://www.tcl.tk/")
     (synopsis "The Tcl scripting language")
     (description "The Tcl (Tool Command Language) scripting language.")
-    (license (bsd-style "http://www.tcl.tk/software/tcltk/license.html"
-                        "Tcl/Tk license"))))
+    (license tcl/tk)))
 
 
 (define-public expect
 
        #:test-target "test"))
     (home-page "http://expect.nist.gov/")
-    (synopsis
-     "A tool for automating interactive applications")
+    (synopsis "Tool for automating interactive applications")
     (description
      "Expect is a tool for automating interactive applications such as
 telnet, ftp, passwd, fsck, rlogin, tip, etc.  Expect really makes this
-stuff trivial. Expect is also useful for testing these same
-applications. And by adding Tk, you can wrap interactive applications in
+stuff trivial.  Expect is also useful for testing these same
+applications.  And by adding Tk, you can wrap interactive applications in
 X11 GUIs.")
     (license public-domain)))            ; as written in `license.terms'
 
 (define-public tk
   (package
     (name "tk")
-    (version "8.6.0")
+    (version "8.6.4")
     (source (origin
              (method url-fetch)
              (uri (string-append "mirror://sourceforge/tcl/Tcl/"
                                  version "/tk" version "-src.tar.gz"))
              (sha256
               (base32
-               "1rld0l7p1h31z488w44j170jpsm11xsjf2qrb7gid2b5dwmqnw2w"))))
+               "1h96vp15zl5xz0d4qp6wjyrchqmrmdm3q5k22wkw9jaxbvw9vy88"))
+             (patches (search-patches "tk-find-library.patch"))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases (alist-cons-before
-                 'configure 'pre-configure
-                 (lambda _
-                   (chdir "unix"))
-                 %standard-phases)
+     '(#:phases (modify-phases %standard-phases
+                  (add-before
+                   'configure 'pre-configure
+                   (lambda _
+                     (chdir "unix")))
+                  (add-after
+                   'install 'add-fontconfig-flag
+                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                     ;; Add the missing -L flag for Fontconfig in 'tk.pc' and
+                     ;; 'tkConfig.sh'.
+                     (let ((out        (assoc-ref outputs "out"))
+                           (fontconfig (assoc-ref inputs "fontconfig")))
+                       (substitute* (find-files out
+                                                "^(tkConfig\\.sh|tk\\.pc)$")
+                         (("-lfontconfig")
+                          (string-append "-L" fontconfig
+                                         "/lib -lfontconfig")))
+                       #t))))
 
        #:configure-flags (list (string-append "--with-tcl="
                                               (assoc-ref %build-inputs "tcl")
@@ -154,8 +171,10 @@ X11 GUIs.")
 
        ;; The tests require a running X server, so we just skip them.
        #:tests? #f))
-    (inputs `(("tcl" ,tcl)))
-
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (inputs `(("libxft" ,libxft)
+              ("fontconfig" ,fontconfig)
+              ("tcl" ,tcl)))
     ;; tk.h refers to X11 headers, hence the propagation.
     (propagated-inputs `(("libx11" ,libx11)
                          ("libxext" ,libxext)))
@@ -163,14 +182,14 @@ X11 GUIs.")
     (home-page "http://www.tcl.tk/")
     (synopsis "Graphical user interface toolkit for Tcl")
     (description
-     "Tk is a graphical toolkit for building graphical user interfaces
-(GUIs) in the Tcl language.")
+     "Tk is a graphical toolkit for building graphical user
+interfaces (GUIs) in the Tcl language.")
     (license (package-license tcl))))
 
 (define-public perl-tk
   (package
     (name "perl-tk")
-    (version "804.032")
+    (version "804.033")
     (source (origin
              (method url-fetch)
              (uri (string-append
@@ -178,8 +197,7 @@ X11 GUIs.")
                    version ".tar.gz"))
              (sha256
               (base32
-               "0jarvplhfvnm0shhdm2a5zczlnk9mkf8jvfjiwyhjrr3cy1gl0w0"))
-             (patches (list (search-patch "perl-tk-x11-discover.patch")))))
+               "1bc8bacsf95598yimrxijymb3advrgan73pqxj75qmd20ydnwxc4"))))
     (build-system perl-build-system)
     (native-inputs `(("pkg-config" ,pkg-config)))
     (inputs `(("libx11" ,libx11)
@@ -187,7 +205,10 @@ X11 GUIs.")
               ("libjpeg" ,libjpeg)))
     (arguments
      `(#:make-maker-flags `(,(string-append
-                              "X11=" (assoc-ref %build-inputs "libx11")))))
+                              "X11=" (assoc-ref %build-inputs "libx11")))
+
+       ;; Fails to build in parallel: <http://bugs.gnu.org/18262>.
+       #:parallel-build? #f))
     (synopsis "Graphical user interface toolkit for Perl")
     (description
      "Tk is a Graphical User Interface ToolKit.")
@@ -199,3 +220,73 @@ X11 GUIs.")
     ;; pTk/license.terms, pTk/license.html_lib, and pTk/Tix.license for
     ;; details of this license."
     (license (package-license perl))))
+
+(define-public tcllib
+  (package
+    (name "tcllib")
+    (version "1.18")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/" name "/" name "/"
+                                  version "/" name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "05dmrk9qsryah2n17z6z85dj9l9lfyvnsd7faw0p9bs1pp5pwrkj"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("tcl" ,tcl)))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "TCLLIBPATH")
+            (separator " ")
+            (files (list (string-append "lib/tcllib" version))))))
+    (home-page "https://core.tcl.tk/tcllib/home")
+    (synopsis "Standard Tcl Library")
+    (description "Tcllib, the standard Tcl library, is a collection of common
+utility functions and modules all written in high-level Tcl.")
+    (license (package-license tcl))))
+
+(define-public tclxml
+  (package
+    (name "tclxml")
+    (version "3.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/" name "/TclXML/"
+                                  version "/" name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0ffb4aw63inig3aql33g4pk0kjk14dv238anp1scwjdjh1k6n4gl"))
+              (patches (search-patches "tclxml-3.2-install.patch"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("tcl" ,tcl)
+       ("tcllib" ,tcllib)
+       ("libxml2" ,libxml2)
+       ("libxslt" ,libxslt)))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "TCLLIBPATH")
+            (separator " ")
+            (files (list (string-append "lib/Tclxml" version))))))
+    (arguments
+     `(#:configure-flags
+       (list (string-append "--exec-prefix=" (assoc-ref %outputs "out"))
+             (string-append "--with-tclconfig="
+                            (assoc-ref %build-inputs "tcl") "/lib")
+             (string-append "--with-xml2-config="
+                            (assoc-ref %build-inputs "libxml2")
+                            "/bin/xml2-config")
+             (string-append "--with-xslt-config="
+                            (assoc-ref %build-inputs "libxslt")
+                            "/bin/xslt-config"))
+       #:test-target "test"))
+    (home-page "http://tclxml.sourceforge.net/")
+    (synopsis "Tcl library for XML parsing")
+    (description "TclXML provides event-based parsing of XML documents.  The
+application may register callback scripts for certain document features, and
+when the parser encounters those features while parsing the document the
+callback is evaluated.")
+    (license (non-copyleft
+              "file://LICENCE"
+              "See LICENCE in the distribution."))))