build: install notmuch-emacs-mua.desktop file with emacs

There is really no need to have a separate install target for the
desktop file. Just install the desktop file with emacs, with a
configure option to opt out.
This commit is contained in:
Jani Nikula 2016-11-26 11:37:17 +02:00 committed by David Bremner
parent ef763a9e8b
commit 459989b7ef
2 changed files with 25 additions and 3 deletions

23
configure vendored
View file

@ -70,6 +70,7 @@ LIBDIR=
WITH_DOCS=1 WITH_DOCS=1
WITH_API_DOCS=1 WITH_API_DOCS=1
WITH_EMACS=1 WITH_EMACS=1
WITH_DESKTOP=1
WITH_BASH=1 WITH_BASH=1
WITH_RUBY=1 WITH_RUBY=1
WITH_ZSH=1 WITH_ZSH=1
@ -141,6 +142,7 @@ Some features can be disabled (--with-feature=no is equivalent to
--without-docs Do not install documentation --without-docs Do not install documentation
--without-api-docs Do not install API man page --without-api-docs Do not install API man page
--without-emacs Do not install lisp file --without-emacs Do not install lisp file
--without-desktop Do not install desktop file
--without-ruby Do not install ruby bindings --without-ruby Do not install ruby bindings
--without-zsh-completion Do not install zsh completions files --without-zsh-completion Do not install zsh completions files
--without-retry-lock Do not use blocking xapian opens, even if available --without-retry-lock Do not use blocking xapian opens, even if available
@ -209,6 +211,14 @@ for option; do
fi fi
elif [ "${option}" = '--without-emacs' ] ; then elif [ "${option}" = '--without-emacs' ] ; then
WITH_EMACS=0 WITH_EMACS=0
elif [ "${option%%=*}" = '--with-desktop' ]; then
if [ "${option#*=}" = 'no' ]; then
WITH_DESKTOP=0
else
WITH_DESKTOP=1
fi
elif [ "${option}" = '--without-desktop' ] ; then
WITH_DESKTOP=0
elif [ "${option%%=*}" = '--with-bash-completion' ]; then elif [ "${option%%=*}" = '--with-bash-completion' ]; then
if [ "${option#*=}" = 'no' ]; then if [ "${option#*=}" = 'no' ]; then
WITH_BASH=0 WITH_BASH=0
@ -602,6 +612,16 @@ if [ $WITH_DOCS = "1" ] ; then
fi fi
fi fi
if [ $WITH_DESKTOP = "1" ]; then
printf "Checking if desktop-file-install is available... "
if command -v desktop-file-install > /dev/null; then
printf "Yes.\n"
else
printf "No (so will not install .desktop file).\n"
WITH_DESKTOP=0
fi
fi
libdir_in_ldconfig=0 libdir_in_ldconfig=0
printf "Checking which platform we are on... " printf "Checking which platform we are on... "
@ -1123,6 +1143,9 @@ VALGRIND_CFLAGS = ${valgrind_cflags}
# Support for emacs # Support for emacs
WITH_EMACS = ${WITH_EMACS} WITH_EMACS = ${WITH_EMACS}
# Support for desktop file
WITH_DESKTOP = ${WITH_DESKTOP}
# Support for bash completion # Support for bash completion
WITH_BASH = ${WITH_BASH} WITH_BASH = ${WITH_BASH}

View file

@ -106,10 +106,9 @@ endif
install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)" install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)"
mkdir -p "$(DESTDIR)$(prefix)/bin/" mkdir -p "$(DESTDIR)$(prefix)/bin/"
install $(emacs_mua) "$(DESTDIR)$(prefix)/bin" install $(emacs_mua) "$(DESTDIR)$(prefix)/bin"
ifeq ($(WITH_DESKTOP),1)
.PHONY: install-desktop
install-desktop:
mkdir -p "$(DESTDIR)$(desktop_dir)" mkdir -p "$(DESTDIR)$(desktop_dir)"
desktop-file-install --mode 0644 --dir "$(DESTDIR)$(desktop_dir)" $(emacs_mua_desktop) desktop-file-install --mode 0644 --dir "$(DESTDIR)$(desktop_dir)" $(emacs_mua_desktop)
endif
CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el $(dir)/notmuch-pkg.el CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el $(dir)/notmuch-pkg.el