git: bddac0b8ed12 - main - textproc/chpp: Optional USES=makeinfo

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Fri, 20 Oct 2023 21:04:47 UTC
The branch main has been updated by bofh:

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

commit bddac0b8ed12cfbfff61091854c7f47c28ec5b30
Author:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
AuthorDate: 2023-10-20 16:24:39 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-10-20 21:04:38 +0000

    textproc/chpp:  Optional USES=makeinfo
    
    - Utilize USES=makeinfo only when used specially for DOCS only in this
      case.
    - Utilize USES=localbase
    - Pet portclippy
---
 textproc/chpp/Makefile | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/textproc/chpp/Makefile b/textproc/chpp/Makefile
index 3213bb83d7ee..e7fddac0355b 100644
--- a/textproc/chpp/Makefile
+++ b/textproc/chpp/Makefile
@@ -15,17 +15,16 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 LIB_DEPENDS=	libgc.so:devel/boehm-gc \
 		libgnuregex.so.6:devel/libgnuregex
 
-USES=		autoreconf gmake makeinfo
+USES=		autoreconf gmake localbase:ldflags
+
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--libdir=${PREFIX}/share
 
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib
-
-INFO=		chpp
-
 OPTIONS_DEFINE=	DOCS EXAMPLES
 
+DOCS_USES=	makeinfo
+DOCS_INFO=		chpp
+
 .include <bsd.port.pre.mk>
 
 post-extract:
@@ -39,11 +38,15 @@ post-patch:
 		 s| regex.c regex.h | | ; \
 		 /LDADD/s| gc/gc.a | -lgc -lgnuregex | ; \
 		 s|^YFLAGS|AM_YFLAGS|' ${WRKSRC}/Makefile.am
-.for i in arrayops.c builtins.c stringops.c
+.for i in arrayops.c stringops.c
 	@${REINPLACE_CMD} -e \
 		's|"../regex.h"|<gnu/regex.h>|' ${WRKSRC}/builtins/${i}
 .endfor
 
+post-patch-DOCS-off:
+	@${REINPLACE_CMD} -e \
+		'/SUBDIRS/s|doc||' ${WRKSRC}/Makefile.am
+
 post-install-DOCS-on:
 	@${MKDIR} ${STAGEDIR}${DOCSDIR}
 .for filename in AUTHORS NEWS README