Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 5c / 08b99f2e417618a93273ea0f8f20aae50452bc
1 Return-Path: <bremner@tethera.net>\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 C365A431FD0\r
6         for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 05:06:27 -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 zaegCz0F77+Y for <notmuch@notmuchmail.org>;\r
16         Tue, 11 Mar 2014 05:06:25 -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 97A3A431FD2\r
21         for <notmuch@notmuchmail.org>; Tue, 11 Mar 2014 05:06:13 -0700 (PDT)\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
23         (envelope-from <bremner@tethera.net>)\r
24         id 1WNLRl-0007Jt-9G; Tue, 11 Mar 2014 09:06:13 -0300\r
25 Received: (nullmailer pid 28627 invoked by uid 1000); Tue, 11 Mar 2014\r
26         12:05:59 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: notmuch@notmuchmail.org\r
29 Subject: [Patch v2 3/3] doc: configure detection of sphinx and rst2man\r
30 Date: Tue, 11 Mar 2014 09:05:55 -0300\r
31 Message-Id: <1394539555-28334-4-git-send-email-david@tethera.net>\r
32 X-Mailer: git-send-email 1.8.5.3\r
33 In-Reply-To: <1394539555-28334-1-git-send-email-david@tethera.net>\r
34 References: <1394539555-28334-1-git-send-email-david@tethera.net>\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.13\r
37 Precedence: list\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: Tue, 11 Mar 2014 12:06:28 -0000\r
48 \r
49 Because sphinx-build does not provide a convenient way of listing\r
50 which builders exist, and some people actually have pre 1.0 sphinx, we\r
51 try loading a relevant python module.\r
52 \r
53 Currently the assumption is that no python in path -> no sphinx-build\r
54 in path.\r
55 ---\r
56  configure          | 27 +++++++++++++++++++++++++++\r
57  doc/Makefile.local | 24 +++++++++++++++---------\r
58  2 files changed, 42 insertions(+), 9 deletions(-)\r
59 \r
60 diff --git a/configure b/configure\r
61 index 2eaed4a..4aaecc6 100755\r
62 --- a/configure\r
63 +++ b/configure\r
64 @@ -393,6 +393,27 @@ else\r
65      have_emacs=0\r
66  fi\r
67  \r
68 +printf "Checking if sphinx is available and supports nroff output... "\r
69 +if hash sphinx-build > /dev/null 2>&1 && python -m sphinx.writers.manpage > /dev/null 2>&1 ; then\r
70 +    printf "Yes.\n"\r
71 +    have_sphinx=1\r
72 +    have_rst2man=0\r
73 +else\r
74 +    printf "No (falling back to rst2man).\n"\r
75 +    have_sphinx=0\r
76 +\r
77 +    printf "Checking if rst2man is available... "\r
78 +    if rst2man -V > /dev/null 2>&1; then\r
79 +       printf "Yes.\n"\r
80 +       have_rst2man=1\r
81 +    else\r
82 +       printf "No (so will not install man pages).\n"\r
83 +       have_rst2man=0\r
84 +    fi\r
85 +fi\r
86 +\r
87 +\r
88 +\r
89  libdir_in_ldconfig=0\r
90  \r
91  printf "Checking which platform we are on... "\r
92 @@ -759,6 +780,12 @@ emacsetcdir=${EMACSETCDIR}\r
93  # Whether there's an emacs binary available for byte-compiling\r
94  HAVE_EMACS = ${have_emacs}\r
95  \r
96 +# Whether there's a sphinx-build binary available for building documentation\r
97 +HAVE_SPHINX=${have_sphinx}\r
98 +\r
99 +# Whether there's a rst2man binary available for building documentation\r
100 +HAVE_RST2MAN=${have_rst2man}\r
101 +\r
102  # The directory to which desktop files should be installed\r
103  desktop_dir = \$(prefix)/share/applications\r
104  \r
105 diff --git a/doc/Makefile.local b/doc/Makefile.local\r
106 index 23f4095..4883c4a 100644\r
107 --- a/doc/Makefile.local\r
108 +++ b/doc/Makefile.local\r
109 @@ -33,21 +33,26 @@ sphinx-info: sphinx-texinfo\r
110  \r
111  MAN_GZIP_FILES := $(addsuffix .gz,${MAN_ROFF_FILES})\r
112  \r
113 -build-man: ${MAN_GZIP_FILES}\r
114 -\r
115 -${MAN_ROFF_FILES}: ${dir}/man.stamp\r
116 -\r
117 -$(dir)/man.stamp: ${MAN_RST_FILES}\r
118 +# Use the man page converter that is available. We should never depend\r
119 +# on MAN_ROFF_FILES if a converter is not available.\r
120 +${MAN_ROFF_FILES}: ${MAN_RST_FILES}\r
121  ifeq ($(HAVE_SPHINX),1)\r
122         $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(DOCBUILDDIR)/man\r
123 -       touch $@\r
124  else ifeq ($(HAVE_RST2MAN),1)\r
125         $(prerst2man) $(DOCBUILDDIR)/.. $(DOCBUILDDIR)/man\r
126 -       touch $@\r
127  else\r
128 -       @echo "No sphinx or rst2man, will not install man pages."\r
129 +       @echo "Fatal: build dependency fail."\r
130 +       @false\r
131  endif\r
132  \r
133 +# Do not try to build or install man pages if a man page converter is\r
134 +# not available.\r
135 +ifeq ($(HAVE_SPHINX)$(HAVE_RST2MAN),00)\r
136 +build-man:\r
137 +install-man:\r
138 +       @echo "No sphinx or rst2man, will not install man pages."\r
139 +else\r
140 +build-man: ${MAN_GZIP_FILES}\r
141  install-man: ${MAN_GZIP_FILES}\r
142         mkdir -p "$(DESTDIR)$(mandir)/man1"\r
143         mkdir -p "$(DESTDIR)$(mandir)/man5"\r
144 @@ -56,9 +61,10 @@ install-man: ${MAN_GZIP_FILES}\r
145         install -m0644 $(DOCBUILDDIR)/man/*.5.gz $(DESTDIR)/$(mandir)/man5\r
146         install -m0644 $(DOCBUILDDIR)/man/*.7.gz $(DESTDIR)/$(mandir)/man7\r
147         cd $(DESTDIR)/$(mandir)/man1 && ln -sf notmuch.1.gz notmuch-setup.1.gz\r
148 +endif\r
149  \r
150  $(dir)/docdeps.mk: $(dir)/conf.py $(dir)/mkdocdeps.py\r
151         $(mkdocdeps) $< $(DOCBUILDDIR) $@\r
152  \r
153 -CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk $(dir)/man.stamp\r
154 +CLEAN := $(CLEAN) $(DOCBUILDDIR) $(dir)/docdeps.mk\r
155  CLEAN := $(CLEAN) $(MAN_GZIP_FILES) $(MAN_ROFF_FILES)\r
156 -- \r
157 1.8.5.3\r
158 \r