Commit: 74b9dae0d1f66500ef695613f3b8cc090b74c010
Parent: 8a637d418f8362bf98a064c258ba4c1ab23f9dbe
Author: Randy Palamar
Date: Wed, 27 Sep 2023 21:03:06 -0600
add mandoc from oasis
Diffstat:
8 files changed, 170 insertions(+), 0 deletions(-)
diff --git a/pkg/sys/gen.lua b/pkg/sys/gen.lua
@@ -1 +1,2 @@
subgen('openbsd')
+subgen('mandoc')
diff --git a/pkg/sys/mandoc/.gitignore b/pkg/sys/mandoc/.gitignore
@@ -0,0 +1,2 @@
+/mandoc-1.14.6.tar.gz
+/src
diff --git a/pkg/sys/mandoc/config.h b/pkg/sys/mandoc/config.h
@@ -0,0 +1,45 @@
+#define MAN_CONF_FILE "/etc/man.conf"
+#define MANPATH_BASE "/share/man"
+#define MANPATH_DEFAULT "/share/man"
+#define OSENUM MANDOC_OS_OTHER
+#define UTF8_LOCALE "C.UTF-8"
+#define EFTYPE EINVAL
+#define HAVE_DIRENT_NAMLEN 0
+#define HAVE_ENDIAN 1
+#define HAVE_ERR 1
+#define HAVE_FTS 0
+#define HAVE_FTS_COMPARE_CONST 0
+#define HAVE_GETLINE 1
+#define HAVE_GETSUBOPT 1
+#define HAVE_ISBLANK 1
+#define HAVE_LESS_T 1
+#define HAVE_MKDTEMP 1
+#define HAVE_MKSTEMPS 1
+#define HAVE_NTOHL 1
+#define HAVE_PLEDGE 0
+#define HAVE_PROGNAME 1
+#define HAVE_REALLOCARRAY 1
+#define HAVE_RECALLOCARRAY 1
+#define HAVE_REWB_BSD 0
+#define HAVE_REWB_SYSV 1
+#define HAVE_SANDBOX_INIT 0
+#define HAVE_STRCASESTR 1
+#define HAVE_STRINGLIST 0
+#define HAVE_STRLCAT 1
+#define HAVE_STRLCPY 1
+#define HAVE_STRNDUP 1
+#define HAVE_STRPTIME 1
+#define HAVE_STRSEP 1
+#define HAVE_STRTONUM 1
+#define HAVE_SYS_ENDIAN 0
+#define HAVE_VASPRINTF 1
+#define HAVE_WCHAR 1
+#define HAVE_OHASH 0
+#define NEED_XPG4_2 0
+#define BINM_APROPOS "apropos"
+#define BINM_CATMAN "catman"
+#define BINM_MAKEWHATIS "makewhatis"
+#define BINM_MAN "man"
+#define BINM_SOELIM "soelim"
+#define BINM_WHATIS "whatis"
+#define BINM_PAGER "less"
diff --git a/pkg/sys/mandoc/gen.lua b/pkg/sys/mandoc/gen.lua
@@ -0,0 +1,118 @@
+cflags({
+ '-I $dir',
+ '-isystem $basedir/pkg/sys/openbsd/include',
+ '-isystem $builddir/pkg/libs/zlib/include',
+})
+
+lib('libmandoc.a', {
+ 'man.c',
+ 'man_macro.c',
+ 'man_validate.c',
+
+ 'arch.c',
+ 'att.c',
+ 'lib.c',
+ 'mdoc.c',
+ 'mdoc_argv.c',
+ 'mdoc_macro.c',
+ 'mdoc_state.c',
+ 'mdoc_validate.c',
+ 'st.c',
+
+ 'eqn.c',
+ 'roff.c',
+ 'roff_validate.c',
+ 'tbl.c',
+ 'tbl_data.c',
+ 'tbl_layout.c',
+ 'tbl_opts.c',
+
+ 'chars.c',
+ 'mandoc.c',
+ 'mandoc_aux.c',
+ 'mandoc_msg.c',
+ 'mandoc_ohash.c',
+ 'mandoc_xr.c',
+ 'msec.c',
+ 'preconv.c',
+ 'read.c',
+ 'tag.c',
+
+ 'compat_fts.c',
+ 'compat_ohash.c',
+}, {'pkg/libs/zlib/headers'})
+
+exe('mandoc', {
+ 'main.c',
+ 'manpath.c',
+ 'mdoc_man.c',
+ 'mdoc_markdown.c',
+ 'out.c',
+ 'tree.c',
+
+ 'eqn_html.c',
+ 'html.c',
+ 'man_html.c',
+ 'mdoc_html.c',
+ 'roff_html.c',
+ 'tbl_html.c',
+
+ 'eqn_term.c',
+ 'man_term.c',
+ 'mdoc_term.c',
+ 'roff_term.c',
+ 'term.c',
+ 'term_ascii.c',
+ 'term_ps.c',
+ 'term_tab.c',
+ 'term_tag.c',
+ 'tbl_term.c',
+
+ 'dbm.c',
+ 'dbm_map.c',
+ 'mansearch.c',
+
+ 'dba.c',
+ 'dba_array.c',
+ 'dba_read.c',
+ 'dba_write.c',
+ 'mandocdb.c',
+
+ 'libmandoc.a',
+ '$builddir/pkg/sys/openbsd/libbsd.a',
+ '$builddir/pkg/libs/zlib/libz.a',
+})
+file('bin/mandoc', '755', '$outdir/mandoc')
+for _, cmd in ipairs{'apropos', 'man', 'whatis', 'makewhatis'} do
+ sym('bin/'..cmd, 'mandoc')
+end
+
+exe('demandoc', {
+ 'demandoc.c',
+ 'libmandoc.a',
+ '$builddir/pkg/sys/openbsd/libbsd.a',
+ '$builddir/pkg/libs/zlib/libz.a',
+})
+file('bin/demandoc', '755', '$outdir/demandoc')
+
+man({
+ 'mandoc.1',
+ 'demandoc.1',
+ 'man.1',
+ 'apropos.1',
+
+ 'man.conf.5',
+ 'mandoc.db.5',
+
+ 'man.7',
+ 'mdoc.7',
+ 'roff.7',
+ 'eqn.7',
+ 'tbl.7',
+ 'mandoc_char.7',
+
+ 'makewhatis.8',
+})
+sym('share/man/man1/whatis.1', 'apropos.1')
+
+fetch('curl')
diff --git a/pkg/sys/mandoc/sha256 b/pkg/sys/mandoc/sha256
@@ -0,0 +1 @@
+8bf0d570f01e70a6e124884088870cbed7537f36328d512909eb10cd53179d9c mandoc-1.14.6.tar.gz
diff --git a/pkg/sys/mandoc/url b/pkg/sys/mandoc/url
@@ -0,0 +1 @@
+url = "http://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz"
diff --git a/pkg/sys/mandoc/ver b/pkg/sys/mandoc/ver
@@ -0,0 +1 @@
+1.14.6 r0
diff --git a/sets.lua b/sets.lua
@@ -4,6 +4,7 @@ S.bin = {
'awk',
'curl',
'hyx',
+ 'mandoc',
'openbsd',
'pwgen',
'samurai',