Commit: bef456a043a8c5daa5848d2b8ad124ca4f96e3df
Parent: 1db4fc8978c66c2884c9056e78a4bfe08b67df47
Author: Randy Palamar
Date: Tue, 2 Jan 2024 10:23:57 -0700
add sys/less from oasis
manpage installation was changed to use the man() function
Diffstat:
9 files changed, 233 insertions(+), 1 deletion(-)
diff --git a/pkg/sys/gen.lua b/pkg/sys/gen.lua
@@ -1,3 +1,4 @@
-subgen('openbsd')
+subgen('less')
subgen('mandoc')
+subgen('openbsd')
subgen('sbase')
diff --git a/pkg/sys/less/.gitignore b/pkg/sys/less/.gitignore
@@ -0,0 +1,2 @@
+/less-590.tar.gz
+/src
diff --git a/pkg/sys/less/defines.h b/pkg/sys/less/defines.h
@@ -0,0 +1,142 @@
+#define BINDIR "/bin"
+#define SYSDIR "/etc"
+
+#define SECURE SECURE_COMPILE
+#define SHELL_ESCAPE (!SECURE)
+#define EXAMINE (!SECURE)
+#define TAB_COMPLETE_FILENAME (!SECURE)
+#define CMD_HISTORY 1
+#define HILITE_SEARCH 1
+#define EDITOR (!SECURE)
+#define TAGS (!SECURE)
+#define USERFILE (!SECURE)
+#define GLOB (!SECURE)
+#define PIPEC (!SECURE && HAVE_POPEN)
+#define LOGFILE (!SECURE)
+#define GNU_OPTIONS 1
+#define ONLY_RETURN 0
+#define LESSKEYFILE ".less"
+#define LESSKEYFILE_SYS SYSDIR "/sysless"
+#define DEF_LESSKEYINFILE ".lesskey"
+#define LESSKEYINFILE_SYS SYSDIR "/syslesskey"
+#define LESSHISTFILE ".lesshst"
+#define MSDOS_COMPILER 0
+#define PATHNAME_SEP "/"
+#define TGETENT_OK 1
+#define HAVE_ANSI_PROTOS 1
+#define HAVE_SYS_TYPES_H 1
+/* #undef HAVE_SGSTAT_H */
+#define HAVE_PERROR 1
+#define HAVE_TIME 1
+#define HAVE_SHELL 1
+#define DEF_METACHARS "; *?\t\n'\"()<>[]|&^`#\\$%=~{},"
+#define DEF_METAESCAPE "\\"
+#define HAVE_DUP 1
+#define HAVE_MEMCPY 1
+#define HAVE_STRCHR 1
+#define HAVE_STRSTR 1
+#define HAVE_LESSKEYSRC 1
+#if 0 /* old sizes for small memory machines */
+#define CMDBUF_SIZE 512 /* Buffer for multichar commands */
+#define UNGOT_SIZE 100 /* Max chars to unget() */
+#define LINEBUF_SIZE 1024 /* Max size of line in input file */
+#define OUTBUF_SIZE 1024 /* Output buffer */
+#define PROMPT_SIZE 200 /* Max size of prompt string */
+#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
+#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
+#define TAGLINE_SIZE 512 /* Max size of line in tags file */
+#define TABSTOP_MAX 32 /* Max number of custom tab stops */
+#else /* more reasonable sizes for modern machines */
+#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */
+#define UNGOT_SIZE 200 /* Max chars to unget() */
+#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */
+#define OUTBUF_SIZE 1024 /* Output buffer */
+#define PROMPT_SIZE 2048 /* Max size of prompt string */
+#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */
+#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */
+#define TAGLINE_SIZE 1024 /* Max size of line in tags file */
+#define TABSTOP_MAX 128 /* Max number of custom tab stops */
+#endif
+#define EDIT_PGM "vi"
+#define HAVE_CONST 1
+#define HAVE_CTYPE_H 1
+#define HAVE_ERRNO 1
+#define HAVE_ERRNO_H 1
+#define HAVE_FCHMOD 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FILENO 1
+#define HAVE_FLOAT 1
+#define HAVE_FSYNC 1
+/* #undef HAVE_GNU_REGEX */
+#define HAVE_INTTYPES_H 1
+#define HAVE_LIMITS_H 1
+#define HAVE_LOCALE 1
+#define HAVE_MEMORY_H 1
+#define HAVE_NANOSLEEP 1
+#define HAVE_OSPEED 1
+/* #undef HAVE_PCRE */
+/* #undef HAVE_PCRE2 */
+#define HAVE_POLL 1
+#define HAVE_POPEN 1
+#define HAVE_POSIX_REGCOMP 1
+#define HAVE_REALPATH 1
+/* #undef HAVE_REGCMP */
+/* #undef HAVE_REGEXEC2 */
+/* #undef HAVE_RE_COMP */
+#define HAVE_SIGEMPTYSET 1
+#define HAVE_SIGPROCMASK 1
+/* #undef HAVE_SIGSETMASK */
+#define HAVE_SIGSET_T 1
+#define HAVE_SNPRINTF 1
+#define HAVE_STAT 1
+#define HAVE_STAT_INO 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDIO_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRERROR 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_SYSTEM 1
+#define HAVE_SYS_ERRLIST 1
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_STAT_H 1
+/* #undef HAVE_SYS_STREAM_H */
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_TERMCAP_H 1
+#define HAVE_TERMIOS_FUNCS 1
+#define HAVE_TERMIOS_H 1
+/* #undef HAVE_TERMIO_H */
+#define HAVE_TIME_H 1
+#define HAVE_TIME_T 1
+#define HAVE_TTYNAME 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UPPER_LOWER 1
+#define HAVE_USLEEP 1
+/* #undef HAVE_V8_REGCOMP */
+#define HAVE_VALUES_H 1
+#define HAVE_VOID 1
+#define HAVE_WCTYPE 1
+#define HAVE_WCTYPE_H 1
+#define HAVE__SETJMP 1
+/* #undef MUST_DEFINE_ERRNO */
+/* #undef MUST_DEFINE_OSPEED */
+/* #undef NO_REGEX */
+#define PACKAGE_BUGREPORT ""
+#define PACKAGE_NAME "less"
+#define PACKAGE_STRING "less 1"
+#define PACKAGE_TARNAME "less"
+#define PACKAGE_URL ""
+#define PACKAGE_VERSION "1"
+#define RETSIGTYPE void
+#define SECURE_COMPILE 0
+/* #undef STAT_MACROS_BROKEN */
+#define STDC_HEADERS 1
+#define TIME_WITH_SYS_TIME 1
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+/* #undef _FILE_OFFSET_BITS */
+/* #undef _LARGE_FILES */
+/* #undef const */
+/* #undef off_t */
+/* #undef size_t */
diff --git a/pkg/sys/less/gen.lua b/pkg/sys/less/gen.lua
@@ -0,0 +1,34 @@
+cflags({
+ '-I $dir',
+ '-isystem $builddir/pkg/libs/netbsd-curses/include',
+})
+
+objects([[
+ lesskey_parse.c
+ version.c
+ xbuf.c
+]])
+
+exe('less', [[
+ main.c screen.c brac.c ch.c charset.c cmdbuf.c
+ command.c cvt.c decode.c edit.c filename.c forwback.c
+ help.c ifile.c input.c jump.c line.c linenum.c
+ lsystem.c mark.c optfunc.c option.c opttbl.c os.c
+ output.c pattern.c position.c prompt.c search.c signal.c
+ tags.c ttyin.c version.c.o xbuf.c.o
+ lesskey_parse.c.o
+ $builddir/pkg/libs/netbsd-curses/libcurses.a.d
+]], {'pkg/libs/netbsd-curses/headers'})
+file('bin/less', '755', '$outdir/less')
+
+exe('lessecho', {'lessecho.c', 'version.c.o'})
+file('bin/lessecho', '755', '$outdir/lessecho')
+
+exe('lesskey', {'lesskey.c', 'lesskey_parse.c.o', 'xbuf.c.o', 'version.c.o'})
+file('bin/lesskey', '755', '$outdir/lesskey')
+
+man({'less.nro', 'lessecho.nro', 'lesskey.nro'}, '1')
+
+sym('bin/more', 'less')
+
+fetch('curl')
diff --git a/pkg/sys/less/patch/0001-Fix-compiler-warning.patch b/pkg/sys/less/patch/0001-Fix-compiler-warning.patch
@@ -0,0 +1,49 @@
+From a13b37473388ed731c2dc96c6bf2b053a4de26c3 Mon Sep 17 00:00:00 2001
+From: Mark Nudelman <markn@greenwoodsoftware.com>
+Date: Tue, 27 Jul 2021 10:33:14 -0700
+Subject: [PATCH] Fix compiler warning.
+
+---
+ funcs.h | 2 +-
+ xbuf.c | 2 +-
+ xbuf.h | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/funcs.h b/funcs.h
+index 330540a..29de5d3 100644
+--- a/funcs.h
++++ b/funcs.h
+@@ -351,4 +351,4 @@ public int getchr LESSPARAMS ((VOID_PARAM));
+ public void xbuf_init LESSPARAMS ((struct xbuffer *xbuf));
+ public void xbuf_deinit LESSPARAMS ((struct xbuffer *xbuf));
+ public void xbuf_reset LESSPARAMS ((struct xbuffer *xbuf));
+-public void xbuf_add LESSPARAMS ((struct xbuffer *xbuf, char ch));
++public void xbuf_add LESSPARAMS ((struct xbuffer *xbuf, int ch));
+diff --git a/xbuf.c b/xbuf.c
+index f20dfae..cc6ec47 100644
+--- a/xbuf.c
++++ b/xbuf.c
+@@ -34,7 +34,7 @@ xbuf_reset(xbuf)
+ public void
+ xbuf_add(xbuf, ch)
+ struct xbuffer *xbuf;
+- char ch;
++ int ch;
+ {
+ if (xbuf->end >= xbuf->size)
+ {
+diff --git a/xbuf.h b/xbuf.h
+index ba62ef1..b6bd160 100644
+--- a/xbuf.h
++++ b/xbuf.h
+@@ -10,6 +10,6 @@ struct xbuffer
+
+ void xbuf_init(struct xbuffer *xbuf);
+ void xbuf_reset(struct xbuffer *xbuf);
+-void xbuf_add(struct xbuffer *xbuf, char ch);
++void xbuf_add(struct xbuffer *xbuf, int ch);
+
+ #endif
+--
+2.32.0
+
diff --git a/pkg/sys/less/sha256 b/pkg/sys/less/sha256
@@ -0,0 +1 @@
+6aadf54be8bf57d0e2999a3c5d67b1de63808bb90deb8f77b028eafae3a08e10 less-590.tar.gz
diff --git a/pkg/sys/less/url b/pkg/sys/less/url
@@ -0,0 +1 @@
+url = "http://www.greenwoodsoftware.com/less/less-590.tar.gz"
diff --git a/pkg/sys/less/ver b/pkg/sys/less/ver
@@ -0,0 +1 @@
+590 r0
diff --git a/sets.lua b/sets.lua
@@ -6,6 +6,7 @@ S.bin = {
'curl',
'git',
'hyx',
+ 'less',
'man-pages-posix',
'mandoc',
'mblaze',