| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 |
|
| 27 | (define-module (gnu packages groff)
|
| 28 | #:use-module (guix licenses)
|
| 29 | #:use-module (guix packages)
|
| 30 | #:use-module (guix utils)
|
| 31 | #:use-module (guix download)
|
| 32 | #:use-module (guix git-download)
|
| 33 | #:use-module (guix build-system gnu)
|
| 34 | #:use-module (guix build-system ruby)
|
| 35 | #:use-module (guix gexp)
|
| 36 | #:use-module (gnu packages)
|
| 37 | #:use-module (gnu packages bash)
|
| 38 | #:use-module (gnu packages ruby-xyz)
|
| 39 | #:use-module (gnu packages bison)
|
| 40 | #:use-module (gnu packages compiler-tools)
|
| 41 | #:use-module (gnu packages ghostscript)
|
| 42 | #:use-module (gnu packages netpbm)
|
| 43 | #:use-module (gnu packages perl)
|
| 44 | #:use-module (gnu packages texinfo)
|
| 45 | #:use-module (gnu packages web))
|
| 46 |
|
| 47 | (define-public groff
|
| 48 | (package
|
| 49 | (name "groff")
|
| 50 | (version "1.24.2")
|
| 51 | (source (origin
|
| 52 | (method url-fetch)
|
| 53 | (uri (string-append "mirror://gnu/groff/groff-" version
|
| 54 | ".tar.gz"))
|
| 55 | (sha256 (base32
|
| 56 | "1naxkizfbz04rr1hzzz41cz1xpz87i3vfg86w737zqxvpvayzhgr"))))
|
| 57 | (build-system gnu-build-system)
|
| 58 | (outputs '("out"
|
| 59 | "doc")) |
| 60 |
|
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 |
|
| 66 | (inputs (list ghostscript))
|
| 67 |
|
| 68 | |
| 69 | |
| 70 | (native-inputs `(,@(if (%current-target-system)
|
| 71 | `(("self" ,this-package))
|
| 72 | '())
|
| 73 | ("bison" ,bison)
|
| 74 | ("perl" ,perl)
|
| 75 | ("psutils" ,psutils)
|
| 76 | ("texinfo" ,texinfo)))
|
| 77 | (arguments
|
| 78 | `(#:parallel-build? #f |
| 79 | ,@(if (%current-target-system)
|
| 80 | `(#:make-flags
|
| 81 | |
| 82 | |
| 83 | (let ((groff (or (assoc-ref %build-host-inputs "groff")
|
| 84 | (assoc-ref %build-host-inputs "self"))))
|
| 85 | (list
|
| 86 | (string-append "GROFF_BIN_PATH=" groff)
|
| 87 | (string-append "GROFFBIN=" groff "/bin/groff"))))
|
| 88 | '())
|
| 89 | #:phases
|
| 90 | (modify-phases %standard-phases
|
| 91 | (add-after 'unpack 'disable-relocatability
|
| 92 | (lambda _
|
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | (substitute* "Makefile.in"
|
| 112 | (("-DENABLE_RELOCATABLE=1") ""))
|
| 113 | #t))
|
| 114 | (add-after 'unpack 'setenv
|
| 115 | (lambda _
|
| 116 | (setenv "GS_GENERATE_UUIDS" "0")
|
| 117 | |
| 118 | |
| 119 | (setenv "GROFF_BIN_PATH" ".")))
|
| 120 | (add-after 'unpack 'fix-docdir
|
| 121 | (lambda _ |
| 122 | (substitute* "Makefile.in"
|
| 123 | (("^docdir =.*") "docdir = @docdir@\n"))
|
| 124 | #t)))))
|
| 125 | (synopsis "Typesetting from plain text mixed with formatting commands")
|
| 126 | (description
|
| 127 | "Groff is a typesetting package that reads plain text and produces
|
| 128 | formatted output based on formatting commands contained within the text. It
|
| 129 | is usually the formatter of \"man\" documentation pages.")
|
| 130 | (license gpl3+)
|
| 131 | (home-page "https://www.gnu.org/software/groff/")))
|
| 132 |
|
| 133 | (define-public groff-minimal
|
| 134 | |
| 135 | |
| 136 | (package/inherit groff
|
| 137 | (name "groff-minimal")
|
| 138 | (synopsis "Minimalist variant of Groff for use by man-db")
|
| 139 | (outputs '("out"))
|
| 140 |
|
| 141 | |
| 142 | (inputs '())
|
| 143 | (native-inputs `(("bison" ,bison)
|
| 144 | ("perl" ,perl)
|
| 145 | ("groff" ,groff)))
|
| 146 |
|
| 147 | (arguments
|
| 148 | `(#:disallowed-references ,(list (this-package-native-input "perl"))
|
| 149 |
|
| 150 | #:configure-flags '("--with-doc=no")
|
| 151 |
|
| 152 | ,@(substitute-keyword-arguments arguments
|
| 153 | ((#:phases phases)
|
| 154 | `(modify-phases ,phases
|
| 155 | (add-after 'install 'remove-non-essential-programs
|
| 156 | (lambda* (#:key outputs #:allow-other-keys)
|
| 157 | |
| 158 | |
| 159 | (let ((out (assoc-ref outputs "out"))
|
| 160 | (kept '("eqn" "neqn" "pic" "tbl" "refer" "preconv"
|
| 161 | "nroff" "groff" "troff" "grotty")))
|
| 162 | (for-each (lambda (file)
|
| 163 | (unless (member (basename file) kept)
|
| 164 | (delete-file file)))
|
| 165 | (find-files (string-append out "/bin")))
|
| 166 |
|
| 167 | |
| 168 | (for-each delete-file (find-files out "\\.pl$"))
|
| 169 | (for-each delete-file
|
| 170 | (find-files out "BuildFoundries"))
|
| 171 |
|
| 172 | |
| 173 | |
| 174 | (for-each delete-file-recursively
|
| 175 | (find-files out "^dev(dvi|ps|pdf|html|lj4)$"
|
| 176 | #:directories? #t))
|
| 177 | #t))))))))))
|
| 178 |
|
| 179 | |
| 180 | (define-public roffit
|
| 181 | (let ((commit "b59e6c855ebea03daf76e996b5c0f8343f11be3d")
|
| 182 | (revision "1"))
|
| 183 | (package
|
| 184 | (name "roffit")
|
| 185 | (version (string-append "0.12-" revision "." (string-take commit 9)))
|
| 186 | (source (origin
|
| 187 | (method git-fetch)
|
| 188 | (uri (git-reference
|
| 189 | (url "https://github.com/bagder/roffit")
|
| 190 | (commit commit)))
|
| 191 | (file-name (string-append "roffit-" commit "-checkout"))
|
| 192 | (sha256
|
| 193 | (base32
|
| 194 | "0z4cs92yqh22sykfgbjlyxfaifdvsd47cf1yhr0f2rgcc6l0fj1r"))))
|
| 195 | (build-system gnu-build-system)
|
| 196 | (arguments
|
| 197 | `(#:test-target "test"
|
| 198 | #:phases
|
| 199 | (modify-phases %standard-phases
|
| 200 | (delete 'configure)
|
| 201 | (replace 'install
|
| 202 | (lambda* (#:key outputs #:allow-other-keys)
|
| 203 | (let ((out (assoc-ref outputs "out")))
|
| 204 | (install-file "roffit" (string-append out "/bin"))
|
| 205 | (install-file "roffit.1"
|
| 206 | (string-append out "/share/man/man1")))))
|
| 207 | (add-after 'install 'wrap-program
|
| 208 | (lambda* (#:key outputs #:allow-other-keys)
|
| 209 | (let ((out (assoc-ref outputs "out")))
|
| 210 | (wrap-program (string-append out "/bin/roffit")
|
| 211 | `("PERL5LIB" ":" prefix (,(getenv "PERL5LIB"))))))))))
|
| 212 | (native-inputs (list perl-html-tree)) |
| 213 | (inputs (list bash-minimal perl))
|
| 214 | (home-page "https://daniel.haxx.se/projects/roffit/")
|
| 215 | (synopsis "Convert nroff files to HTML")
|
| 216 | (description
|
| 217 | "Roffit is a program that reads an nroff file and outputs an HTML file.
|
| 218 | It is typically used to display man pages on a web site.")
|
| 219 | (license expat))))
|
| 220 |
|
| 221 | (define-public ronn-ng
|
| 222 | (package
|
| 223 | (name "ronn-ng")
|
| 224 | (version "0.10.1")
|
| 225 | (source
|
| 226 | (origin
|
| 227 | (method url-fetch)
|
| 228 | (uri (rubygems-uri "ronn-ng" version))
|
| 229 | (sha256
|
| 230 | (base32
|
| 231 | "1h2y2v3wkl5c710wfanqwxlxi74l1ssva8yrzsg8iypvq22h3ssf"))))
|
| 232 | (build-system ruby-build-system)
|
| 233 | (arguments
|
| 234 | (list
|
| 235 | #:phases
|
| 236 | #~(modify-phases %standard-phases
|
| 237 | (add-after 'extract-gemspec 'fix-gemspec-mustache
|
| 238 | (lambda _
|
| 239 | (substitute* "ronn-ng.gemspec"
|
| 240 | (("(<mustache>.freeze.*~>).*(\".*$)" all start end)
|
| 241 | (string-append start " 1.0" end)))))
|
| 242 | (add-after 'wrap 'wrap-program
|
| 243 | (lambda* (#:key outputs #:allow-other-keys)
|
| 244 | (let ((prog (string-append (assoc-ref %outputs "out") "/bin/ronn")))
|
| 245 | (wrap-program prog
|
| 246 | `("PATH" ":" suffix ,(map
|
| 247 | (lambda (exp_inpt)
|
| 248 | (string-append
|
| 249 | (assoc-ref %build-inputs exp_inpt)
|
| 250 | "/bin"))
|
| 251 | '("ruby-kramdown"
|
| 252 | "ruby-mustache"
|
| 253 | "ruby-nokogiri"))))))))))
|
| 254 | (inputs
|
| 255 | (list bash-minimal
|
| 256 | ruby-kramdown
|
| 257 | ruby-kramdown-parser-gfm
|
| 258 | ruby-mustache
|
| 259 | ruby-nokogiri))
|
| 260 | (synopsis
|
| 261 | "Build manuals in HTML and Unix man page format from Markdown")
|
| 262 | (description
|
| 263 | "Ronn-NG is an updated fork of ronn. It builds manuals in HTML and Unix
|
| 264 | man page format from Markdown.")
|
| 265 | (home-page "https://github.com/apjanke/ronn-ng")
|
| 266 | (license expat)))
|
| 267 |
|
| 268 | (define-public grap
|
| 269 | (package
|
| 270 | (name "grap")
|
| 271 | (version "1.46")
|
| 272 | (source (origin
|
| 273 | (method url-fetch)
|
| 274 | (uri (string-append
|
| 275 | "https://www.lunabase.org/~faber/Vault/software/grap/grap-"
|
| 276 | version ".tar.gz"))
|
| 277 | (sha256
|
| 278 | (base32
|
| 279 | "1d4bhhgi64x4cjww7fj0lqgr20w7lqnl2aizj6cndsgyxkywx3ks"))))
|
| 280 | (build-system gnu-build-system)
|
| 281 | (native-inputs (list flex bison))
|
| 282 | (synopsis "Tool for creating graphs with troff")
|
| 283 | (description
|
| 284 | "Grap is a language for typesetting graphs specified and
|
| 285 | first implemented by Brian Kernighan and Jon Bentley at Bell Labs. It is an
|
| 286 | expressive language for describing graphs and incorporating them in typeset
|
| 287 | documents. It is implemented as a preprocessor to Kernigan's pic language for
|
| 288 | describing languages, so any system that can use pic can use grap. For sure,
|
| 289 | TeX and groff can use it.")
|
| 290 | (home-page "https://github.com/snorerot13/grap")
|
| 291 | (license bsd-3)))
|