[pacman-dev] Make `make distcheck` work again.

Message ID 20181203014424.18392-1-eschwartz@archlinux.org
State Accepted, archived
Headers show
Series
  • [pacman-dev] Make `make distcheck` work again.
Related show

Commit Message

Eli Schwartz Dec. 3, 2018, 1:44 a.m. UTC
bash-completion uses pkg-config to determine the best installation
directory, but this does not take --prefix into account (although it
works fine with DESTDIR). The fallback value does attempt to set this
based on --prefix.

The distcheck uses --prefix, though, which means when attempting to
install the results and bash-completion support for pkg-config was
detected, it errors out on trying to write to, usually, /usr/share.

Tell distcheck to use the prefix-based fallback location instead, as the
PKG_CHECK_* override.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 Makefile.am | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Allan McRae Dec. 3, 2018, 4:02 a.m. UTC | #1
On 3/12/18 11:44 am, Eli Schwartz wrote:
> bash-completion uses pkg-config to determine the best installation
> directory, but this does not take --prefix into account (although it
> works fine with DESTDIR). The fallback value does attempt to set this
> based on --prefix.
> 
> The distcheck uses --prefix, though, which means when attempting to
> install the results and bash-completion support for pkg-config was
> detected, it errors out on trying to write to, usually, /usr/share.
> 
> Tell distcheck to use the prefix-based fallback location instead, as the
> PKG_CHECK_* override.
> 

What has changed here?   "make distcheck" has been working for me...
What configure line do you use to generate the error?

Allan
Eli Schwartz Dec. 3, 2018, 4:09 a.m. UTC | #2
On 12/2/18 11:02 PM, Allan McRae wrote:
> On 3/12/18 11:44 am, Eli Schwartz wrote:
>> bash-completion uses pkg-config to determine the best installation
>> directory, but this does not take --prefix into account (although it
>> works fine with DESTDIR). The fallback value does attempt to set this
>> based on --prefix.
>>
>> The distcheck uses --prefix, though, which means when attempting to
>> install the results and bash-completion support for pkg-config was
>> detected, it errors out on trying to write to, usually, /usr/share.
>>
>> Tell distcheck to use the prefix-based fallback location instead, as the
>> PKG_CHECK_* override.
>>
> 
> What has changed here?   "make distcheck" has been working for me...
> What configure line do you use to generate the error?

It's a fun error! You only get it when you *do* have bash-completion
installed, since then we rely directly on the pkg-config file to
determine where to install things to.

That's why we need to override it when the pkg-config specified
directory is not writable by the distcheck user.

Of course, the other solution would be if distcheck used DESTDIR instead
of specifying a custom --prefix, but this is enforced by autotools...

Patch

diff --git a/Makefile.am b/Makefile.am
index 85be82b4..1e9ee152 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,8 @@  ACLOCAL_AMFLAGS = -I m4 --install
 AM_MAKEFLAGS = --no-print-directory
 
 # Make sure we test and build manpages when doing distcheck
-DISTCHECK_CONFIGURE_FLAGS = --enable-doc --disable-git-version
+DISTCHECK_CONFIGURE_FLAGS = --enable-doc --disable-git-version \
+		bashcompdir='$${prefix}/share/bash-completion/completions'
 
 # Some files automatically included, so they aren't specified below:
 #   AUTHORS, COPYING, NEWS, README