From 625ce231e7a3bcfa89269f6a9532f04fdadc3a16 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Tue, 16 May 2017 15:19:01 -0700 Subject: [PATCH] Use pkg-config for FISHDIR/BASHDIR It looks like zsh doesn't have a pkg-config file so we can't use it for ZSHDIR. Fixes #179. --- Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index deaf810..c0a09b0 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,15 @@ DESTDIR = PREFIX = /usr/local -BASHDIR = $(PREFIX)/etc/bash_completion.d +override define compdir +ifndef $(1) +$(1) := $$(or $$(shell pkg-config --variable=completionsdir $(2) 2>/dev/null),$(3)) +endif +endef + +$(eval $(call compdir,BASHDIR,bash-completion,$(PREFIX)/etc/bash_completion.d)) ZSHDIR = /usr/share/zsh/vendor-completions -FISHDIR = $(PREFIX)/share/fish/vendor_completions.d +$(eval $(call compdir,FISHDIR,fish,$(PREFIX)/share/fish/vendor_completions.d)) FEATURES ?= default