Re: [PATCH] Fix folder: coherence issue
[notmuch-archives.git] / bf / dfdb38c71396ad9a4e11ef9620956691894651
1 Return-Path: <ced@ryick.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 70309431FD0\r
6         for <notmuch@notmuchmail.org>; Sun, 23 Jan 2011 05:33:47 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.001\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.001 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_SORBS_DUL=0.001] 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 myW4t7ai1EO6 for <notmuch@notmuchmail.org>;\r
16         Sun, 23 Jan 2011 05:33:46 -0800 (PST)\r
17 Received: from ced.ryick.net (ced.ryick.net [82.229.97.62])\r
18         by olra.theworths.org (Postfix) with ESMTP id 4E65A431FB6\r
19         for <notmuch@notmuchmail.org>; Sun, 23 Jan 2011 05:33:46 -0800 (PST)\r
20 Received: from fawkes.localnet (unknown [192.168.0.2])\r
21         by ced.ryick.net (Postfix) with ESMTPSA id 1736087A71\r
22         for <notmuch@notmuchmail.org>; Sun, 23 Jan 2011 14:33:45 +0100 (CET)\r
23 X-Mailbox-Line: From 5d80f12624ce624942629b959646cf48e84578b1 Mon Sep 17\r
24         00:00:00 2001\r
25 From: =?iso-8859-1?q?C=E9dric_Cabessa?= <ced@ryick.net>\r
26 Date: Sun, 23 Jan 2011 14:33:43 +0100\r
27 Subject: [PATCH] configure: add options to disable emacs/zsh/bash and choose\r
28         install dir.\r
29 To: notmuch@notmuchmail.org\r
30 MIME-Version: 1.0\r
31 Content-Type: text/plain;\r
32   charset="us-ascii"\r
33 Content-Transfer-Encoding: 7bit\r
34 Message-Id: <201101231433.43935.ced@ryick.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: Sun, 23 Jan 2011 13:33:47 -0000\r
48 \r
49 add --bashcompletiondir and --zshcompletiondir (like --emacslispdir) to choose\r
50 installation dir for bash/zsh completion files\r
51 \r
52 Make some features optional:\r
53   --without-emacs / --with-emacs=no do not install lisp file\r
54   --without-bash-completion / --with-bash-completion=no  do not install bash\r
55 files\r
56   --without-zsh-completion / --with-zsh-completion=no do not install zsh files\r
57 By default, everything is enabled. You can reenable something with\r
58   --with-feature=yes\r
59 ---\r
60  Makefile.local            |    2 +\r
61  completion/Makefile.local |    4 +++\r
62  configure                 |   53 +++++++++++++++++++++++++++++++++++++++++++-\r
63  emacs/Makefile.local      |    2 +\r
64  4 files changed, 59 insertions(+), 2 deletions(-)\r
65 \r
66 diff --git a/Makefile.local b/Makefile.local\r
67 index f9b5a9b..3c6151c 100644\r
68 --- a/Makefile.local\r
69 +++ b/Makefile.local\r
70 @@ -277,6 +277,7 @@ ifeq ($(MAKECMDGOALS), install)\r
71         @echo "through the process of configuring notmuch and creating"\r
72         @echo "a database of existing email messages. The \"notmuch\""\r
73         @echo "command will also offer some sample search commands."\r
74 +ifeq ($(WITH_EMACS), 1)\r
75         @echo ""\r
76         @echo "Beyond the command-line interface, notmuch also offers"\r
77         @echo "a full-featured interface for reading and writing mail"\r
78 @@ -288,6 +289,7 @@ ifeq ($(MAKECMDGOALS), install)\r
79         @echo "And then run emacs as \"emacs -f notmuch\" or invoke"\r
80         @echo "the command \"M-x notmuch\" from within emacs."\r
81  endif\r
82 +endif\r
83  \r
84  .PHONY: install-desktop\r
85  install-desktop:\r
86 diff --git a/completion/Makefile.local b/completion/Makefile.local\r
87 index 6a6012d..0b74c06 100644\r
88 --- a/completion/Makefile.local\r
89 +++ b/completion/Makefile.local\r
90 @@ -12,7 +12,11 @@ install: install-$(dir)\r
91  \r
92  install-$(dir):\r
93         @echo $@\r
94 +ifeq ($(WITH_BASH),1)\r
95         mkdir -p $(DESTDIR)$(bash_completion_dir)\r
96         install -m0644 $(bash_script) $(DESTDIR)$(bash_completion_dir)/notmuch\r
97 +endif\r
98 +ifeq ($(WITH_ZSH),1)\r
99         mkdir -p $(DESTDIR)$(zsh_completion_dir)\r
100         install -m0644 $(zsh_script) $(DESTDIR)$(zsh_completion_dir)/notmuch\r
101 +endif\r
102 diff --git a/configure b/configure\r
103 index c58dd0f..c7ec414 100755\r
104 --- a/configure\r
105 +++ b/configure\r
106 @@ -28,6 +28,9 @@ XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config}\r
107  # options.\r
108  PREFIX=/usr/local\r
109  LIBDIR=\r
110 +WITH_EMACS=1\r
111 +WITH_BASH=1\r
112 +WITH_ZSH=1\r
113  \r
114  usage ()\r
115  {\r
116 @@ -81,6 +84,15 @@ Fine tuning of some installation directories is available:\r
117         --mandir=DIR            Install man pages to DIR [PREFIX/share/man]\r
118         --sysconfdir=DIR        Read-only single-machine data [PREFIX/etc]\r
119         --emacslispdir=DIR      Emacs code [PREFIX/share/emacs/site-lisp]\r
120 +       --bashcompletiondir=DIR Bash completions files [SYSCONFDIR/bash_completion.d]\r
121 +       --zshcompletiondir=DIR  Zsh completions files [PREFIX/share/zsh/functions/Completion/Unix]\r
122 +\r
123 +Some features can be disabled (--with-feature=no is equivalent to\r
124 +--without-feature) :\r
125 +\r
126 +       --without-emacs                 Do not install lisp file\r
127 +       --without-bash-completion       Do not install bash completions files\r
128 +       --without-zsh-completion        Do not install zsh completions files\r
129  \r
130  Additional options are accepted for compatibility with other\r
131  configure-script calling conventions, but don't do anything yet:\r
132 @@ -114,6 +126,34 @@ for option; do\r
133         SYSCONFDIR="${option#*=}"\r
134      elif [ "${option%%=*}" = '--emacslispdir' ] ; then\r
135         EMACSLISPDIR="${option#*=}"\r
136 +    elif [ "${option%%=*}" = '--bashcompletiondir' ] ; then\r
137 +       BASHCOMPLETIONDIR="${option#*=}"\r
138 +    elif [ "${option%%=*}" = '--zshcompletiondir' ] ; then\r
139 +       ZSHCOMLETIONDIR="${option#*=}"\r
140 +    elif [ "${option%%=*}" = '--with-emacs' ]; then\r
141 +       if [ "${option#*=}" = 'no' ]; then\r
142 +           WITH_EMACS=0\r
143 +       else\r
144 +           WITH_EMACS=1\r
145 +       fi\r
146 +    elif [ "${option}" = '--without-emacs' ] ; then\r
147 +       WITH_EMACS=0\r
148 +    elif [ "${option%%=*}" = '--with-bash-completion' ]; then\r
149 +       if [ "${option#*=}" = 'no' ]; then\r
150 +           WITH_BASH=0\r
151 +       else\r
152 +           WITH_BASH=1\r
153 +       fi\r
154 +    elif [ "${option}" = '--without-bash-completion' ] ; then\r
155 +       WITH_BASH=0\r
156 +    elif [ "${option%%=*}" = '--with-zsh-completion' ]; then\r
157 +       if [ "${option#*=}" = 'no' ]; then\r
158 +           WITH_ZSH=0\r
159 +       else\r
160 +           WITH_ZSH=1\r
161 +       fi\r
162 +    elif [ "${option}" = '--without-zsh-completion' ] ; then\r
163 +       WITH_ZSH=0\r
164      elif [ "${option%%=*}" = '--build' ] ; then\r
165         build_option="${option#*=}"\r
166         case ${build_option} in\r
167 @@ -527,10 +567,10 @@ HAVE_EMACS = ${have_emacs}\r
168  desktop_dir = \$(prefix)/share/applications\r
169  \r
170  # The directory to which bash completions files should be installed\r
171 -bash_completion_dir = \$(sysconfdir)/bash_completion.d\r
172 +bash_completion_dir = ${BASHCOMPLETIONDIR:=\$(sysconfdir)/bash_completion.d}\r
173  \r
174  # The directory to which zsh completions files should be installed\r
175 -zsh_completion_dir = \$(prefix)/share/zsh/functions/Completion/Unix\r
176 +zsh_completion_dir = ${ZSHCOMLETIONDIR:=\$(prefix)/share/zsh/functions/Completion/Unix}\r
177  \r
178  # Whether the getline function is available (if not, then notmuch will\r
179  # build its own version)\r
180 @@ -572,6 +612,15 @@ HAVE_VALGRIND = ${have_valgrind}\r
181  # And if so, flags needed at compile time for valgrind macros\r
182  VALGRIND_CFLAGS = ${valgrind_cflags}\r
183  \r
184 +# Support for emacs\r
185 +WITH_EMACS = ${WITH_EMACS}\r
186 +\r
187 +# Support for bash completion\r
188 +WITH_BASH = ${WITH_BASH}\r
189 +\r
190 +# Support for zsh completion\r
191 +WITH_ZSH = ${WITH_ZSH}\r
192 +\r
193  # Combined flags for compiling and linking against all of the above\r
194  CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS)      \\\r
195                    \$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND)   \\\r
196 diff --git a/emacs/Makefile.local b/emacs/Makefile.local\r
197 index 86f9b07..9ea8e49 100644\r
198 --- a/emacs/Makefile.local\r
199 +++ b/emacs/Makefile.local\r
200 @@ -22,11 +22,13 @@ emacs_bytecode := $(subst .el,.elc,$(emacs_sources))\r
201  %.elc: %.el\r
202         $(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<\r
203  \r
204 +ifeq ($(WITH_EMACS),1)\r
205  ifeq ($(HAVE_EMACS),1)\r
206  all: $(emacs_bytecode)\r
207  endif\r
208  \r
209  install: install-emacs\r
210 +endif\r
211  \r
212  .PHONY: install-emacs\r
213  install-emacs:\r
214 -- \r
215 1.7.4.rc2\r
216 \r