| 1 | mandoc upstream does not support zstd compression. However, Guix uses zstd
|
| 2 | compression for its man pages, therefore — without support for this
|
| 3 | compression method — mandoc would be quite useless. Hence, this patchset uses
|
| 4 | zlibWrapper from the zstd project to add zstd compression support to mandoc.
|
| 5 |
|
| 6 | Upstream-status: https://inbox.vuxu.org/mandoc-discuss/[email protected]/T/#t
|
| 7 |
|
| 8 | diff -upr mandoc-1.14.6.orig/Makefile mandoc-1.14.6/Makefile
|
| 9 | |
| 10 | |
| 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 \
|
| 25 | Only in mandoc-1.14.6: Makefile.orig
|
| 26 | diff -upr mandoc-1.14.6.orig/configure mandoc-1.14.6/configure
|
| 27 | |
| 28 | |
| 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
|
| 38 | Only in mandoc-1.14.6: configure.orig
|
| 39 | diff -upr mandoc-1.14.6.orig/read.c mandoc-1.14.6/read.c
|
| 40 | |
| 41 | |
| 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 |
|
| 60 | Only in mandoc-1.14.6: read.c.orig
|