From: David Bremner Date: Sun, 6 Jul 2014 14:46:32 +0000 (+2100) Subject: [Patch v3 1/3] doc: build and install doxygen api docs X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c64b0925a73458df498c6dfc017db1b0b68d9a97;p=notmuch-archives.git [Patch v3 1/3] doc: build and install doxygen api docs --- diff --git a/bb/ef689c3026998b9b38f06c424224069bc78e9d b/bb/ef689c3026998b9b38f06c424224069bc78e9d new file mode 100644 index 000000000..aa39d5c8d --- /dev/null +++ b/bb/ef689c3026998b9b38f06c424224069bc78e9d @@ -0,0 +1,187 @@ +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 6BF4E431FBD + for ; Sun, 6 Jul 2014 10:54:01 -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 Cr7pqOv-4tQm for ; + Sun, 6 Jul 2014 10:53:55 -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 3CEFE431FAF + for ; Sun, 6 Jul 2014 10:53:46 -0700 (PDT) +Received: from remotemail by yantan.tethera.net with local (Exim 4.80) + (envelope-from ) + id 1X3qd8-0001Hd-Ep; Sun, 06 Jul 2014 14:53:38 -0300 +Received: (nullmailer pid 30894 invoked by uid 1000); Sun, 06 Jul 2014 + 14:46:38 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [Patch v3 1/3] doc: build and install doxygen api docs +Date: Sun, 6 Jul 2014 11:46:32 -0300 +Message-Id: <1404657994-30628-2-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.0.0.rc2 +In-Reply-To: <1404657994-30628-1-git-send-email-david@tethera.net> +References: <1404657994-30628-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: Sun, 06 Jul 2014 17:54:01 -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 | 18 ++++++++++++++++++ + doc/Makefile.local | 26 ++++++++++++++++++++++++-- + doc/doxygen.cfg | 6 +++--- + 3 files changed, 45 insertions(+), 5 deletions(-) + +diff --git a/configure b/configure +index 9514d4d..ec3a895 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" +@@ -725,6 +734,12 @@ commands to compile and install notmuch: + + EOF + ++# construct the Doxygen file list ++cat > doc/config.dox < Makefile.config < $@ +@@ -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)/version.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,11 @@ install-man: ${MAN_GZIP_FILES} + cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz + endif + ++$(dir)/version.dox: version.stamp ++ echo "PROJECT_NAME = \"Notmuch $(VERSION)\"" > $@ ++ + $(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)/version.dox $(dir)/config.dox +diff --git a/doc/doxygen.cfg b/doc/doxygen.cfg +index bfbfcab..68e8969 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/version.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,7 @@ WARN_LOGFILE = + #--------------------------------------------------------------------------- + # configuration options related to the input files + #--------------------------------------------------------------------------- +-INPUT = lib/notmuch.h ++@INCLUDE = doc/config.dox + INPUT_ENCODING = UTF-8 + FILE_PATTERNS = + RECURSIVE = NO +-- +2.0.0.rc2 +