projects/guix·blob python-team · refs

60 lines · 2.1 KiB

1mandoc upstream does not support zstd compression. However, Guix uses zstd
2compression for its man pages, therefore — without support for this
3compression method — mandoc would be quite useless. Hence, this patchset uses
4zlibWrapper from the zstd project to add zstd compression support to mandoc.
5
6Upstream-status: https://inbox.vuxu.org/mandoc-discuss/[email protected]/T/#t
7
8diff -upr mandoc-1.14.6.orig/Makefile mandoc-1.14.6/Makefile
9--- mandoc-1.14.6.orig/Makefile 2025-01-11 16:20:31.511129163 +0100
10+++ mandoc-1.14.6/Makefile 2025-01-11 19:16:35.924788821 +0100
11@@ -251,7 +251,12 @@ LIBMANDOC_OBJS = $(LIBMAN_OBJS) \
12 msec.o \
13 preconv.o \
14 read.o \
15- tag.o
16+ tag.o \
17+ zstd_zlibwrapper.o \
18+ gzclose.o \
19+ gzlib.o \
20+ gzread.o \
21+ gzwrite.o
22
23 ALL_COBJS = compat_err.o \
24 compat_fts.o \
25Only in mandoc-1.14.6: Makefile.orig
26diff -upr mandoc-1.14.6.orig/configure mandoc-1.14.6/configure
27--- mandoc-1.14.6.orig/configure 2025-01-11 16:20:31.511129163 +0100
28+++ mandoc-1.14.6/configure 2025-01-11 19:16:35.924788821 +0100
29@@ -430,7 +430,7 @@ fi
30 [ "${FATAL}" -eq 0 ] || exit 1
31
32 # --- LDADD ---
33-LDADD="${LDADD} ${LD_NANOSLEEP} ${LD_RECVMSG} ${LD_OHASH} -lz"
34+LDADD="${LDADD} ${LD_NANOSLEEP} ${LD_RECVMSG} ${LD_OHASH} -lz -lzstd"
35 echo "selected LDADD=\"${LDADD}\"" 1>&2
36 echo "selected LDADD=\"${LDADD}\"" 1>&3
37 echo 1>&3
38Only in mandoc-1.14.6: configure.orig
39diff -upr mandoc-1.14.6.orig/read.c mandoc-1.14.6/read.c
40--- mandoc-1.14.6.orig/read.c 2025-01-11 16:35:03.825441715 +0100
41+++ mandoc-1.14.6/read.c 2025-01-11 19:16:35.924788821 +0100
42@@ -37,7 +37,7 @@
43 #include <stdlib.h>
44 #include <string.h>
45 #include <unistd.h>
46-#include <zlib.h>
47+#include <zstd_zlibwrapper.h>
48
49 #include "mandoc_aux.h"
50 #include "mandoc.h"
51@@ -627,7 +627,7 @@ mparse_open(struct mparse *curp, const char *file)
52 int fd, save_errno;
53
54 cp = strrchr(file, '.');
55- curp->gzip = (cp != NULL && ! strcmp(cp + 1, "gz"));
56+ curp->gzip = (cp != NULL && (! strcmp(cp + 1, "gz") || ! strcmp(cp + 1, "zst")));
57
58 /* First try to use the filename as it is. */
59
60Only in mandoc-1.14.6: read.c.orig