1 Return-Path: <bremner@tesseract.cs.unb.ca>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 6BF4E431FBD
\r
6 for <notmuch@notmuchmail.org>; Sun, 6 Jul 2014 10:54:01 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id Cr7pqOv-4tQm for <notmuch@notmuchmail.org>;
\r
16 Sun, 6 Jul 2014 10:53:55 -0700 (PDT)
\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])
\r
18 (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 3CEFE431FAF
\r
21 for <notmuch@notmuchmail.org>; Sun, 6 Jul 2014 10:53:46 -0700 (PDT)
\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)
\r
23 (envelope-from <bremner@tesseract.cs.unb.ca>)
\r
24 id 1X3qd8-0001Hd-Ep; Sun, 06 Jul 2014 14:53:38 -0300
\r
25 Received: (nullmailer pid 30894 invoked by uid 1000); Sun, 06 Jul 2014
\r
27 From: David Bremner <david@tethera.net>
\r
28 To: notmuch@notmuchmail.org
\r
29 Subject: [Patch v3 1/3] doc: build and install doxygen api docs
\r
30 Date: Sun, 6 Jul 2014 11:46:32 -0300
\r
31 Message-Id: <1404657994-30628-2-git-send-email-david@tethera.net>
\r
32 X-Mailer: git-send-email 2.0.0.rc2
\r
33 In-Reply-To: <1404657994-30628-1-git-send-email-david@tethera.net>
\r
34 References: <1404657994-30628-1-git-send-email-david@tethera.net>
\r
35 X-BeenThere: notmuch@notmuchmail.org
\r
36 X-Mailman-Version: 2.1.13
\r
38 List-Id: "Use and development of the notmuch mail system."
\r
39 <notmuch.notmuchmail.org>
\r
40 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
43 List-Post: <mailto:notmuch@notmuchmail.org>
\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
45 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
47 X-List-Received-Date: Sun, 06 Jul 2014 17:54:01 -0000
\r
49 In order to support out of tree builds, generate `doc/config.dox` from
\r
52 In order to avoid hardcoding version in doxygen.cfg, generate
\r
53 doc/version.dox at build time.
\r
55 configure | 18 ++++++++++++++++++
\r
56 doc/Makefile.local | 26 ++++++++++++++++++++++++--
\r
57 doc/doxygen.cfg | 6 +++---
\r
58 3 files changed, 45 insertions(+), 5 deletions(-)
\r
60 diff --git a/configure b/configure
\r
61 index 9514d4d..ec3a895 100755
\r
64 @@ -417,6 +417,15 @@ else
\r
68 +printf "Checking if doxygen is available... "
\r
69 +if doxygen -v > /dev/null 2>&1; then
\r
73 + printf "No (so will not install api docs)\n"
\r
77 printf "Checking if sphinx is available and supports nroff output... "
\r
78 if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev/null 2>&1 ; then
\r
80 @@ -725,6 +734,12 @@ commands to compile and install notmuch:
\r
84 +# construct the Doxygen file list
\r
85 +cat > doc/config.dox <<EOF
\r
86 +# This doxgen config snippet generated by ../configure
\r
87 +INPUT=${srcdir}/lib/notmuch.h
\r
90 # construct the Makefile.config
\r
91 cat > Makefile.config <<EOF
\r
92 # This Makefile.config was automatically generated by the ./configure
\r
93 @@ -829,6 +844,9 @@ HAVE_SPHINX=${have_sphinx}
\r
94 # Whether there's a rst2man binary available for building documentation
\r
95 HAVE_RST2MAN=${have_rst2man}
\r
97 +# Whether there's a doxygen binary available for building api documentation
\r
98 +HAVE_DOXYGEN=${have_doxygen}
\r
100 # The directory to which desktop files should be installed
\r
101 desktop_dir = \$(prefix)/share/applications
\r
103 diff --git a/doc/Makefile.local b/doc/Makefile.local
\r
104 index bbd4610..618b840 100644
\r
105 --- a/doc/Makefile.local
\r
106 +++ b/doc/Makefile.local
\r
107 @@ -12,10 +12,12 @@ mkdocdeps := python $(srcdir)/$(dir)/mkdocdeps.py
\r
109 # Internal variables.
\r
110 ALLSPHINXOPTS := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(srcdir)/$(dir)
\r
111 +APIMAN := $(DOCBUILDDIR)/man/man3/notmuch.3
\r
112 +DOXYFILE := $(srcdir)/$(dir)/doxygen.cfg
\r
114 .PHONY: sphinx-html sphinx-texinfo sphinx-info
\r
116 -.PHONY: install-man build-man
\r
117 +.PHONY: install-man build-man apidocs install-apidocs
\r
120 rm -f $@ && gzip --stdout $^ > $@
\r
121 @@ -56,6 +58,23 @@ else
\r
123 touch ${MAN_ROFF_FILES} $@
\r
125 +install-man: install-apidocs
\r
127 +ifeq ($(HAVE_DOXYGEN),1)
\r
128 +MAN_GZIP_FILES += ${APIMAN}.gz
\r
129 +apidocs: $(APIMAN)
\r
130 +install-apidocs: apidocs
\r
131 + mkdir -p "$(DESTDIR)$(mandir)/man3"
\r
132 + install -m0644 $(DOCBUILDDIR)/man/man3/*.3.gz $(DESTDIR)/$(mandir)/man3
\r
134 +$(APIMAN): $(dir)/version.dox $(srcdir)/$(dir)/doxygen.cfg $(srcdir)/lib/notmuch.h
\r
135 + mkdir -p $(DOCBUILDDIR)/man/man3
\r
136 + doxygen $(DOXYFILE)
\r
142 # Do not try to build or install man pages if a man page converter is
\r
144 ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00)
\r
145 @@ -74,8 +93,11 @@ install-man: ${MAN_GZIP_FILES}
\r
146 cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz
\r
149 +$(dir)/version.dox: version.stamp
\r
150 + echo "PROJECT_NAME = \"Notmuch $(VERSION)\"" > $@
\r
152 $(dir)/docdeps.mk: $(dir)/conf.py $(dir)/mkdocdeps.py
\r
153 $(mkdocdeps) $(srcdir)/doc $(DOCBUILDDIR) $@
\r
155 CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk $(DOCBUILDDIR)/.roff.stamp
\r
156 -CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES) $(dir)/conf.pyc
\r
157 +CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES) $(dir)/conf.pyc $(dir)/version.dox $(dir)/config.dox
\r
158 diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg
\r
159 index bfbfcab..68e8969 100644
\r
160 --- a/doc/doxygen.cfg
\r
161 +++ b/doc/doxygen.cfg
\r
163 # Project related configuration options
\r
164 #---------------------------------------------------------------------------
\r
165 DOXYFILE_ENCODING = UTF-8
\r
166 -PROJECT_NAME = "Notmuch 0.18"
\r
167 +@INCLUDE = "doc/version.dox"
\r
171 -OUTPUT_DIRECTORY =
\r
172 +OUTPUT_DIRECTORY = doc/_build
\r
173 CREATE_SUBDIRS = NO
\r
174 OUTPUT_LANGUAGE = English
\r
175 BRIEF_MEMBER_DESC = YES
\r
176 @@ -96,7 +96,7 @@ WARN_LOGFILE =
\r
177 #---------------------------------------------------------------------------
\r
178 # configuration options related to the input files
\r
179 #---------------------------------------------------------------------------
\r
180 -INPUT = lib/notmuch.h
\r
181 +@INCLUDE = doc/config.dox
\r
182 INPUT_ENCODING = UTF-8
\r