[PATCH 2/3] doc: fix out-of-tree build
authorDavid Bremner <david@tethera.net>
Thu, 20 Mar 2014 00:48:03 +0000 (21:48 +2100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:00:51 +0000 (10:00 -0800)
a6/1d63a939b45d257259b0afa4d165743656ecad [new file with mode: 0644]

diff --git a/a6/1d63a939b45d257259b0afa4d165743656ecad b/a6/1d63a939b45d257259b0afa4d165743656ecad
new file mode 100644 (file)
index 0000000..4818d48
--- /dev/null
@@ -0,0 +1,143 @@
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 667A7431FD0\r
+       for <notmuch@notmuchmail.org>; Wed, 19 Mar 2014 17:48:42 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id jTV+IiAmzJ2f for <notmuch@notmuchmail.org>;\r
+       Wed, 19 Mar 2014 17:48:35 -0700 (PDT)\r
+Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
+       (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 541B9431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 19 Mar 2014 17:48:26 -0700 (PDT)\r
+Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
+       (envelope-from <bremner@tethera.net>)\r
+       id 1WQR9l-0000Ht-St; Wed, 19 Mar 2014 21:48:25 -0300\r
+Received: (nullmailer pid 22553 invoked by uid 1000); Thu, 20 Mar 2014\r
+       00:48:11 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/3] doc: fix out-of-tree build\r
+Date: Wed, 19 Mar 2014 21:48:03 -0300\r
+Message-Id: <1395276484-22363-3-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 1.9.0\r
+In-Reply-To: <1395276484-22363-1-git-send-email-david@tethera.net>\r
+References: <1395276484-22363-1-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 20 Mar 2014 00:48:42 -0000\r
+\r
+The subtle part is adding .rst and .py files to vpath so they can be\r
+used as dependencies without prefixing with $(srcdir)\r
+\r
+We also change the interface to mkbuildeps.py: rather than getting the\r
+containing directory from the conf file path, we go the other way.\r
+---\r
+ configure          |  3 ++-\r
+ doc/Makefile.local | 12 ++++++------\r
+ doc/mkdocdeps.py   |  7 ++++---\r
+ 3 files changed, 12 insertions(+), 10 deletions(-)\r
+\r
+diff --git a/configure b/configure\r
+index b3b1b44..bc61ad1 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -713,8 +713,9 @@ configure_options = $@\r
+ # files, (which is quite ugly).\r
+ vpath %.c \$(srcdir)\r
+ vpath %.cc \$(srcdir)\r
+-vpath %.1 \$(srcdir)\r
+ vpath Makefile.% \$(srcdir)\r
++vpath %.py \$(srcdir)\r
++vpath %.rst \$(srcdir)\r
\r
+ # The C compiler to use\r
+ CC = ${CC}\r
+diff --git a/doc/Makefile.local b/doc/Makefile.local\r
+index 9c31c24..0980c71 100644\r
+--- a/doc/Makefile.local\r
++++ b/doc/Makefile.local\r
+@@ -3,15 +3,15 @@\r
+ dir := doc\r
\r
+ # You can set these variables from the command line.\r
+-SPHINXOPTS    := -q -c $(dir)\r
++SPHINXOPTS    := -q\r
+ SPHINXBUILD   = sphinx-build\r
+ DOCBUILDDIR      := $(dir)/_build\r
\r
+-prerst2man := python $(dir)/prerst2man.py\r
+-mkdocdeps := python $(dir)/mkdocdeps.py\r
++prerst2man := python $(srcdir)/$(dir)/prerst2man.py\r
++mkdocdeps := python $(srcdir)/$(dir)/mkdocdeps.py\r
\r
+ # Internal variables.\r
+-ALLSPHINXOPTS   := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(dir)\r
++ALLSPHINXOPTS   := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(srcdir)/$(dir)\r
\r
+ .PHONY: sphinx-html sphinx-texinfo sphinx-info\r
\r
+@@ -43,7 +43,7 @@ ifeq ($(HAVE_SPHINX),1)\r
+           mv $(DOCBUILDDIR)/man/*.$${section} $(DOCBUILDDIR)/man/man$${section}; \\r
+       done\r
+ else ifeq ($(HAVE_RST2MAN),1)\r
+-      $(prerst2man) $(DOCBUILDDIR)/.. $(DOCBUILDDIR)/man\r
++      $(prerst2man) $(srcdir)/doc $(DOCBUILDDIR)/man\r
+ else\r
+       @echo "Fatal: build dependency fail."\r
+       @false\r
+@@ -68,7 +68,7 @@ install-man: ${MAN_GZIP_FILES}\r
+ endif\r
\r
+ $(dir)/docdeps.mk: $(dir)/conf.py $(dir)/mkdocdeps.py\r
+-      $(mkdocdeps) $< $(DOCBUILDDIR) $@\r
++      $(mkdocdeps) $(srcdir)/doc $(DOCBUILDDIR) $@\r
\r
+ CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk $(dir)/man.stamp\r
+ CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES)\r
+diff --git a/doc/mkdocdeps.py b/doc/mkdocdeps.py\r
+index 3effdd8..71bd135 100644\r
+--- a/doc/mkdocdeps.py\r
++++ b/doc/mkdocdeps.py\r
+@@ -1,15 +1,16 @@\r
+ from sys import argv\r
+-conffile = argv[1]\r
++srcdir = argv[1]\r
+ builddir = argv[2]\r
+ outfile = argv[3]\r
\r
+-execfile(conffile)\r
++execfile(srcdir + '/conf.py')\r
++\r
\r
+ roff_files = []\r
+ rst_files = []\r
+ out=open(outfile,'w')\r
+ for page in man_pages:\r
+-    rst_files = rst_files + ["doc/{0:s}.rst".format(page[0])]\r
++    rst_files = rst_files + ["{0:s}/{1:s}.rst".format(srcdir,page[0])]\r
+     roff_files = roff_files + ["{0:s}/man/{1:s}.{2:d}".format(builddir,page[0],page[4])]\r
\r
+ out.write ('MAN_ROFF_FILES := ' + ' \\\n\t'.join(roff_files)+'\n')\r
+-- \r
+1.9.0\r
+\r