]> granicus.if.org Git - curl/commitdiff
configure: fix default location for fish completions
authorEli Schwartz <eschwartz@archlinux.org>
Wed, 3 Apr 2019 00:43:29 +0000 (20:43 -0400)
committerDaniel Gustafsson <daniel@yesql.se>
Fri, 5 Apr 2019 11:26:46 +0000 (13:26 +0200)
Fish defines a vendor completions directory for completions that are not
installed as part of the fish project itself, and the vendor completions
are preferred if they exist. This prevents trying to overwrite the
builtin curl.fish completion (or creating file conflicts in distro
packaging).

Prefer the pkg-config defined location exported by fish, if it can be
found, and fall back to the correct directory defined by most systems.

Closes #3723
Reviewed-by: Daniel Gustafsson
configure.ac

index d8a4736e54150e872c17e4577734fa08c3181475..00fef948918cb9649531f71356f2f29b17d664c4 100755 (executable)
@@ -3479,7 +3479,12 @@ case "$OPT_FISH_FPATH" in
     ;;
   default|yes)
     dnl --with-fish-functions-dir option used without path
-    FISH_FUNCTIONS_DIR="$datarootdir/fish/completions"
+    CURL_CHECK_PKGCONFIG(fish)
+    if test "$PKGCONFIG" != "no" ; then
+      FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
+    else
+      FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
+    fi
     AC_SUBST(FISH_FUNCTIONS_DIR)
     ;;
   *)