Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / 29 / b1a5cbc266cf31f5c3a719571def6ba7e305e2
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 40739431FBC\r
6         for <notmuch@notmuchmail.org>; Tue,  8 Jul 2014 16:57:48 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\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 8mq5vpjXKcBG for <notmuch@notmuchmail.org>;\r
16         Tue,  8 Jul 2014 16:57:43 -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 D1A15431FD6\r
21         for <notmuch@notmuchmail.org>; Tue,  8 Jul 2014 16:57:31 -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 1X4fGN-0005bH-Ev; Tue, 08 Jul 2014 20:57:31 -0300\r
25 Received: (nullmailer pid 3527 invoked by uid 1000); Tue, 08 Jul 2014\r
26         23:57:16 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: notmuch@notmuchmail.org\r
29 Subject: [Patch v4 1/3] doc: build and install doxygen api docs\r
30 Date: Tue,  8 Jul 2014 20:57:07 -0300\r
31 Message-Id: <1404863829-3343-2-git-send-email-david@tethera.net>\r
32 X-Mailer: git-send-email 2.0.0.rc2\r
33 In-Reply-To: <1404863829-3343-1-git-send-email-david@tethera.net>\r
34 References: <1404657994-30628-4-git-send-email-david@tethera.net>\r
35         <1404863829-3343-1-git-send-email-david@tethera.net>\r
36 X-BeenThere: notmuch@notmuchmail.org\r
37 X-Mailman-Version: 2.1.13\r
38 Precedence: list\r
39 List-Id: "Use and development of the notmuch mail system."\r
40         <notmuch.notmuchmail.org>\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
44 List-Post: <mailto:notmuch@notmuchmail.org>\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
48 X-List-Received-Date: Tue, 08 Jul 2014 23:57:48 -0000\r
49 \r
50 In order to support out of tree builds, generate `doc/config.dox` from\r
51 configure.\r
52 \r
53 In order to avoid hardcoding version in doxygen.cfg, generate\r
54 doc/version.dox at build time.\r
55 ---\r
56  configure          | 12 ++++++++++++\r
57  doc/Makefile.local | 27 +++++++++++++++++++++++++--\r
58  doc/doxygen.cfg    |  5 ++---\r
59  3 files changed, 39 insertions(+), 5 deletions(-)\r
60 \r
61 diff --git a/configure b/configure\r
62 index 9514d4d..fa44188 100755\r
63 --- a/configure\r
64 +++ b/configure\r
65 @@ -417,6 +417,15 @@ else\r
66      have_emacs=0\r
67  fi\r
68  \r
69 +printf "Checking if doxygen is available... "\r
70 +if doxygen -v > /dev/null 2>&1; then\r
71 +    printf "Yes.\n"\r
72 +    have_doxygen=1\r
73 +else\r
74 +    printf "No (so will not install api docs)\n"\r
75 +    have_doxygen=0\r
76 +fi\r
77 +\r
78  printf "Checking if sphinx is available and supports nroff output... "\r
79  if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev/null 2>&1 ; then\r
80      printf "Yes.\n"\r
81 @@ -829,6 +838,9 @@ HAVE_SPHINX=${have_sphinx}\r
82  # Whether there's a rst2man binary available for building documentation\r
83  HAVE_RST2MAN=${have_rst2man}\r
84  \r
85 +# Whether there's a doxygen binary available for building api documentation\r
86 +HAVE_DOXYGEN=${have_doxygen}\r
87 +\r
88  # The directory to which desktop files should be installed\r
89  desktop_dir = \$(prefix)/share/applications\r
90  \r
91 diff --git a/doc/Makefile.local b/doc/Makefile.local\r
92 index bbd4610..72b8f68 100644\r
93 --- a/doc/Makefile.local\r
94 +++ b/doc/Makefile.local\r
95 @@ -12,10 +12,12 @@ mkdocdeps := python $(srcdir)/$(dir)/mkdocdeps.py\r
96  \r
97  # Internal variables.\r
98  ALLSPHINXOPTS   := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(srcdir)/$(dir)\r
99 +APIMAN         := $(DOCBUILDDIR)/man/man3/notmuch.3\r
100 +DOXYFILE       := $(srcdir)/$(dir)/doxygen.cfg\r
101  \r
102  .PHONY: sphinx-html sphinx-texinfo sphinx-info\r
103  \r
104 -.PHONY: install-man build-man\r
105 +.PHONY: install-man build-man apidocs install-apidocs\r
106  \r
107  %.gz: %\r
108         rm -f $@ && gzip --stdout $^ > $@\r
109 @@ -56,6 +58,23 @@ else\r
110  endif\r
111         touch ${MAN_ROFF_FILES} $@\r
112  \r
113 +install-man: install-apidocs\r
114 +\r
115 +ifeq ($(HAVE_DOXYGEN),1)\r
116 +MAN_GZIP_FILES += ${APIMAN}.gz\r
117 +apidocs: $(APIMAN)\r
118 +install-apidocs: apidocs\r
119 +       mkdir -p "$(DESTDIR)$(mandir)/man3"\r
120 +       install -m0644  $(DOCBUILDDIR)/man/man3/*.3.gz  $(DESTDIR)/$(mandir)/man3\r
121 +\r
122 +$(APIMAN): $(dir)/config.dox $(srcdir)/$(dir)/doxygen.cfg $(srcdir)/lib/notmuch.h\r
123 +       mkdir -p $(DOCBUILDDIR)/man/man3\r
124 +       doxygen $(DOXYFILE)\r
125 +else\r
126 +apidocs:\r
127 +install-apidocs:\r
128 +endif\r
129 +\r
130  # Do not try to build or install man pages if a man page converter is\r
131  # not available.\r
132  ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00)\r
133 @@ -74,8 +93,12 @@ install-man: ${MAN_GZIP_FILES}\r
134         cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz\r
135  endif\r
136  \r
137 +$(dir)/config.dox: version.stamp\r
138 +       echo "PROJECT_NAME = \"Notmuch $(VERSION)\"" > $@\r
139 +       echo "INPUT=${srcdir}/lib/notmuch.h" >> $@\r
140 +\r
141  $(dir)/docdeps.mk: $(dir)/conf.py $(dir)/mkdocdeps.py\r
142         $(mkdocdeps) $(srcdir)/doc $(DOCBUILDDIR) $@\r
143  \r
144  CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk $(DOCBUILDDIR)/.roff.stamp\r
145 -CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES) $(dir)/conf.pyc\r
146 +CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES) $(dir)/conf.pyc $(dir)/config.dox\r
147 diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg\r
148 index bfbfcab..1a53af5 100644\r
149 --- a/doc/doxygen.cfg\r
150 +++ b/doc/doxygen.cfg\r
151 @@ -4,11 +4,11 @@\r
152  # Project related configuration options\r
153  #---------------------------------------------------------------------------\r
154  DOXYFILE_ENCODING      = UTF-8\r
155 -PROJECT_NAME           = "Notmuch 0.18"\r
156 +@INCLUDE              =  "doc/config.dox"\r
157  PROJECT_NUMBER         =\r
158  PROJECT_BRIEF          =\r
159  PROJECT_LOGO           =\r
160 -OUTPUT_DIRECTORY       =\r
161 +OUTPUT_DIRECTORY       = doc/_build\r
162  CREATE_SUBDIRS         = NO\r
163  OUTPUT_LANGUAGE        = English\r
164  BRIEF_MEMBER_DESC      = YES\r
165 @@ -96,7 +96,6 @@ WARN_LOGFILE           =\r
166  #---------------------------------------------------------------------------\r
167  # configuration options related to the input files\r
168  #---------------------------------------------------------------------------\r
169 -INPUT                  = lib/notmuch.h\r
170  INPUT_ENCODING         = UTF-8\r
171  FILE_PATTERNS          =\r
172  RECURSIVE              = NO\r
173 -- \r
174 2.0.0.rc2\r
175 \r