unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] configure: Use $prefix for emacs, even when pkg-config is available.
Date: Wed, 25 Nov 2015 17:32:05 +0000	[thread overview]
Message-ID: <1448472725-11684-1-git-send-email-andrew.burgess@embecosm.com> (raw)

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?

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

             reply	other threads:[~2015-11-25 17:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 17:32 Andrew Burgess [this message]
2015-11-26 18:45 ` [PATCH] configure: Use $prefix for emacs, even when pkg-config is available Tomi Ollila
2015-11-28 13:07 ` David Bremner
2015-11-28 15:02   ` Tomi Ollila
2015-12-06 16:04     ` [PATCH] configure: drop use of "pkg-config emacs" David Bremner
2015-12-06 16:10     ` David Bremner
2015-12-06 18:10       ` Tomi Ollila
2015-12-10  1:07       ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1448472725-11684-1-git-send-email-andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).