about summary refs log tree commit diff
path: root/pkgs/sternenseemann/patches/mandoc-nix-store.patch
blob: 22be8fcc58454af497de8996df93dfc0641663bf (plain) (blame)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Index: configure
===================================================================
RCS file: /cvs/mandoc/configure,v
retrieving revision 1.77
diff -u -r1.77 configure
--- configure	20 Jul 2020 16:57:30 -0000	1.77
+++ configure	8 Feb 2021 17:51:07 -0000
@@ -108,6 +108,7 @@
 LIBDIR=
 MANDIR=
 HOMEBREWDIR=
+NIXSTOREDIR=
 
 WWWPREFIX="/var/www"
 HTDOCDIR=
@@ -462,6 +463,7 @@
 [ -n "${OSNAME}" ] && echo "#define OSNAME \"${OSNAME}\""
 [ -n "${UTF8_LOCALE}" ] && echo "#define UTF8_LOCALE \"${UTF8_LOCALE}\""
 [ -n "${HOMEBREWDIR}" ] && echo "#define HOMEBREWDIR \"${HOMEBREWDIR}\""
+[ -n "${NIXSTOREDIR}" ] && echo "#define NIXSTOREDIR \"${NIXSTOREDIR}\""
 [ ${HAVE_ATTRIBUTE} -eq 0 ] && echo "#define __attribute__(x)"
 [ ${HAVE_EFTYPE} -eq 0 ] && echo "#define EFTYPE EINVAL"
 [ ${HAVE_O_DIRECTORY} -eq 0 ] && echo "#define O_DIRECTORY 0"
Index: configure.local.example
===================================================================
RCS file: /cvs/mandoc/configure.local.example,v
retrieving revision 1.39
diff -u -r1.39 configure.local.example
--- configure.local.example	20 Jul 2020 16:57:30 -0000	1.39
+++ configure.local.example	8 Feb 2021 17:51:07 -0000
@@ -218,6 +218,16 @@
 PREFIX="/usr/local"
 HOMEBREWDIR="${PREFIX}/Cellar"
 
+# Similarly, when using the nix package manager or the NixOS linux
+# distribution, man pages are stored in the packages' output store
+# path in /nix/store.  The globally installed man pages under
+# /run/current-system/sw/share/man are thus symlinks to files under
+# /nix/store.  By setting NIXSTOREDIR, mandoc won't ignore these
+# symlinks.
+# This setting can also be used to support Guix which is derived
+# from NixOS, but uses /gnu/store instead of /nix/store.
+NIXSTOREDIR="/nix/store"
+
 # --- user settings for the mandoc(3) library --------------------------
 
 # By default, libmandoc.a is not installed.  It is almost never needed
Index: mandocdb.c
===================================================================
RCS file: /cvs/mandoc/mandocdb.c,v
retrieving revision 1.267
diff -u -r1.267 mandocdb.c
--- mandocdb.c	3 Apr 2020 11:35:01 -0000	1.267
+++ mandocdb.c	8 Feb 2021 17:51:08 -0000
@@ -615,6 +615,9 @@
 #ifdef HOMEBREWDIR
 			    && strncmp(buf, HOMEBREWDIR, strlen(HOMEBREWDIR))
 #endif
+#ifdef NIXSTOREDIR
+			    && strncmp(buf, NIXSTOREDIR, strlen(NIXSTOREDIR))
+#endif
 			) {
 				if (warnings) say("",
 				    "%s: outside base directory", buf);
@@ -825,6 +828,10 @@
 		start = usefile + basedir_len;
 #ifdef HOMEBREWDIR
 	else if (strncmp(usefile, HOMEBREWDIR, strlen(HOMEBREWDIR)) == 0)
+		start = usefile;
+#endif
+#ifdef NIXSTOREDIR
+	else if (strncmp(usefile, NIXSTOREDIR, strlen(NIXSTOREDIR)) == 0)
 		start = usefile;
 #endif
 	else {