pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

textproc/groff-pdfmark. Updated Makefile to set the default "groff" in the "pdfroff" shell script. "make" will also now build "pdfroff" rather than just copying from the distribution.



Module Name:	pkgsrc-wip
Committed By:	Louis Guillaume <louis%zabrico.com@localhost>
Pushed By:	louis
Date:		Fri Nov 13 17:39:12 2026 -0500
Changeset:	ff6fabdeeffd4f29dd0ce810dd7bf7f2099eb73c

Modified Files:
	groff-pdfmark/Makefile

Log Message:
textproc/groff-pdfmark. Updated Makefile to set the default "groff" in
the "pdfroff" shell script. "make" will also now build "pdfroff" rather
than just copying from the distribution.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=ff6fabdeeffd4f29dd0ce810dd7bf7f2099eb73c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 groff-pdfmark/Makefile | 59 +++++++++++++++++++++++++++++++++-----------------
 1 file changed, 39 insertions(+), 20 deletions(-)

diffs:
diff --git a/groff-pdfmark/Makefile b/groff-pdfmark/Makefile
index cca8ced3e5..4299ddc9d5 100644
--- a/groff-pdfmark/Makefile
+++ b/groff-pdfmark/Makefile
@@ -13,31 +13,28 @@ LICENSE=	gnu-gpl-v3
 
 WRKSRC=		${WRKDIR}/groff-pdfmark-26.10
 
-USE_TOOLS+=	sed
-NO_CONFIGURE=	yes
+GNU_CONFIGURE=	yes
+USE_TOOLS+=	gmake sed
+
+# Upstream's Makefile is mostly for release tarballs.
+# We only need it to generate a proper pdfroff script.
+BUILD_TARGET=	pdfroff-posix
 
 # Runtime requirements
 DEPENDS+=	groff-[0-9]*:../../textproc/groff
 DEPENDS+=	ghostscript-[0-9]*:../../print/ghostscript
 
-# All man pages shipped by the independent project
-MAN1=		pdfroff.1
-MAN7=		pdfroff.7 \
-		groff_pdfmark.7 \
-		groff_pdfhref.7 \
-		groff_pdfnote.7 \
-		groff_mspdf.7 \
-		groff_omit.7 \
-		groff_opmode.7 \
-		groff_sanitize.7 \
-		groff_toc.7
-
 # Macro packages to site-tmac only
 TMAC_FILES=	pdfmark.tmac spdf.tmac omit.tmac opmode.tmac \
 		sanitize.tmac pdfroff.tmac strcase.tmac newpage.tmac \
 		float.tmac redirect.tmac appendix.tmac anpdf.tmac \
 		toc-base.tmac toc-class.tmac spdf-toc.tmac fdl-setup.tmac
 
+MAN1=	pdfroff.1
+MAN7=	pdfroff.7 groff_pdfmark.7 groff_pdfhref.7 groff_pdfnote.7 \
+	groff_mspdf.7 groff_omit.7 groff_opmode.7 groff_sanitize.7 \
+	groff_toc.7
+
 INSTALLATION_DIRS=	bin \
 			${PKGMANDIR}/man1 ${PKGMANDIR}/man7 \
 			share/groff/site-tmac \
@@ -45,8 +42,30 @@ INSTALLATION_DIRS=	bin \
 			share/examples/groff-pdfmark/artwork \
 			share/doc/groff-pdfmark
 
-# Generate man pages the same way the old groff build did:
+# Set a default GROFF_BIN_PATH to use pkgsrc groff, but make it so
+# that users can still override the GROFF_BIN_PATH or GROFF_BIN_DIR
+# variable at runtime.
+
+SUBST_CLASSES+=		groffbin
+SUBST_STAGE.groffbin=	post-build
+SUBST_FILES.groffbin=	${BUILD_TARGET}
+
+# Place default groff path expression before the
+# first non-comment line in "pdfroff"
+
+SUBST_FILTER_CMD.groffbin= \
+  ${AWK} '!inserted && /^[^\#]/ \
+    {\
+      print "\# Use the groff installed in ${PREFIX} when GROFF_BIN_PATH is not set.";\
+      print "\# Users may still override with GROFF_BIN_DIR or GROFF_BIN_PATH.";\
+      print "\n  : $${GROFF_BIN_PATH:=${PREFIX}/bin}\n";\
+      inserted=1;\
+    }\
+    { print }'
+
+# Build only the POSIX pdfroff script
 do-build:
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${BUILD_TARGET}
 .for f in ${MAN1} ${MAN7}
 	${SED} \
 	    -e 's|@MAN1EXT@|1|g' \
@@ -61,19 +80,19 @@ do-build:
 	    -e '/@ENUMERATE_MR_REFERENCES@/d' \
 	    ${WRKSRC}/man/${f}.man > ${WRKDIR}/${f}
 .endfor
-	# pdfroff script - update the version
-	${SED} -e 's|@VERSION@|${PKGVERSION}|g' \
-	    ${WRKSRC}/pdfroff.sh > ${WRKDIR}/pdfroff
-	${CHMOD} +x ${WRKDIR}/pdfroff
 
 do-install:
-	${INSTALL_SCRIPT} ${WRKDIR}/pdfroff ${DESTDIR}${PREFIX}/bin/pdfroff
+	# Generated driver (upstream builds it as pdfroff-posix)
+	${INSTALL_SCRIPT} ${WRKSRC}/pdfroff-posix \
+		${DESTDIR}${PREFIX}/bin/pdfroff
 
+# Macros
 .for f in ${TMAC_FILES}
 	${INSTALL_DATA} ${WRKSRC}/tmac/${f} \
 		${DESTDIR}${PREFIX}/share/groff/site-tmac/
 .endfor
 
+# Man pages
 .for f in ${MAN1}
 	${INSTALL_MAN} ${WRKDIR}/${f} ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/${f}
 .endfor


Home | Main Index | Thread Index | Old Index