python/hypothesis: update to 6.122.3
[oi-userland.git] / components / desktop / gnome / yelp / patches / 03-yelp-groff.patch
blob55f0e39ef30d6e5c11eaf6ed0c11679adbfe7a7c
1 https://gitlab.gnome.org/GNOME/yelp/-/issues/50
3 --- yelp-42.2/Makefile.am.orig
4 +++ yelp-42.2/Makefile.am
5 @@ -7,6 +7,8 @@
7 lib_LTLIBRARIES = libyelp/libyelp.la
9 +libexec_SCRIPTS = libyelp/yelp-groff
11 libyelp_libyelp_la_SOURCES = \
12 libyelp/yelp-bookmarks.c \
13 libyelp/yelp-debug.c \
14 @@ -58,6 +60,7 @@
16 libyelp_libyelp_la_CPPFLAGS = \
17 -DDATADIR=\""$(datadir)"\" \
18 + -DLIBEXECDIR=\"$(libexecdir)\" \
19 -DYELP_ICON_PATH=\"$(YELP_ICON_PATH)\" \
20 -DYELP_WEB_EXTENSIONS_DIR=\""$(pkglibdir)/"web-extensions\" \
21 -I$(top_builddir)/libyelp
22 --- /dev/null
23 +++ yelp-42.2/libyelp/yelp-groff
24 @@ -0,0 +1,49 @@
25 +#!/usr/bin/sh
27 +# Copyright (c) 2011 Alexandre Rostovtsev <tetromino@gmail.com>
29 +# This program is free software; you can redistribute it and/or
30 +# modify it under the terms of the GNU General Public License as
31 +# published by the Free Software Foundation; either version 2 of the
32 +# License, or (at your option) any later version.
34 +# This program is distributed in the hope that it will be useful,
35 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
36 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37 +# General Public License for more details.
39 +# You should have received a copy of the GNU General Public
40 +# License along with this program; if not, write to the
41 +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
42 +# Boston, MA 02110-1301, USA.
44 +###
46 +# Process the requested compressed source nroff file and output groff
47 +# intermediate format.
50 +filename=$1
52 +if [ -z ${filename} ] ; then
53 + echo "Usage: yelp-groff [FILE]" >&2
54 + echo "Process a man FILE and output groff intermediate format."
55 + exit 1
56 +fi
58 +# If "man -Z -Tutf8 -EUTF-8" works (i.e. if man is man-db), use that.
59 +#man -Z -Tutf8 -EUTF-8 ${filename} 2>/dev/null && exit 0
61 +# Otherwise, manually uncompress the file ...
62 +cat="cat"
63 +case ${filename} in
64 + *.bz2) cat="bzip2 -c -d" ;;
65 + *.gz) cat="gunzip -c" ;;
66 + *.lzma) cat="unlzma -c -d" ;;
67 + *.xz) cat="unxz -c" ;;
68 + *.Z) cat="zcat" ;;
69 +esac
71 +# ... and run groff to get the intermediate format; preprocess with tbl
72 +# unless MANROFFSEQ is defined.
73 +${cat} ${filename} | groff -${MANROFFSEQ:-t} -man -Z -Tutf8
74 --- yelp-42.2/libyelp/yelp-man-parser.c.orig
75 +++ yelp-42.2/libyelp/yelp-man-parser.c
76 @@ -369,7 +369,7 @@
78 gint ystdout;
79 GError *err = NULL;
80 - const gchar *argv[] = { "man", "-Z", "-Tutf8", "-EUTF-8", path, NULL };
81 + const gchar *argv[] = { LIBEXECDIR "/yelp-groff", path, NULL };
82 gchar **my_argv;
84 /* g_strdupv() should accept a "const gchar **". */