From fab075cd5ad1d38fd12692f17ca5dd7ca26aa3c3 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 9 Jul 2014 20:57:07 +2100 Subject: [PATCH] [Patch v4 1/3] doc: build and install doxygen api docs --- 29/b1a5cbc266cf31f5c3a719571def6ba7e305e2 | 175 ++++++++++++++++++++++ 1 file changed, 175 insertions(+) create mode 100644 29/b1a5cbc266cf31f5c3a719571def6ba7e305e2 diff --git a/29/b1a5cbc266cf31f5c3a719571def6ba7e305e2 b/29/b1a5cbc266cf31f5c3a719571def6ba7e305e2 new file mode 100644 index 000000000..8f4ae06c1 --- /dev/null +++ b/29/b1a5cbc266cf31f5c3a719571def6ba7e305e2 @@ -0,0 +1,175 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 40739431FBC + for ; Tue, 8 Jul 2014 16:57:48 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 8mq5vpjXKcBG for ; + Tue, 8 Jul 2014 16:57:43 -0700 (PDT) +Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id D1A15431FD6 + for ; Tue, 8 Jul 2014 16:57:31 -0700 (PDT) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1X4fGN-0005bH-Ev; Tue, 08 Jul 2014 20:57:31 -0300 +Received: (nullmailer pid 3527 invoked by uid 1000); Tue, 08 Jul 2014 + 23:57:16 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [Patch v4 1/3] doc: build and install doxygen api docs +Date: Tue, 8 Jul 2014 20:57:07 -0300 +Message-Id: <1404863829-3343-2-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.0.0.rc2 +In-Reply-To: <1404863829-3343-1-git-send-email-david@tethera.net> +References: <1404657994-30628-4-git-send-email-david@tethera.net> + <1404863829-3343-1-git-send-email-david@tethera.net> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 08 Jul 2014 23:57:48 -0000 + +In order to support out of tree builds, generate `doc/config.dox` from +configure. + +In order to avoid hardcoding version in doxygen.cfg, generate +doc/version.dox at build time. +--- + configure | 12 ++++++++++++ + doc/Makefile.local | 27 +++++++++++++++++++++++++-- + doc/doxygen.cfg | 5 ++--- + 3 files changed, 39 insertions(+), 5 deletions(-) + +diff --git a/configure b/configure +index 9514d4d..fa44188 100755 +--- a/configure ++++ b/configure +@@ -417,6 +417,15 @@ else + have_emacs=0 + fi + ++printf "Checking if doxygen is available... " ++if doxygen -v > /dev/null 2>&1; then ++ printf "Yes.\n" ++ have_doxygen=1 ++else ++ printf "No (so will not install api docs)\n" ++ have_doxygen=0 ++fi ++ + printf "Checking if sphinx is available and supports nroff output... " + if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev/null 2>&1 ; then + printf "Yes.\n" +@@ -829,6 +838,9 @@ HAVE_SPHINX=${have_sphinx} + # Whether there's a rst2man binary available for building documentation + HAVE_RST2MAN=${have_rst2man} + ++# Whether there's a doxygen binary available for building api documentation ++HAVE_DOXYGEN=${have_doxygen} ++ + # The directory to which desktop files should be installed + desktop_dir = \$(prefix)/share/applications + +diff --git a/doc/Makefile.local b/doc/Makefile.local +index bbd4610..72b8f68 100644 +--- a/doc/Makefile.local ++++ b/doc/Makefile.local +@@ -12,10 +12,12 @@ mkdocdeps := python $(srcdir)/$(dir)/mkdocdeps.py + + # Internal variables. + ALLSPHINXOPTS := -d $(DOCBUILDDIR)/doctrees $(SPHINXOPTS) $(srcdir)/$(dir) ++APIMAN := $(DOCBUILDDIR)/man/man3/notmuch.3 ++DOXYFILE := $(srcdir)/$(dir)/doxygen.cfg + + .PHONY: sphinx-html sphinx-texinfo sphinx-info + +-.PHONY: install-man build-man ++.PHONY: install-man build-man apidocs install-apidocs + + %.gz: % + rm -f $@ && gzip --stdout $^ > $@ +@@ -56,6 +58,23 @@ else + endif + touch ${MAN_ROFF_FILES} $@ + ++install-man: install-apidocs ++ ++ifeq ($(HAVE_DOXYGEN),1) ++MAN_GZIP_FILES += ${APIMAN}.gz ++apidocs: $(APIMAN) ++install-apidocs: apidocs ++ mkdir -p "$(DESTDIR)$(mandir)/man3" ++ install -m0644 $(DOCBUILDDIR)/man/man3/*.3.gz $(DESTDIR)/$(mandir)/man3 ++ ++$(APIMAN): $(dir)/config.dox $(srcdir)/$(dir)/doxygen.cfg $(srcdir)/lib/notmuch.h ++ mkdir -p $(DOCBUILDDIR)/man/man3 ++ doxygen $(DOXYFILE) ++else ++apidocs: ++install-apidocs: ++endif ++ + # Do not try to build or install man pages if a man page converter is + # not available. + ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00) +@@ -74,8 +93,12 @@ install-man: ${MAN_GZIP_FILES} + cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz + endif + ++$(dir)/config.dox: version.stamp ++ echo "PROJECT_NAME = \"Notmuch $(VERSION)\"" > $@ ++ echo "INPUT=${srcdir}/lib/notmuch.h" >> $@ ++ + $(dir)/docdeps.mk: $(dir)/conf.py $(dir)/mkdocdeps.py + $(mkdocdeps) $(srcdir)/doc $(DOCBUILDDIR) $@ + + CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk $(DOCBUILDDIR)/.roff.stamp +-CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES) $(dir)/conf.pyc ++CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES) $(dir)/conf.pyc $(dir)/config.dox +diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg +index bfbfcab..1a53af5 100644 +--- a/doc/doxygen.cfg ++++ b/doc/doxygen.cfg +@@ -4,11 +4,11 @@ + # Project related configuration options + #--------------------------------------------------------------------------- + DOXYFILE_ENCODING = UTF-8 +-PROJECT_NAME = "Notmuch 0.18" ++@INCLUDE = "doc/config.dox" + PROJECT_NUMBER = + PROJECT_BRIEF = + PROJECT_LOGO = +-OUTPUT_DIRECTORY = ++OUTPUT_DIRECTORY = doc/_build + CREATE_SUBDIRS = NO + OUTPUT_LANGUAGE = English + BRIEF_MEMBER_DESC = YES +@@ -96,7 +96,6 @@ WARN_LOGFILE = + #--------------------------------------------------------------------------- + # configuration options related to the input files + #--------------------------------------------------------------------------- +-INPUT = lib/notmuch.h + INPUT_ENCODING = UTF-8 + FILE_PATTERNS = + RECURSIVE = NO +-- +2.0.0.rc2 + -- 2.26.2