Skip to content

Instantly share code, notes, and snippets.

@spchamp
Created November 8, 2018 23:14
Show Gist options
  • Select an option

  • Save spchamp/fc34b65f884a64d548607c98751095d8 to your computer and use it in GitHub Desktop.

Select an option

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

spchamp commented Nov 8, 2018

Copy link
Copy Markdown
Author

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

spchamp commented Nov 8, 2018

Copy link
Copy Markdown
Author

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

spchamp commented Nov 9, 2018

Copy link
Copy Markdown
Author

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

spchamp commented Nov 9, 2018

Copy link
Copy Markdown
Author

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