git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How to build manpages on OS X

From
Steven Grimm <koreth@midwinter.com>
Date
Dec 28, 2006, 23:32 UTC
Message-ID
<459453F8.1010200@midwinter.com>
Didn't see this documented anywhere, so...

If you want to do a full build of git on OS X including the manpages, you need the asciidoc and xmlto packages. Both of them are available from macports.org (formerly known as DarwinPorts) but out of the box, they don't work quite right. If you try doing a "make doc", you get the following error from xmlto:

I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl

The superficial reason for that error is that xmlto is calling the xsltproc utility with a command-line option that tells it to not fetch documents from the network. If you edit xmlto and remove that option, the doc build will work, but it will have to fetch a bunch of files from SourceForge for every manpage, which is dog slow.

The real solution is to use local copies of the files it's trying to fetch. These files are installed as part of one of the dependencies when you install xmlto, but the install process doesn't tell the system where to look for them! To use these local copies, you need to do two things.

First, create an XML catalog file. Typically it's called catalog.xml. The contents should be:

<?xml version='1.0'?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<rewriteURI 
uriStartString="http://docbook.sourceforge.net/release/xsl/current/"
        rewritePrefix="file:///opt/local/share/xsl/docbook-xsl/" />
<rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.2/"
        rewritePrefix="file:///opt/local/share/xml/docbook-xml/4.3/" />
</catalog>

Yes, that second rewriteURI maps the 4.2 docbook URI to the 4.3 version -- blame the MacPorts packages, because that's what gets installed. The mismatch doesn't appear to hurt anything. (If you're reading this from the mailing list archive, MacPorts might have updated the packages since I wrote this, so adjust the paths accordingly.)

Now you need to tell the system to use the file. You do that using the XML_CATALOG_FILES environment variable, like so:

$ export XML_CATALOG_FILES=`pwd`/catalog.xml $ make prefix=/opt/local doc $ sudo make prefix=/opt/local install-doc

Annoying that it doesn't just work, but hopefully this will save someone some Googling around.

-Steve
Next: Junio C Hamano
Message 1 of 3 in “How to build manpages on OS X”
  1. Steven GrimmDec 28, 2006
  2. Junio C HamanoDec 29, 2006
  3. Randal L. SchwartzDec 29, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.