gnu: facter: Update to 4.0.33.
[jackhill/guix/guix.git] / gnu / packages / groff.scm
index 98f1791..222b4cb 100644 (file)
@@ -5,6 +5,8 @@
 ;;; Copyright © 2017 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2019 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,7 +35,8 @@
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages netpbm)
   #:use-module (gnu packages perl)
-  #:use-module (gnu packages texinfo))
+  #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages web))
 
 (define-public groff
   (package
    ;; from 'inputs'.
 
    (inputs `(("ghostscript" ,ghostscript)))
-   (native-inputs `(("bison" ,bison)
+
+   ;; When cross-compiling, this package depends upon a native install of
+   ;; itself.
+   (native-inputs `(,@(if (%current-target-system)
+                          `(("self" ,this-package))
+                          '())
+                    ("bison" ,bison)
                     ("perl" ,perl)
                     ("psutils" ,psutils)
                     ("texinfo" ,texinfo)))
    (arguments
     `(#:parallel-build? #f   ; parallel build fails
+      ,@(if (%current-target-system)
+            `(#:make-flags
+              ;; In groff-minimal package, that inherits from this package,
+              ;; we'll need to locate "groff" instead of "self".
+              (let ((groff (or (assoc-ref %build-host-inputs "groff")
+                               (assoc-ref %build-host-inputs "self"))))
+                (list
+                 (string-append "GROFF_BIN_PATH=" groff)
+                 (string-append "GROFFBIN=" groff "/bin/groff"))))
+            '())
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'disable-relocatability
@@ -115,7 +134,8 @@ is usually the formatter of \"man\" documentation pages.")
     ;; Omit the DVI, PS, PDF, and HTML backends.
     (inputs '())
     (native-inputs `(("bison" ,bison)
-                     ("perl" ,perl)))
+                     ("perl" ,perl)
+                     ("groff" ,groff)))
 
     (arguments
      `(#:disallowed-references (,perl)
@@ -151,20 +171,20 @@ is usually the formatter of \"man\" documentation pages.")
 
 ;; There are no releases, so we take the latest commit.
 (define-public roffit
-  (let ((commit "e5228388e3faf2b7f1ae5bd048ad46ed565304c6")
+  (let ((commit "b59e6c855ebea03daf76e996b5c0f8343f11be3d")
         (revision "1"))
     (package
       (name "roffit")
-      (version (string-append "0.11-" revision "." (string-take commit 9)))
+      (version (string-append "0.12-" revision "." (string-take commit 9)))
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
-                      (url "https://github.com/bagder/roffit.git")
+                      (url "https://github.com/bagder/roffit")
                       (commit commit)))
                 (file-name (string-append "roffit-" commit "-checkout"))
                 (sha256
                  (base32
-                  "1y7ndbqciy7h0khlpi1bv4v1614vhybnmm4jysj6fwxkw9cwv1nc"))))
+                  "0z4cs92yqh22sykfgbjlyxfaifdvsd47cf1yhr0f2rgcc6l0fj1r"))))
       (build-system gnu-build-system)
       (arguments
        `(#:test-target "test"
@@ -179,6 +199,7 @@ is usually the formatter of \"man\" documentation pages.")
                (mkdir-p (string-append (assoc-ref outputs "out")
                                        "/bin"))
                #t)))))
+      (native-inputs `(("html-tree" ,perl-html-tree))) ; for test
       (inputs
        `(("perl" ,perl)))
       (home-page "https://daniel.haxx.se/projects/roffit/")