Skip to content

Instantly share code, notes, and snippets.

@spchamp
Created November 8, 2018 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spchamp/fc34b65f884a64d548607c98751095d8 to your computer and use it in GitHub Desktop.
Save spchamp/fc34b65f884a64d548607c98751095d8 to your computer and use it in GitHub Desktop.
mk/docbook2x.buildlink3.mk - provides ports e.g textproc/expat with build configuration for docbook2X or xmlto
# $NetBSD$
#
# This Makefile fragment is meant to be included by ports that require
# a docbook2X implementation during build
#
# === Variables set by this file ===
#
# DOCBOOK2X_TYPE
# The name of the selected docbook2X implementation.
# One of: docbook2X, docbook2x, xmlto
.include "bsd.fast.prefs.mk"
DOCBOOK2X_TYPE?= xmlto
## distpatch on DOCBOOK2X_TYPE to set 'configure' environment variable DOCBOOK_TO_MAN
.if !empty(DOCBOOK2X_TYPE:Mxmlto)
CONFIGURE_ENV+= DOCBOOK_TO_MAN="xmlto man --skip-validation"
BUILD_DEPENDS+= xmlto:../../textproc/xmlto
.elif !empty(DOCBOOK2X_TYPE:Mdocbook2[Xx])
CONFIGURE_ENV+= DOCBOOK_TO_MAN="docbook2man"
BUILD_DEPENDS+= docbook2X:../../wip/docbook2X
.else
PKG_FAIL_REASON +="Unrecognized DOCBOOK2X_TYPE ${DOCBOOK2X_TYPE}"
.endif
@spchamp
Copy link
Author

spchamp commented Nov 8, 2018

This is a mk-files fragment for pkgsrc buildlink, offered here as a contribution for pkgsrc-wip

[Indemnification Clause Here]

I'm testing this at present, in a build of the wip/docbook2X and textproc/expat ports (Ubuntu 18.04 armel GCC-7).

I'll be testing the xmlto case, first. I should be able to test the docbook2X case, shortly

@spchamp
Copy link
Author

spchamp commented Nov 8, 2018

The xmlto case appears to result in appropriate formatting for the generated documentation, e.g xmlwf(1) as generated during the textproc/expat build

Once the docbook2X build completes, will be able to test for the DOCBOOK2X_TYPE=docbook2X build-configuration case, also, with a rebuild of textproc/expat locally patched for this buildlink addition and thusly configured

@spchamp
Copy link
Author

spchamp commented Nov 9, 2018

I've tested this now, for the docbook2X configuration case. The xmlwf(1) manual page is presented in a manner as equivalent to the xmlto (default) configuration.

Will add this change to a local branch onto pkgsrc, along with a patched Makefile for textproc/expat such that makes use of the additional buildlink resource, contributed here.

@spchamp
Copy link
Author

spchamp commented Nov 9, 2018

Along with an addition of this mk-files fragment, the pkgsrc Makefile textproc/expat/Makefile may patched correspondingly, such that last two lines in the file will read as follows:

.include "../../mk/docbook2X.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment