Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id CDFB76DE141E for ; Thu, 26 Nov 2015 10:45:06 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.716 X-Spam-Level: X-Spam-Status: No, score=0.716 tagged_above=-999 required=5 tests=[AWL=0.064, 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 77PEfveITNty for ; Thu, 26 Nov 2015 10:45:04 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 1C27C6DE0C3A for ; Thu, 26 Nov 2015 10:45:03 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 7E0421000CA; Thu, 26 Nov 2015 20:45:17 +0200 (EET) From: Tomi Ollila To: Andrew Burgess , notmuch@notmuchmail.org Subject: Re: [PATCH] configure: Use $prefix for emacs, even when pkg-config is available. In-Reply-To: <1448472725-11684-1-git-send-email-andrew.burgess@embecosm.com> References: <1448472725-11684-1-git-send-email-andrew.burgess@embecosm.com> User-Agent: Notmuch/0.21+32~g73439f8 (http://notmuchmail.org) Emacs/24.3.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.20 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: Thu, 26 Nov 2015 18:45:06 -0000 On Wed, Nov 25 2015, Andrew Burgess wrote: > Hi, > > I like to maintain multiple copies of notmuch installed in parallel, > and so make use of the --prefix=$PREFIX argument to configure. > > I recently tried to configure and install from master, and ran into an > issue that the location selected for installing the emacs components > did not respect my chosen prefix. > > It turns out that if pkg-config is available (it is here) then the > supplied prefix is ignored, in favour of the path returned by pkg-config. > > To reproduce this issue, then as a non-root user, using current master: > > ./configure --prefix=$HOME/notmuch-prefix > make > make install > > Assumming that you have pkg-config installed, emacs installed, and the > command 'pkg-config emacs --variable sitepkglispdir' returns a > directory that only root can write to, then the make install above > should fail. > > The solution I propose in the patch below is to still apply the > prefix, even when pkg-config is available; pkg-config is used to > select the path within the prefix directory. > > Would you consider this for inclusion? perhaps that should be more complex: in case prefix is defined have $(prefix)/share/emacs/site-lisp in makefile regardless of what pkg-config --exists emacs returns... > > Thanks, > Andrew > > --- > When using pkg-config to select the path for the various emacs > installation directories (the lisp and etc directories), still apply > the $prefix variable. > --- > configure | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/configure b/configure > index 440d678..4f1db82 100755 > --- a/configure > +++ b/configure > @@ -473,7 +473,7 @@ fi > > if [ -z "${EMACSLISPDIR}" ]; then > if pkg-config --exists emacs; then > - EMACSLISPDIR=$(pkg-config emacs --variable sitepkglispdir) > + EMACSLISPDIR='$(prefix)'$(pkg-config emacs --variable sitepkglispdir) > else > EMACSLISPDIR='$(prefix)/share/emacs/site-lisp' > fi > @@ -481,7 +481,7 @@ fi > > if [ -z "${EMACSETCDIR}" ]; then > if pkg-config --exists emacs; then > - EMACSETCDIR=$(pkg-config emacs --variable sitepkglispdir) > + EMACSETCDIR='$(prefix)'$(pkg-config emacs --variable sitepkglispdir) > else > EMACSETCDIR='$(prefix)/share/emacs/site-lisp' > fi > -- > 2.5.1 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch