From 686d134ca1deca4dc8cfd6e142d6d6dac3a35a29 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Wed, 25 Nov 2015 17:32:05 +0000 Subject: [PATCH] [PATCH] configure: Use $prefix for emacs, even when pkg-config is available. --- 0a/447910aab9206940b67b90f2606e2449b01061 | 137 ++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 0a/447910aab9206940b67b90f2606e2449b01061 diff --git a/0a/447910aab9206940b67b90f2606e2449b01061 b/0a/447910aab9206940b67b90f2606e2449b01061 new file mode 100644 index 000000000..32fb257d1 --- /dev/null +++ b/0a/447910aab9206940b67b90f2606e2449b01061 @@ -0,0 +1,137 @@ +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 8B5406DE1585 + for ; Wed, 25 Nov 2015 09:32:15 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.72 +X-Spam-Level: +X-Spam-Status: No, score=-0.72 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, + RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] 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 QM5mbSy8TqDp for ; + Wed, 25 Nov 2015 09:32:13 -0800 (PST) +Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com + [74.125.82.43]) by arlo.cworth.org (Postfix) with ESMTPS id 03A866DE0274 for + ; Wed, 25 Nov 2015 09:32:12 -0800 (PST) +Received: by wmww144 with SMTP id w144so189520634wmw.1 + for ; Wed, 25 Nov 2015 09:32:10 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=embecosm-com.20150623.gappssmtp.com; s=20150623; + h=from:to:cc:subject:date:message-id; + bh=G7/4PjlVvKSOVlva/gh0vLOE2NNIWl98DrZRItZAScs=; + b=PFmhnuBjeOB6VJwtX5Eopvu5EHdR/gj/6ftNHp3US7EJrtk3NEHZe3JNtpUnhdVLva + B+h1gL/tBRSTB8HiJDNE59dEUnKE79PUtRw/PajkgRLE34zmGuUEaeukANhkNvmBIOHI + KRR9GYxWIOQySnK8zgif8k4LhBq64HOTt1ajk6CU0BW6vLVPwAw6v80QZEGyHtwJSS7p + uD/irBTQ5DTpXqSj8HfIRrEYwq//Fay15A7PB3tkZNio2lSDaDvIcyuJnouAgVmcZaL1 + sVwC1avKtv99XTlXROWOoQf1blNumbDvP1uZgYvBzyjRy8D/KOfG9BZBqlZra8Mc2Vhv + 3Yfw== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:from:to:cc:subject:date:message-id; + bh=G7/4PjlVvKSOVlva/gh0vLOE2NNIWl98DrZRItZAScs=; + b=cY3oM30HWzblxMt9dPTAyRfCn4/dilAMDqK8ERzo4oiXghv2/wMO5a+57CrM8KQcAh + vekhQrurU+Xy60IIccQ48ZvZ/HstjvNZX1Xast3Cqmin4qTnZ2e3P7zKb2N6R8iNLCvz + qNtthA2xW85zr7tzJh8i1HGFLx8m/B51C/bXWOqICvuKPzEvDJV/odJ+XGz8EPXkK2Vv + Y3z9bIRb3O/QEYqQJ9cZFvNN12GcMs65OgXUd/p9vNpd2jljFL7VtFid9THPk0Kz6JKn + vwZ04j3Q2o/1Cu5kojqVDVmZHEVz8UiTlfDOGVv0T1b9hTNrGqdqEjp4A0JUYxWAu7pl + d9cw== +X-Gm-Message-State: + ALoCoQloKb1peic6vlra9hn5G8baai0oruvVG7mmZUiAQvCEBp+mDWeVEZL7qEOnfM9OFl036pnc +X-Received: by 10.194.243.170 with SMTP id wz10mr51066206wjc.80.1448472730446; + Wed, 25 Nov 2015 09:32:10 -0800 (PST) +Received: from localhost (host86-138-95-213.range86-138.btcentralplus.com. + [86.138.95.213]) + by smtp.gmail.com with ESMTPSA id hw1sm24181636wjb.6.2015.11.25.09.32.09 + (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Wed, 25 Nov 2015 09:32:09 -0800 (PST) +From: Andrew Burgess +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 +Message-Id: <1448472725-11684-1-git-send-email-andrew.burgess@embecosm.com> +X-Mailer: git-send-email 2.5.1 +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: Wed, 25 Nov 2015 17:32:15 -0000 + +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 + -- 2.26.2