gnu: waybar: Fix build.
[jackhill/guix/guix.git] / gnu / packages / pretty-print.scm
index e971930..12ec1f7 100644 (file)
@@ -1,9 +1,12 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 Meiyo Peng <meiyo@riseup.net>
+;;; Copyright © 2020 Paul Garlick <pgarlick@tourbillion-technology.com>
+;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 (define-module (gnu packages pretty-print)
   #:use-module (guix packages)
   #:use-module (guix licenses)
+  #:use-module (guix git-download)
   #:use-module (guix download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix utils)
   #:use-module (gnu packages)
-  #:use-module (gnu packages ghostscript)
-  #:use-module (gnu packages groff)
-  #:use-module (gnu packages imagemagick)
-  #:use-module (gnu packages gv)
-  #:use-module (gnu packages boost)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages boost)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gperf)
+  #:use-module (gnu packages groff)
+  #:use-module (gnu packages gv)
+  #:use-module (gnu packages imagemagick)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages compression))
+  #:use-module (gnu packages swig))
 
 (define-public a2ps
   (package
               (modules '((guix build utils)))
               (snippet
                ;; Remove timestamp from the installed 'README' file.
-               '(substitute* "etc/README.in"
-                  (("@date@")
-                   "1st of some month, sometime after 1970")))
+               '(begin
+                  (substitute* "etc/README.in"
+                    (("@date@")
+                     "1st of some month, sometime after 1970"))
+                  #t))
               (patches (search-patches
                         "a2ps-CVE-2001-1593.patch"
-                        "a2ps-CVE-2014-0466.patch"))))
+                        "a2ps-CVE-2014-0466.patch"
+                        "a2ps-CVE-2015-8107.patch"))))
     (build-system gnu-build-system)
     (inputs
      `(("psutils" ,psutils)
-       ("groff" ,groff)
        ("gv" ,gv)
        ("imagemagick" ,imagemagick)))
     (native-inputs
      `(("gperf" ,gperf)
+       ("groff" ,groff)
        ("perl" ,perl)))
     (arguments
      '(#:phases
@@ -159,19 +168,20 @@ different programming languages.")
 (define-public fmt
   (package
     (name "fmt")
-    (version "3.0.1")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append
-                    "https://github.com/fmtlib/fmt/releases/download/"
-                    version "/fmt-" version ".zip"))
-              (sha256
-               (base32
-                "0l4514mk83cjimynci3ghrfdchjy8cya1qa45c1fg2lsj7fg16jc"))))
+    (version "7.0.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/fmtlib/fmt/releases/download/"
+                           version "/fmt-" version ".zip"))
+       (sha256
+        (base32 "0kgajl3qsrdyj0csqsz8b8h84kasdy0pnh16byl0y1vlsaddzkyy"))))
     (build-system cmake-build-system)
+    (arguments
+     '(#:configure-flags '("-DBUILD_SHARED_LIBS=ON")))
     (native-inputs
      `(("unzip" ,unzip)))
-    (home-page "http://fmtlib.net/latest/")
+    (home-page "https://fmt.dev")
     (synopsis "Small and fast C++ formatting library")
     (description
      "@code{fmt} (formerly @code{cppformat}) is a formatting library for C++.
@@ -180,10 +190,23 @@ to @code{IOStreams}.")
     ;; The library is bsd-2, but documentation and tests include other licenses.
     (license (list bsd-2 bsd-3 psfl))))
 
+(define-public fmt-6
+  (package
+    (inherit fmt)
+    (name "fmt")
+    (version "6.2.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/fmtlib/fmt/releases/download/"
+                           version "/fmt-" version ".zip"))
+       (sha256
+        (base32 "06l8g59frbsbwj15kg6x2bbn6p8yidh6wzsigdhbdjncvm1agzll"))))))
+
 (define-public source-highlight
   (package
     (name "source-highlight")
-    (version "3.1.8")
+    (version "3.1.9")
     (source
      (origin
       (method url-fetch)
@@ -191,7 +214,7 @@ to @code{IOStreams}.")
                           version ".tar.gz"))
       (sha256
        (base32
-        "18xdalxg7yzrxc1njzgw7aryq2jdm7zq2yqz41sc7k6il5z6lcq1"))))
+        "148w47k3zswbxvhg83z38ifi85f9dqcpg7icvvw1cm6bg21x4zrs"))))
     (build-system gnu-build-system)
     ;; The ctags that comes with emacs does not support the --excmd options,
     ;; so can't be used
@@ -237,18 +260,17 @@ seen in a terminal.")
 (define-public highlight
   (package
     (name "highlight")
-    (version "3.33")
+    (version "3.58")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "http://www.andre-simon.de/zip/highlight-"
                            version ".tar.bz2"))
        (sha256
-        (base32
-         "0g2whi6pxl640795vymikm82a1my841jmh7fiqzbrjpc9wsk1db4"))))
+        (base32 "1y25vc3nysdih4y9z6yqn1k3i6lgkbyqkmdaib2xyfpqw4djb06z"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f ; no tests
+     `(#:tests? #f                      ; no tests
        #:make-flags
        (let ((confdir (string-append %output "/share/highlight/config/")))
          (list (string-append "PREFIX=" %output)
@@ -256,62 +278,40 @@ seen in a terminal.")
                (string-append "conf_dir=" confdir)))
        #:phases
        (modify-phases %standard-phases
-         (delete 'configure)
+         (delete 'configure)            ; no configure script
          (add-after 'unpack 'fix-search-for-lua
            (lambda _
              (substitute* "src/makefile"
-               (("(pkg-config.*)lua" _ prefix)
-                (string-append prefix "lua-5.3")))
-             #t)))))
+               (("(LUA_PKG_NAME=).*" _ assignment)
+                (string-append assignment "lua-" ,(version-major+minor
+                                                   (package-version lua))
+                               "\n")))
+             (substitute* "extras/swig/makefile"
+               (("lua") (string-append "lua-" ,(version-major+minor
+                                                (package-version lua)))))
+             #t))
+         (add-after 'install 'install-perl-bindings
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((perldir (string-append (assoc-ref outputs "out")
+                                            "/lib/perl5/site_perl/"
+                                            ,(package-version perl)))
+                    (autodir (string-append perldir "/auto/highlight")))
+               (with-directory-excursion "extras/swig"
+                 (invoke "make" "perl")
+                 (invoke "perl" "-I" "." "testmod.pl")
+                 (install-file "highlight.pm" perldir)
+                 (install-file "highlight.so" autodir))
+               #t))))))
     (inputs
      `(("lua" ,lua)
-       ("boost" ,boost)))
+       ("boost" ,boost)
+       ("perl" ,perl)))
     (native-inputs
-     `(("pkg-config" ,pkg-config)))
+     `(("pkg-config" ,pkg-config)
+       ("swig" ,swig)))
     (home-page "http://www.andre-simon.de/doku/highlight/en/highlight.php")
     (synopsis "Convert code to documents with syntax highlighting")
     (description "Highlight converts source code to HTML, XHTML, RTF, LaTeX,
 TeX, SVG, BBCode and terminal escape sequences with colored syntax
 highlighting.  Language definitions and color themes are customizable.")
     (license gpl3+)))
-
-(define-public astyle
-  (package
-    (name "astyle")
-    (version "2.05")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append "mirror://sourceforge/astyle/astyle/astyle%20"
-                           version "/astyle_"  version "_linux.tar.gz"))
-       (sha256
-        (base32
-         "0f9sh9kq5ajp1yz133h00fr9235p1m698x7n3h7zbrhjiwgynd6s"))))
-    (build-system gnu-build-system)
-    (arguments
-     `(#:tests? #f                      ;no tests
-       #:make-flags (list (string-append "prefix=" %output)
-                          "INSTALL=install"
-                          "all")
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'configure
-           (lambda _ (chdir "build/gcc") #t))
-         (add-after 'install 'install-libs
-           (lambda* (#:key outputs #:allow-other-keys)
-             ;; Libraries are not installed by default
-             (let* ((output (assoc-ref outputs "out"))
-                    (libdir (string-append output "/lib")))
-               (begin
-                 (mkdir-p libdir)
-                 (for-each (lambda (l)
-                             (copy-file
-                              l (string-append libdir "/" (basename l))))
-                           (find-files "bin" "lib*"))))
-             #t)))))
-    (home-page "http://astyle.sourceforge.net/")
-    (synopsis "Source code indenter, formatter, and beautifier")
-    (description
-     "Artistic Style is a source code indenter, formatter, and beautifier for
-the C, C++, C++/CLI, Objective‑C, C#, and Java programming languages.")
-    (license lgpl3+)))