Skip to content

Commit

Permalink
pkg-config: Relative paths
Browse files Browse the repository at this point in the history
Define our completion and helper dirs using the standard data and sysconf
dirs. Enables 3rd party package staged installs by overriding these two
dirs, in addition to the already existing mechanisms.
  • Loading branch information
inigomartinez authored and scop committed Nov 11, 2019
1 parent 31b5cbc commit 8c53025
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
6 changes: 4 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SUBDIRS = completions doc helpers test
pkgdata_DATA = bash_completion

# Empty, but here just to get the compat dir created with install
compatdir = $(sysconfdir)/bash_completion.d
compat_DATA =

profiledir = $(sysconfdir)/profile.d
Expand All @@ -18,8 +19,9 @@ cmakeconfig_DATA = bash-completion-config.cmake \
%: %.in Makefile
$(SED) \
-e 's|@prefix[@]|$(prefix)|' \
-e 's|@compatdir[@]|$(compatdir)|' \
-e 's|@pkgdatadir[@]|$(pkgdatadir)|' \
-e 's|@datadir[@]|$(datadir)|' \
-e 's|@sysconfdir[@]|$(sysconfdir)|' \
-e 's|@PACKAGE[@]|$(PACKAGE)|' \
-e 's|@VERSION[@]|$(VERSION)|' \
<$(srcdir)/$@.in >$@

Expand Down
7 changes: 4 additions & 3 deletions bash-completion-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
set (BASH_COMPLETION_VERSION "@VERSION@")

set (BASH_COMPLETION_PREFIX "@prefix@")
set (BASH_COMPLETION_COMPATDIR "@compatdir@")
set (BASH_COMPLETION_COMPLETIONSDIR "@pkgdatadir@/completions")
set (BASH_COMPLETION_HELPERSDIR "@pkgdatadir@/helpers")

set (BASH_COMPLETION_COMPATDIR "@sysconfdir@/bash_completion.d")
set (BASH_COMPLETION_COMPLETIONSDIR "@datadir@/@PACKAGE@/completions")
set (BASH_COMPLETION_HELPERSDIR "@datadir@/@PACKAGE@/helpers")

set (BASH_COMPLETION_FOUND "TRUE")
9 changes: 6 additions & 3 deletions bash-completion.pc.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
prefix=@prefix@
compatdir=@compatdir@
completionsdir=@pkgdatadir@/completions
helpersdir=@pkgdatadir@/helpers
datadir=@datadir@
sysconfdir=@sysconfdir@

compatdir=${sysconfdir}/bash_completion.d
completionsdir=${datadir}/@PACKAGE@/completions
helpersdir=${datadir}/@PACKAGE@/helpers

Name: @PACKAGE@
Description: programmable completion for the bash shell
Expand Down
1 change: 0 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ AC_ARG_WITH([pytest],[ --with-pytest=executable],[PYTEST="$withval"])
if test -z "$PYTEST"; then
AC_CHECK_PROGS([PYTEST],[pytest pytest-3],[pytest])
fi
AC_SUBST(compatdir, $sysconfdir/bash_completion.d)
AC_CONFIG_FILES([
Makefile
completions/Makefile
Expand Down

0 comments on commit 8c53025

Please sign in to comment.