shithub: choc

Download patch

ref: b9d4c04c840321f5ec70787d8afb1256766aaa01
parent: 59e2dec77517ce76c245405c1b740e33c32a0598
author: Mike Swanson <mikeonthecomputer@gmail.com>
date: Tue Aug 6 11:40:46 EDT 2019

bash-completion: always install into $datadir/bash-completion

The bash-completion package by default searches in $HOME/.local and
/usr/local first before /usr, and we should respect local installation
locations instead of always trying to write to a path that is
accessible only to root and could conflict with a package manager.

This removes a toggle in the configure script, which neither actually
worked properly (setting DIR didn’t work) and I believe did the wrong
thing by default anyway.

--- a/configure.ac
+++ b/configure.ac
@@ -87,13 +87,6 @@
 AC_CHECK_LIB(i386, i386_iopl)
 AC_CHECK_LIB(amd64, amd64_iopl)
 
-AC_ARG_WITH([bashcompletiondir],
-    AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completion directory]),
-    [],
-    [AS_IF([$($PKG_CONFIG --exists bash-completion 2> /dev/null)],
-        [bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)],
-	[bashcompletiondir=${datadir}/bash-completion/completions])])
-
 case "$host" in
   *-*-mingw* | *-*-cygwin* | *-*-msvc* )
     AC_CHECK_TOOL(WINDRES, windres, )
@@ -152,8 +145,6 @@
 AC_SUBST(PACKAGE_URL)
 AC_SUBST(PACKAGE_RDNS)
 AC_SUBST(PACKAGE_ISSUES)
-
-AC_SUBST(bashcompletiondir)
 
 dnl Shut up the datarootdir warnings.
 AC_DEFUN([AC_DATAROOTDIR_CHECKED])
--- a/man/bash-completion/Makefile.am
+++ b/man/bash-completion/Makefile.am
@@ -1,4 +1,4 @@
-bashcompletiondir=@bashcompletiondir@
+bashcompletiondir=@datadir@/bash-completion/completions
 
 BASH_COMPLETION_TEMPLATES = \
     doom.template \