* [PATCH] configure: add options to disable emacs/zsh/bash and choose install dir.
@ 2011-01-23 13:33 Cédric Cabessa
2011-01-23 21:14 ` Michal Sojka
2011-01-24 7:10 ` Xavier Maillard
0 siblings, 2 replies; 5+ messages in thread
From: Cédric Cabessa @ 2011-01-23 13:33 UTC (permalink / raw)
To: notmuch
add --bashcompletiondir and --zshcompletiondir (like --emacslispdir) to choose
installation dir for bash/zsh completion files
Make some features optional:
--without-emacs / --with-emacs=no do not install lisp file
--without-bash-completion / --with-bash-completion=no do not install bash
files
--without-zsh-completion / --with-zsh-completion=no do not install zsh files
By default, everything is enabled. You can reenable something with
--with-feature=yes
---
Makefile.local | 2 +
completion/Makefile.local | 4 +++
configure | 53 +++++++++++++++++++++++++++++++++++++++++++-
emacs/Makefile.local | 2 +
4 files changed, 59 insertions(+), 2 deletions(-)
diff --git a/Makefile.local b/Makefile.local
index f9b5a9b..3c6151c 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -277,6 +277,7 @@ ifeq ($(MAKECMDGOALS), install)
@echo "through the process of configuring notmuch and creating"
@echo "a database of existing email messages. The \"notmuch\""
@echo "command will also offer some sample search commands."
+ifeq ($(WITH_EMACS), 1)
@echo ""
@echo "Beyond the command-line interface, notmuch also offers"
@echo "a full-featured interface for reading and writing mail"
@@ -288,6 +289,7 @@ ifeq ($(MAKECMDGOALS), install)
@echo "And then run emacs as \"emacs -f notmuch\" or invoke"
@echo "the command \"M-x notmuch\" from within emacs."
endif
+endif
.PHONY: install-desktop
install-desktop:
diff --git a/completion/Makefile.local b/completion/Makefile.local
index 6a6012d..0b74c06 100644
--- a/completion/Makefile.local
+++ b/completion/Makefile.local
@@ -12,7 +12,11 @@ install: install-$(dir)
install-$(dir):
@echo $@
+ifeq ($(WITH_BASH),1)
mkdir -p $(DESTDIR)$(bash_completion_dir)
install -m0644 $(bash_script) $(DESTDIR)$(bash_completion_dir)/notmuch
+endif
+ifeq ($(WITH_ZSH),1)
mkdir -p $(DESTDIR)$(zsh_completion_dir)
install -m0644 $(zsh_script) $(DESTDIR)$(zsh_completion_dir)/notmuch
+endif
diff --git a/configure b/configure
index c58dd0f..c7ec414 100755
--- a/configure
+++ b/configure
@@ -28,6 +28,9 @@ XAPIAN_CONFIG=${XAPIAN_CONFIG:-xapian-config}
# options.
PREFIX=/usr/local
LIBDIR=
+WITH_EMACS=1
+WITH_BASH=1
+WITH_ZSH=1
usage ()
{
@@ -81,6 +84,15 @@ Fine tuning of some installation directories is available:
--mandir=DIR Install man pages to DIR [PREFIX/share/man]
--sysconfdir=DIR Read-only single-machine data [PREFIX/etc]
--emacslispdir=DIR Emacs code [PREFIX/share/emacs/site-lisp]
+ --bashcompletiondir=DIR Bash completions files [SYSCONFDIR/bash_completion.d]
+ --zshcompletiondir=DIR Zsh completions files [PREFIX/share/zsh/functions/Completion/Unix]
+
+Some features can be disabled (--with-feature=no is equivalent to
+--without-feature) :
+
+ --without-emacs Do not install lisp file
+ --without-bash-completion Do not install bash completions files
+ --without-zsh-completion Do not install zsh completions files
Additional options are accepted for compatibility with other
configure-script calling conventions, but don't do anything yet:
@@ -114,6 +126,34 @@ for option; do
SYSCONFDIR="${option#*=}"
elif [ "${option%%=*}" = '--emacslispdir' ] ; then
EMACSLISPDIR="${option#*=}"
+ elif [ "${option%%=*}" = '--bashcompletiondir' ] ; then
+ BASHCOMPLETIONDIR="${option#*=}"
+ elif [ "${option%%=*}" = '--zshcompletiondir' ] ; then
+ ZSHCOMLETIONDIR="${option#*=}"
+ elif [ "${option%%=*}" = '--with-emacs' ]; then
+ if [ "${option#*=}" = 'no' ]; then
+ WITH_EMACS=0
+ else
+ WITH_EMACS=1
+ fi
+ elif [ "${option}" = '--without-emacs' ] ; then
+ WITH_EMACS=0
+ elif [ "${option%%=*}" = '--with-bash-completion' ]; then
+ if [ "${option#*=}" = 'no' ]; then
+ WITH_BASH=0
+ else
+ WITH_BASH=1
+ fi
+ elif [ "${option}" = '--without-bash-completion' ] ; then
+ WITH_BASH=0
+ elif [ "${option%%=*}" = '--with-zsh-completion' ]; then
+ if [ "${option#*=}" = 'no' ]; then
+ WITH_ZSH=0
+ else
+ WITH_ZSH=1
+ fi
+ elif [ "${option}" = '--without-zsh-completion' ] ; then
+ WITH_ZSH=0
elif [ "${option%%=*}" = '--build' ] ; then
build_option="${option#*=}"
case ${build_option} in
@@ -527,10 +567,10 @@ HAVE_EMACS = ${have_emacs}
desktop_dir = \$(prefix)/share/applications
# The directory to which bash completions files should be installed
-bash_completion_dir = \$(sysconfdir)/bash_completion.d
+bash_completion_dir = ${BASHCOMPLETIONDIR:=\$(sysconfdir)/bash_completion.d}
# The directory to which zsh completions files should be installed
-zsh_completion_dir = \$(prefix)/share/zsh/functions/Completion/Unix
+zsh_completion_dir = ${ZSHCOMLETIONDIR:=\$(prefix)/share/zsh/functions/Completion/Unix}
# Whether the getline function is available (if not, then notmuch will
# build its own version)
@@ -572,6 +612,15 @@ HAVE_VALGRIND = ${have_valgrind}
# And if so, flags needed at compile time for valgrind macros
VALGRIND_CFLAGS = ${valgrind_cflags}
+# Support for emacs
+WITH_EMACS = ${WITH_EMACS}
+
+# Support for bash completion
+WITH_BASH = ${WITH_BASH}
+
+# Support for zsh completion
+WITH_ZSH = ${WITH_ZSH}
+
# Combined flags for compiling and linking against all of the above
CONFIGURE_CFLAGS = -DHAVE_GETLINE=\$(HAVE_GETLINE) \$(GMIME_CFLAGS) \\
\$(TALLOC_CFLAGS) -DHAVE_VALGRIND=\$(HAVE_VALGRIND) \\
diff --git a/emacs/Makefile.local b/emacs/Makefile.local
index 86f9b07..9ea8e49 100644
--- a/emacs/Makefile.local
+++ b/emacs/Makefile.local
@@ -22,11 +22,13 @@ emacs_bytecode := $(subst .el,.elc,$(emacs_sources))
%.elc: %.el
$(call quiet,EMACS) --directory emacs -batch -f batch-byte-compile $<
+ifeq ($(WITH_EMACS),1)
ifeq ($(HAVE_EMACS),1)
all: $(emacs_bytecode)
endif
install: install-emacs
+endif
.PHONY: install-emacs
install-emacs:
--
1.7.4.rc2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] configure: add options to disable emacs/zsh/bash and choose install dir.
2011-01-23 13:33 [PATCH] configure: add options to disable emacs/zsh/bash and choose install dir Cédric Cabessa
@ 2011-01-23 21:14 ` Michal Sojka
2011-01-26 12:33 ` Carl Worth
2011-01-24 7:10 ` Xavier Maillard
1 sibling, 1 reply; 5+ messages in thread
From: Michal Sojka @ 2011-01-23 21:14 UTC (permalink / raw)
To: Cédric Cabessa, notmuch
Hi Cédric,
thanks for the patch. I checked it and it didn't break anything for me.
But it made me thinking why zsh completion does not work for a long
time. Carl, please apply the patch below.
-Michal
From 72f6488b39aec318264caf26d2b163f73d3cf694 Mon Sep 17 00:00:00 2001
From: Michal Sojka <sojkam1@fel.cvut.cz>
Date: Sun, 23 Jan 2011 21:57:07 +0100
Subject: [PATCH] Fix installation of zsh completion
---
completion/Makefile.local | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/completion/Makefile.local b/completion/Makefile.local
index 6a6012d..1624bd7 100644
--- a/completion/Makefile.local
+++ b/completion/Makefile.local
@@ -15,4 +15,4 @@ install-$(dir):
mkdir -p $(DESTDIR)$(bash_completion_dir)
install -m0644 $(bash_script) $(DESTDIR)$(bash_completion_dir)/notmuch
mkdir -p $(DESTDIR)$(zsh_completion_dir)
- install -m0644 $(zsh_script) $(DESTDIR)$(zsh_completion_dir)/notmuch
+ install -m0644 $(zsh_script) $(DESTDIR)$(zsh_completion_dir)/_notmuch
--
1.7.2.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] configure: add options to disable emacs/zsh/bash and choose install dir.
2011-01-23 13:33 [PATCH] configure: add options to disable emacs/zsh/bash and choose install dir Cédric Cabessa
2011-01-23 21:14 ` Michal Sojka
@ 2011-01-24 7:10 ` Xavier Maillard
2011-01-24 20:12 ` Cédric Cabessa
1 sibling, 1 reply; 5+ messages in thread
From: Xavier Maillard @ 2011-01-24 7:10 UTC (permalink / raw)
To: Cédric Cabessa, notmuch
Hi Cedric,
On Sun, 23 Jan 2011 14:33:43 +0100, Cédric Cabessa <ced@ryick.net> wrote:
> add --bashcompletiondir and --zshcompletiondir (like --emacslispdir) to choose
> installation dir for bash/zsh completion files
>
> Make some features optional:
> --without-emacs / --with-emacs=no do not install lisp file
> --without-bash-completion / --with-bash-completion=no do not install bash
> files
> --without-zsh-completion / --with-zsh-completion=no do not install zsh files
> By default, everything is enabled. You can reenable something with
> --with-feature=yes
Why not just try to detect whether bash/zsh or even emacs is available
on the system and install the dependent files when it is the case ?
/Xavier
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] configure: add options to disable emacs/zsh/bash and choose install dir.
2011-01-24 7:10 ` Xavier Maillard
@ 2011-01-24 20:12 ` Cédric Cabessa
0 siblings, 0 replies; 5+ messages in thread
From: Cédric Cabessa @ 2011-01-24 20:12 UTC (permalink / raw)
To: Xavier Maillard; +Cc: notmuch
On Monday 24 January 2011 08:10:20 Xavier Maillard wrote:
>
> Why not just try to detect whether bash/zsh or even emacs is available
> on the system and install the dependent files when it is the case ?
Hi Xavier,
I think it is better to let user explicitly choose what he want to install
or not.
For the story, I am a gentoo user, in gentoo you can choose what
you want to install from a package with the USE flag mechanism.
(for example a ncurse client will depend of notmuch but without emacs support,
another user will install the same notmuch package but with emacs support).
So the with/without options make the packaging very easy.
I think we can do autodetection if needed, but the user should be able to
override the automatic behavior.
--
Cédric
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-01-26 12:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-23 13:33 [PATCH] configure: add options to disable emacs/zsh/bash and choose install dir Cédric Cabessa
2011-01-23 21:14 ` Michal Sojka
2011-01-26 12:33 ` Carl Worth
2011-01-24 7:10 ` Xavier Maillard
2011-01-24 20:12 ` Cédric Cabessa
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).