git: 18999e9e85d5 - main - devel/heirloom-devtools: New port: OpenSolaris yacc, lex, m4, make, SCCS

From: Hiroki Sato <hrs_at_FreeBSD.org>
Date: Fri, 13 Jan 2023 18:03:30 UTC
The branch main has been updated by hrs:

URL: https://cgit.FreeBSD.org/ports/commit/?id=18999e9e85d5e36332d14c7580932f08da39c366

commit 18999e9e85d5e36332d14c7580932f08da39c366
Author:     Hiroki Sato <hrs@FreeBSD.org>
AuthorDate: 2023-01-13 17:56:36 +0000
Commit:     Hiroki Sato <hrs@FreeBSD.org>
CommitDate: 2023-01-13 18:02:06 +0000

    devel/heirloom-devtools: New port: OpenSolaris yacc, lex, m4, make, SCCS
---
 devel/Makefile                                     |  1 +
 devel/heirloom-devtools/Makefile                   | 53 ++++++++++++++
 devel/heirloom-devtools/distinfo                   |  3 +
 .../files/heirloom-devtools.conf.in                |  1 +
 .../heirloom-devtools/files/patch-make-bsd-bsd.cc  | 11 +++
 .../files/patch-make-mksh-dosys.cc                 | 21 ++++++
 .../files/patch-make-src-Makefile.mk               |  8 +++
 .../heirloom-devtools/files/patch-make-src-main.cc | 12 ++++
 .../files/patch-make-vroot-lock.cc                 | 29 ++++++++
 devel/heirloom-devtools/files/patch-mk.config      | 82 ++++++++++++++++++++++
 devel/heirloom-devtools/files/patch-sccs-src-vc.c  | 12 ++++
 devel/heirloom-devtools/pkg-descr                  |  5 ++
 devel/heirloom-devtools/pkg-plist                  | 68 ++++++++++++++++++
 13 files changed, 306 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index f4be22b289e9..1df08c170c68 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -931,6 +931,7 @@
     SUBDIR += hcs12mem
     SUBDIR += heaptrack
     SUBDIR += heimdall
+    SUBDIR += heirloom-devtools
     SUBDIR += hexcompare
     SUBDIR += hexd
     SUBDIR += hgreviewboard
diff --git a/devel/heirloom-devtools/Makefile b/devel/heirloom-devtools/Makefile
new file mode 100644
index 000000000000..ee64540c16b5
--- /dev/null
+++ b/devel/heirloom-devtools/Makefile
@@ -0,0 +1,53 @@
+PORTNAME=	heirloom-devtools
+PORTVERSION=	070527
+CATEGORIES=	devel
+MASTER_SITES=	SF/heirloom/${PORTNAME}/${PORTVERSION}
+
+MAINTAINER=	hrs@FreeBSD.org
+COMMENT=	OpenSolaris yacc, lex, m4, make, and SCCS
+WWW=		https://heirloom.sourceforge.net/devtools.html
+
+LICENSE=	CDDL
+
+USES=		tar:bzip2
+
+ALL_TARGET=	#empty
+MAKE_ARGS+=	INSTALL="${INSTALL}" \
+		BINDIR=${BINDIR} \
+		SUSBIN=${SUSBIN} \
+		LIBDIR=${LIBDIR} \
+		HDRSDIR=${HDRSDIR} \
+		MANDIR=${MANDIR} \
+		ROOT=${STAGEDIR}
+MAKEFILE=	makefile
+CFLAGS+=	-fcommon
+SUB_FILES=	${PORTNAME}.conf
+PLIST_SUB=	LIBEXECDIR=heirloom/libexec
+
+MANPREFIX=	${PREFIX}/heirloom/share
+DATADIR=	${PREFIX}/heirloom/share
+
+BINDIR?=	${PREFIX}/heirloom/bin
+SUSBIN?=	${PREFIX}/heirloom/bin/posix
+LIBDIR?=	${PREFIX}/heirloom/libexec
+HDRSDIR?=	${DATADIR}/lib/make
+MANDIR?=	${MANPREFIX}/man
+
+PORTDOCS=	 *
+
+MAKE_JOBS_UNSAFE=	yes
+
+OPTIONS_DEFINE=	DOCS
+
+post-install:
+	${INSTALL_DATA} ${WRKDIR}/${PORTNAME}.conf \
+	    ${STAGEDIR}${PREFIX}/etc/man.d
+
+pre-install-DOCS-on:
+	@${MKDIR} ${STAGEDIR}${DOCSDIR}
+
+post-install-DOCS-on:
+	cd ${WRKSRC} && ${INSTALL_DATA} CHANGES README ${STAGEDIR}${DOCSDIR}
+	cd ${WRKSRC} && ${COPYTREE_SHARE} LICENSE ${STAGEDIR}${DOCSDIR}
+
+.include <bsd.port.mk>
diff --git a/devel/heirloom-devtools/distinfo b/devel/heirloom-devtools/distinfo
new file mode 100644
index 000000000000..5f83b1a2e3c6
--- /dev/null
+++ b/devel/heirloom-devtools/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1673601154
+SHA256 (heirloom-devtools-070527.tar.bz2) = 9f233d8b78e4351fe9dd2d50d83958a0e5af36f54e9818521458a08e058691ba
+SIZE (heirloom-devtools-070527.tar.bz2) = 381054
diff --git a/devel/heirloom-devtools/files/heirloom-devtools.conf.in b/devel/heirloom-devtools/files/heirloom-devtools.conf.in
new file mode 100644
index 000000000000..620e3e11dfb5
--- /dev/null
+++ b/devel/heirloom-devtools/files/heirloom-devtools.conf.in
@@ -0,0 +1 @@
+MANPATH	%%PREFIX%%/heirloom/share/man
diff --git a/devel/heirloom-devtools/files/patch-make-bsd-bsd.cc b/devel/heirloom-devtools/files/patch-make-bsd-bsd.cc
new file mode 100644
index 000000000000..cbc33107f156
--- /dev/null
+++ b/devel/heirloom-devtools/files/patch-make-bsd-bsd.cc
@@ -0,0 +1,11 @@
+--- make/bsd/bsd.cc.orig	2023-01-13 17:10:06 UTC
++++ make/bsd/bsd.cc
+@@ -50,7 +50,7 @@
+ extern SIG_PF
+ bsdsignal (int Signal, SIG_PF Handler)
+ {
+-  auto SIG_PF                   previous_handler;
++  SIG_PF                   previous_handler;
+ #ifdef SUN5_0
+ #ifdef sun
+   previous_handler = sigset (Signal, Handler);
diff --git a/devel/heirloom-devtools/files/patch-make-mksh-dosys.cc b/devel/heirloom-devtools/files/patch-make-mksh-dosys.cc
new file mode 100644
index 000000000000..5fd13b91b60f
--- /dev/null
+++ b/devel/heirloom-devtools/files/patch-make-mksh-dosys.cc
@@ -0,0 +1,21 @@
+--- make/mksh/dosys.cc.orig	2007-03-07 00:12:07 UTC
++++ make/mksh/dosys.cc
+@@ -99,6 +99,9 @@
+ /*
+  * typedefs & structs
+  */
++#if defined(__FreeBSD__)
++extern char **environ;
++#endif /* __FreeBSD__ */
+ 
+ /*
+  * Static variables
+@@ -809,7 +812,7 @@ sh_command2string(register String command, register St
+ 	int			status;
+ 	Boolean			command_generated_output = false;
+ 
+-	command->text.p = (int) nul_char;
++	command->text.p[0] = (int) nul_char;
+ 	WCSTOMBS(mbs_buffer, command->buffer.start);
+ 	if ((fd = popen(mbs_buffer, "r")) == NULL) {
+ 		WCSTOMBS(mbs_buffer, command->buffer.start);
diff --git a/devel/heirloom-devtools/files/patch-make-src-Makefile.mk b/devel/heirloom-devtools/files/patch-make-src-Makefile.mk
new file mode 100644
index 000000000000..3ce67aa67b77
--- /dev/null
+++ b/devel/heirloom-devtools/files/patch-make-src-Makefile.mk
@@ -0,0 +1,8 @@
+--- make/src/Makefile.mk.orig	2023-01-13 17:38:46 UTC
++++ make/src/Makefile.mk
+@@ -1,4 +1,4 @@
+-HDRSDIR = $(PREFIX)/share/lib/make
++HDRSDIR ?= $(PREFIX)/share/lib/make
+ 
+ OBJ = ar.o depvar.o dist.o dmake.o doname.o dosys.o files.o globals.o \
+ 	implicit.o macro.o main.o make.o misc.o nse.o nse_printdep.o \
diff --git a/devel/heirloom-devtools/files/patch-make-src-main.cc b/devel/heirloom-devtools/files/patch-make-src-main.cc
new file mode 100644
index 000000000000..a6d67a19b30c
--- /dev/null
+++ b/devel/heirloom-devtools/files/patch-make-src-main.cc
@@ -0,0 +1,12 @@
+--- make/src/main.cc.orig	2023-01-13 17:33:36 UTC
++++ make/src/main.cc
+@@ -128,6 +128,9 @@ extern void job_adjust_fini();
+ /*
+  * typedefs & structs
+  */
++#if defined(__FreeBSD__)
++extern char **environ;
++#endif	/* __FreeBSD__ */
+ 
+ /*
+  * Static variables
diff --git a/devel/heirloom-devtools/files/patch-make-vroot-lock.cc b/devel/heirloom-devtools/files/patch-make-vroot-lock.cc
new file mode 100644
index 000000000000..66ec7e50519c
--- /dev/null
+++ b/devel/heirloom-devtools/files/patch-make-vroot-lock.cc
@@ -0,0 +1,29 @@
+--- make/vroot/lock.cc.orig	2023-01-13 17:29:24 UTC
++++ make/vroot/lock.cc
+@@ -53,7 +53,7 @@ extern	char		*sys_errlist[];
+ extern	int		sys_nerr;
+ #endif
+ 
+-static	void		file_lock_error(char *msg, char *file, char *str, int arg1, int arg2);
++static	void		file_lock_error(char *msg, char *file, char *str, char *arg1, char *arg2);
+ 
+ #define BLOCK_INTERUPTS sigfillset(&newset) ; \
+ 	sigprocmask(SIG_SETMASK, &newset, &oldset)
+@@ -123,7 +123,7 @@ file_lock(char *name, char *lockname, int *file_locked
+ 
+ 		if (errno != EEXIST) {
+ 			file_lock_error(msg, name, NOCATGETS("symlink(%s, %s)"),
+-			    (int) name, (int) lockname);
++			    name, lockname);
+ 			fprintf(stderr, "%s", msg);
+ 			return errno;
+ 		}
+@@ -171,7 +171,7 @@ file_lock(char *name, char *lockname, int *file_locked
+  * Format a message telling why the lock could not be created.
+  */
+ static	void
+-file_lock_error(char *msg, char *file, char *str, int arg1, int arg2)
++file_lock_error(char *msg, char *file, char *str, char *arg1, char *arg2)
+ {
+ 	int		len;
+ 
diff --git a/devel/heirloom-devtools/files/patch-mk.config b/devel/heirloom-devtools/files/patch-mk.config
new file mode 100644
index 000000000000..b772db5f025c
--- /dev/null
+++ b/devel/heirloom-devtools/files/patch-mk.config
@@ -0,0 +1,82 @@
+--- mk.config.orig	2023-01-13 17:03:48 UTC
++++ mk.config
+@@ -17,32 +17,32 @@ POSIX_SHELL = /bin/sh
+ #
+ # A BSD-compatible install command.
+ #
+-INSTALL=/usr/ucb/install
++INSTALL?=/usr/ucb/install
+ 
+ #
+ # Prefix.
+ #
+-PREFIX=/usr/ccs
++PREFIX?=/usr/ccs
+ 
+ #
+ # Where to place binaries.
+ #
+-BINDIR=$(PREFIX)/bin
++BINDIR?=$(PREFIX)/bin
+ 
+ #
+ # Where to place additional binaries that aim at POSIX conformance.
+ #
+-SUSBIN=/usr/5bin/posix
++SUSBIN?=/usr/5bin/posix
+ 
+ #
+ # Where to place libraries.
+ #
+-LIBDIR=$(PREFIX)/lib
++LIBDIR?=$(PREFIX)/lib
+ 
+ #
+ # Where to place manual pages.
+ #
+-MANDIR=$(PREFIX)/share/man
++MANDIR?=$(PREFIX)/share/man
+ 
+ #
+ # Binaries are stripped with this command after installation.
+@@ -52,13 +52,13 @@ STRIP=strip
+ #
+ # C++ compiler.
+ #
+-CXX = c++
++CXX ?= c++
+ 
+ #
+ # Compiler flags.
+ #
+-CFLAGS=-O
+-CXXFLAGS=-O
++CFLAGS?=-O
++CXXFLAGS?=-O
+ 
+ #
+ # C preprocessor flags.
+@@ -66,7 +66,7 @@ CXXFLAGS=-O
+ # Use -D_GNU_SOURCE for Linux with GNU libc.
+ # Use -D_INCLUDE__STDC_A1_SOURCE for HP-UX.
+ #
+-CPPFLAGS=-D_GNU_SOURCE
++CPPFLAGS+=-D_GNU_SOURCE
+ 
+ #
+ # Warning flags for the compiler.
+@@ -76,12 +76,12 @@ WARN=
+ #
+ # Linker flags.
+ #
+-LDFLAGS=
++#LDFLAGS=
+ 
+ #
+ # Additional libraries to link with.
+ #
+-LIBS=
++#LIBS=
+ 
+ #
+ # It may be necessary to define AR on some systems, e.g. on HP-UX.
diff --git a/devel/heirloom-devtools/files/patch-sccs-src-vc.c b/devel/heirloom-devtools/files/patch-sccs-src-vc.c
new file mode 100644
index 000000000000..7accce8fcd5d
--- /dev/null
+++ b/devel/heirloom-devtools/files/patch-sccs-src-vc.c
@@ -0,0 +1,12 @@
+--- sccs/src/vc.c.orig	2023-01-13 17:08:38 UTC
++++ sccs/src/vc.c
+@@ -36,6 +36,9 @@
+  * Sccsid @(#)vc.c	1.4 (gritter) 3/25/07
+  */
+ /*	from OpenSolaris "sccs:cmd/vc.c"	*/
++#if defined(__FreeBSD__)
++# include <limits.h>	/* MB_LEN_MAX */
++#endif /* __FreeBSD__ */
+ # include	<defines.h>
+ # include	<locale.h>
+ 
diff --git a/devel/heirloom-devtools/pkg-descr b/devel/heirloom-devtools/pkg-descr
new file mode 100644
index 000000000000..4019f355543f
--- /dev/null
+++ b/devel/heirloom-devtools/pkg-descr
@@ -0,0 +1,5 @@
+The Heirloom Development Tools package provides yacc, lex, m4, make,
+and SCCS as portable derivatives of the utilities released by Sun
+as part of OpenSolaris.  The OpenSolaris utilities were in turn
+derived from the original Unix versions, and are assumed be conforming
+implementations of the POSIX standard.
diff --git a/devel/heirloom-devtools/pkg-plist b/devel/heirloom-devtools/pkg-plist
new file mode 100644
index 000000000000..7b123ab1de19
--- /dev/null
+++ b/devel/heirloom-devtools/pkg-plist
@@ -0,0 +1,68 @@
+etc/man.d/heirloom-devtools.conf
+heirloom/bin/admin
+heirloom/bin/cdc
+heirloom/bin/comb
+heirloom/bin/delta
+heirloom/bin/get
+heirloom/bin/help
+heirloom/bin/lex
+heirloom/bin/m4
+heirloom/bin/make
+heirloom/bin/posix/m4
+heirloom/bin/posix/make
+heirloom/bin/prs
+heirloom/bin/prt
+heirloom/bin/rmdel
+heirloom/bin/sact
+heirloom/bin/sccs
+heirloom/bin/sccsdiff
+heirloom/bin/unget
+heirloom/bin/val
+heirloom/bin/vc
+heirloom/bin/what
+heirloom/bin/yacc
+heirloom/libexec/help/ad
+heirloom/libexec/help/bd
+heirloom/libexec/help/bu
+heirloom/libexec/help/cb
+heirloom/libexec/help/cm
+heirloom/libexec/help/cmds
+heirloom/libexec/help/co
+heirloom/libexec/help/de
+heirloom/libexec/help/default
+heirloom/libexec/help/ge
+heirloom/libexec/help/he
+heirloom/libexec/help/prs
+heirloom/libexec/help/rc
+heirloom/libexec/help/un
+heirloom/libexec/help/ut
+heirloom/libexec/help/vc
+heirloom/libexec/lex/nceucform
+heirloom/libexec/lex/ncform
+heirloom/libexec/lex/nrform
+heirloom/libexec/libl.a
+heirloom/libexec/liby.a
+heirloom/libexec/svr4.make
+heirloom/libexec/yaccpar
+heirloom/share/lib/make/make.rules
+heirloom/share/lib/make/svr4.make.rules
+heirloom/share/man/man1/admin.1.gz
+heirloom/share/man/man1/cdc.1.gz
+heirloom/share/man/man1/comb.1.gz
+heirloom/share/man/man1/delta.1.gz
+heirloom/share/man/man1/get.1.gz
+heirloom/share/man/man1/help.1.gz
+heirloom/share/man/man1/lex.1.gz
+heirloom/share/man/man1/make.1.gz
+heirloom/share/man/man1/prs.1.gz
+heirloom/share/man/man1/rmdel.1.gz
+heirloom/share/man/man1/sact.1.gz
+heirloom/share/man/man1/sccsdiff.1.gz
+heirloom/share/man/man1/unget.1.gz
+heirloom/share/man/man1/val.1.gz
+heirloom/share/man/man1/vc.1.gz
+heirloom/share/man/man1/what.1.gz
+heirloom/share/man/man1/yacc.1.gz
+heirloom/share/man/man1b/prt.1b.gz
+heirloom/share/man/man1b/sccs.1b.gz
+heirloom/share/man/man5/sccsfile.5.gz