summaryrefslogtreecommitdiff
path: root/gnu/packages/man.scm
diff options
context:
space:
mode:
authorSören Tempel <[email protected]>2025-01-28 16:55:48 +0100
committerMaxim Cournoyer <[email protected]>2025-01-29 22:13:39 +0900
commit4176f6c52f485549f829af048ef9a6726b52e112 (patch)
treec0573d2f2866c1013ac0fef53ee3fb18d4ef2edf /gnu/packages/man.scm
parent9a17331bc3c47fd3fb3b497864603c5fdb84c3fa (diff)
gnu: mandoc: Support zstd-compressed man pages.
Since #68242 Guix uses zstd compression for man pages. Unfortunately, upstream mandoc only supports gzip compressed man pages. Luckily, zstd provides a wrapper library which easily allows adapting software using zlib to zstd compression. This patch uses this wrapper library in conjunction with mandoc to add support for zstd compression to it, thereby allowing Guix man pages to be viewed with mandoc again. Without this patch, mandoc is essentially defunct on Guix. * gnu/packages/man.scm (mandoc): Support zstd compression. * gnu/local.mk: Add new patch. * gnu/packages/patches/mandoc-support-zstd-compression.patch: New file. Signed-off-by: Maxim Cournoyer <[email protected]> Change-Id: I49a6b9f81309aa1b9f0e5d19b1813dbac13cf968
Diffstat (limited to 'gnu/packages/man.scm')
-rw-r--r--gnu/packages/man.scm54
1 files changed, 36 insertions, 18 deletions
diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm
index 3148fcc8a1..1ff1fac991 100644
--- a/gnu/packages/man.scm
+++ b/gnu/packages/man.scm
@@ -37,6 +37,7 @@
#:use-module (guix build-system gnu)
#:use-module (guix build-system ruby)
#:use-module (guix utils)
+ #:use-module (gnu packages)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
#:use-module (gnu packages dbm)
@@ -273,30 +274,47 @@ pages into HTML format.")
(method url-fetch)
(uri (string-append "https://mandoc.bsd.lv/snapshots/mandoc-"
version ".tar.gz"))
+ (patches (search-patches "mandoc-support-zstd-compression.patch"))
(sha256
(base32
"174x2x9ws47b14lm339j6rzm7mxy1j3qhh484khscw0yy1qdbw4b"))))
(build-system gnu-build-system)
(arguments
- `(#:test-target "regress"
- #:phases (modify-phases %standard-phases
- (add-before 'configure 'set-prefix
- (lambda* (#:key outputs #:allow-other-keys)
- (substitute* "configure"
- (("^CC=.*")
- (string-append "CC=" ,(cc-for-target) "\n"))
- (("^DEFCFLAGS=\\\\\"")
- "DEFCFLAGS=\"-O2 ")
- (("^UTF8_LOCALE=.*") ;used for tests
- "UTF8_LOCALE=en_US.UTF-8\n")
- (("^MANPATH_(BASE|DEFAULT)=.*" _ which)
- (string-append "MANPATH_" which "="
- "/run/current-system/profile/share/man\n"))
- (("^PREFIX=.*")
- (string-append "PREFIX=" (assoc-ref outputs "out")
- "\n"))))))))
+ (list
+ #:test-target "regress"
+ #:make-flags
+ #~(list "VPATH=./zstd-src/zlibWrapper"
+ (string-join
+ (list "CFLAGS=-DZWRAP_USE_ZSTD=1"
+ "-I./zstd-src/zlibWrapper")
+ " "))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'unpack-zstd
+ (lambda _
+ (mkdir "zstd-src")
+ (invoke "tar" "--strip-components=1" "-C"
+ "zstd-src" "-xf" #$(package-source zstd))))
+ (add-before 'configure 'set-prefix
+ (lambda* (#:key outputs #:allow-other-keys)
+ (substitute*
+ "configure"
+ (("^CC=.*")
+ (string-append "CC=" #$(cc-for-target) "\n"))
+ (("^DEFCFLAGS=\\\\\"")
+ "DEFCFLAGS=\"-O2 ")
+ (("^UTF8_LOCALE=.*") ;used for tests
+ "UTF8_LOCALE=en_US.UTF-8\n")
+ (("^MANPATH_(BASE|DEFAULT)=.*" _ which)
+ (string-append
+ "MANPATH_" which "="
+ "/run/current-system/profile/share/man\n"))
+ (("^PREFIX=.*")
+ (string-append "PREFIX="
+ (assoc-ref outputs "out")
+ "\n"))))))))
(native-inputs (list (libc-utf8-locales-for-target) perl)) ;used to run tests
- (inputs (list zlib))
+ (inputs (list zlib (list zstd "lib")))
(native-search-paths
(list (search-path-specification
(variable "MANPATH")