Re: [PATCH] configure: Use $prefix for emacs, even when pkg-config is available.
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 26 Nov 2015 18:45:17 +0000 (20:45 +0200)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:50:05 +0000 (14:50 -0700)
9a/4e3034bf2ebb711ef95f5d8cb521a4556aa297 [new file with mode: 0644]

diff --git a/9a/4e3034bf2ebb711ef95f5d8cb521a4556aa297 b/9a/4e3034bf2ebb711ef95f5d8cb521a4556aa297
new file mode 100644 (file)
index 0000000..e958c16
--- /dev/null
@@ -0,0 +1,127 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id CDFB76DE141E\r
+ for <notmuch@notmuchmail.org>; Thu, 26 Nov 2015 10:45:06 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.716\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.716 tagged_above=-999 required=5 tests=[AWL=0.064, \r
+ SPF_NEUTRAL=0.652] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 77PEfveITNty for <notmuch@notmuchmail.org>;\r
+ Thu, 26 Nov 2015 10:45:04 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 1C27C6DE0C3A\r
+ for <notmuch@notmuchmail.org>; Thu, 26 Nov 2015 10:45:03 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id 7E0421000CA;\r
+ Thu, 26 Nov 2015 20:45:17 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Andrew Burgess <andrew.burgess@embecosm.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] configure: Use $prefix for emacs,\r
+ even when pkg-config is available.\r
+In-Reply-To: <1448472725-11684-1-git-send-email-andrew.burgess@embecosm.com>\r
+References: <1448472725-11684-1-git-send-email-andrew.burgess@embecosm.com>\r
+User-Agent: Notmuch/0.21+32~g73439f8 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Thu, 26 Nov 2015 20:45:17 +0200\r
+Message-ID: <m2oaeg4n2a.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 26 Nov 2015 18:45:06 -0000\r
+\r
+On Wed, Nov 25 2015, Andrew Burgess <andrew.burgess@embecosm.com> wrote:\r
+\r
+> Hi,\r
+>\r
+> I like to maintain multiple copies of notmuch installed in parallel,\r
+> and so make use of the --prefix=$PREFIX argument to configure.\r
+>\r
+> I recently tried to configure and install from master, and ran into an\r
+> issue that the location selected for installing the emacs components\r
+> did not respect my chosen prefix.\r
+>\r
+> It turns out that if pkg-config is available (it is here) then the\r
+> supplied prefix is ignored, in favour of the path returned by pkg-config.\r
+>\r
+> To reproduce this issue, then as a non-root user, using current master:\r
+>\r
+>   ./configure --prefix=$HOME/notmuch-prefix\r
+>   make\r
+>   make install\r
+>\r
+> Assumming that you have pkg-config installed, emacs installed, and the\r
+> command 'pkg-config emacs --variable sitepkglispdir' returns a\r
+> directory that only root can write to, then the make install above\r
+> should fail.\r
+>\r
+> The solution I propose in the patch below is to still apply the\r
+> prefix, even when pkg-config is available; pkg-config is used to\r
+> select the path within the prefix directory.\r
+>\r
+> Would you consider this for inclusion?\r
+\r
+perhaps that should be more complex: in case prefix is defined\r
+have $(prefix)/share/emacs/site-lisp in makefile regardless of \r
+what pkg-config --exists emacs returns...\r
+\r
+>\r
+> Thanks,\r
+> Andrew\r
+>\r
+> ---\r
+> When using pkg-config to select the path for the various emacs\r
+> installation directories (the lisp and etc directories), still apply\r
+> the $prefix variable.\r
+> ---\r
+>  configure | 4 ++--\r
+>  1 file changed, 2 insertions(+), 2 deletions(-)\r
+>\r
+> diff --git a/configure b/configure\r
+> index 440d678..4f1db82 100755\r
+> --- a/configure\r
+> +++ b/configure\r
+> @@ -473,7 +473,7 @@ fi\r
+>  \r
+>  if [ -z "${EMACSLISPDIR}" ]; then\r
+>      if pkg-config --exists emacs; then\r
+> -    EMACSLISPDIR=$(pkg-config emacs --variable sitepkglispdir)\r
+> +    EMACSLISPDIR='$(prefix)'$(pkg-config emacs --variable sitepkglispdir)\r
+>      else\r
+>      EMACSLISPDIR='$(prefix)/share/emacs/site-lisp'\r
+>      fi\r
+> @@ -481,7 +481,7 @@ fi\r
+>  \r
+>  if [ -z "${EMACSETCDIR}" ]; then\r
+>      if pkg-config --exists emacs; then\r
+> -    EMACSETCDIR=$(pkg-config emacs --variable sitepkglispdir)\r
+> +    EMACSETCDIR='$(prefix)'$(pkg-config emacs --variable sitepkglispdir)\r
+>      else\r
+>      EMACSETCDIR='$(prefix)/share/emacs/site-lisp'\r
+>      fi\r
+> -- \r
+> 2.5.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> https://notmuchmail.org/mailman/listinfo/notmuch\r