From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 0A39C6DE1204 for ; Sat, 26 Nov 2016 09:07:16 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.525 X-Spam-Level: X-Spam-Status: No, score=0.525 tagged_above=-999 required=5 tests=[AWL=-0.127, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RZhvIJHOezZw for ; Sat, 26 Nov 2016 09:07:15 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 1A8396DE10E8 for ; Sat, 26 Nov 2016 09:07:15 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id C290810007F for ; Sat, 26 Nov 2016 19:07:59 +0200 (EET) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: Re: [PATCH v3] build: install notmuch-emacs-mua.desktop file with emacs In-Reply-To: <1480153037-20211-1-git-send-email-jani@nikula.org> References: <1480153037-20211-1-git-send-email-jani@nikula.org> User-Agent: Notmuch/0.23.1+52~ga6dbf3a (https://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Sat, 26 Nov 2016 17:07:16 -0000 On Sat, Nov 26 2016, Jani Nikula wrote: > 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. > > --- > > v3: check for desktop-file-install in configure. This and the next change LGTM. > > I don't see a reason to differentiate between "with desktop" and "have > desktop-file-install", so I'm simply setting WITH_DESKTOP=0 if > desktop-file-install is not available. > --- > configure | 23 +++++++++++++++++++++++ > emacs/Makefile.local | 5 ++--- > 2 files changed, 25 insertions(+), 3 deletions(-) > > diff --git a/configure b/configure > index f0fc466eead5..72db26dfc52e 100755 > --- a/configure > +++ b/configure > @@ -70,6 +70,7 @@ LIBDIR= > WITH_DOCS=1 > WITH_API_DOCS=1 > WITH_EMACS=1 > +WITH_DESKTOP=1 > WITH_BASH=1 > WITH_RUBY=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-api-docs Do not install API man page > --without-emacs Do not install lisp file > + --without-desktop Do not install desktop file > --without-ruby Do not install ruby bindings > --without-zsh-completion Do not install zsh completions files > --without-retry-lock Do not use blocking xapian opens, even if available > @@ -209,6 +211,14 @@ for option; do > fi > elif [ "${option}" = '--without-emacs' ] ; then > 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 > if [ "${option#*=}" = 'no' ]; then > WITH_BASH=0 > @@ -602,6 +612,16 @@ if [ $WITH_DOCS = "1" ] ; then > 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 > > printf "Checking which platform we are on... " > @@ -1123,6 +1143,9 @@ VALGRIND_CFLAGS = ${valgrind_cflags} > # Support for emacs > WITH_EMACS = ${WITH_EMACS} > > +# Support for desktop file > +WITH_DESKTOP = ${WITH_DESKTOP} > + > # Support for bash completion > WITH_BASH = ${WITH_BASH} > > diff --git a/emacs/Makefile.local b/emacs/Makefile.local > index b47577ac1110..ffa8421ebd45 100644 > --- a/emacs/Makefile.local > +++ b/emacs/Makefile.local > @@ -96,10 +96,9 @@ endif > install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)" > mkdir -p "$(DESTDIR)$(prefix)/bin/" > install $(emacs_mua) "$(DESTDIR)$(prefix)/bin" > - > -.PHONY: install-desktop > -install-desktop: > +ifeq ($(WITH_DESKTOP),1) > mkdir -p "$(DESTDIR)$(desktop_dir)" > 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 > -- > 2.1.4