diff Makefile @ 31142:408dcf7475a7

osx: install bash and zsh completions by default The zsh location appears to be on the default $fpath for zsh. bash, on the other hand, appears to have no default location for completion scripts, so we follow the lead of Apple's Git distribution and select a semi-arbitrary place in /usr/local for the file.
author Augie Fackler <augie@google.com>
date Mon, 06 Feb 2017 15:19:32 -0500
parents e4492d55fb66
children 8e516f71577a
line wrap: on
line diff
--- a/Makefile	Thu Mar 02 10:12:40 2017 -0800
+++ b/Makefile	Mon Feb 06 15:19:32 2017 -0500
@@ -163,6 +163,16 @@
 	  --root=build/mercurial/ --prefix=/usr/local/ \
 	  --install-lib=/Library/Python/2.7/site-packages/
 	make -C doc all install DESTDIR="$(PWD)/build/mercurial/"
+        # install zsh completions - this location appears to be
+        # searched by default as of macOS Sierra.
+	mkdir -p build/mercurial/usr/local/share/zsh/site-functions
+	cp contrib/zsh_completion build/mercurial/usr/local/share/zsh/site-functions/hg
+        # install bash completions - there doesn't appear to be a
+        # place that's searched by default for bash, so we'll follow
+        # the lead of Apple's git install and just put it in a
+        # location of our own.
+	mkdir -p build/mercurial/usr/local/hg/contrib
+	cp contrib/bash_completion build/mercurial/usr/local/hg/contrib/hg-completion.bash
 	mkdir -p $${OUTPUTDIR:-dist}
 	HGVER=$$((cat build/mercurial/Library/Python/2.7/site-packages/mercurial/__version__.py; echo 'print(version)') | python) && \
 	OSXVER=$$(sw_vers -productVersion | cut -d. -f1,2) && \