Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] Document where third-party completion functions should be installed.



---
This question comes up somewhat regularly when third parties write
completion functions that they ship themselves.

33113 answered this question by adding /usr/local/share/zsh/site-functions/ to
the default $fpath unconditionally.  That is different to what this patch
recommends, but I think the process this patch describes is standard.  For
example, Oliver points out that this is how man pages are handled: they get
installed to $prefix/share/man/ of their package, and after installation one
needs to tell man(1) about that location separately, by setting $MANPATH.  The
same goes for executables (add $prefix/bin to $PATH), include files (add
$prefix/include to $CFLAGS), shared libraries (add $prefix/lib to $LDFLAGS),
etc..

Cheers,

Daniel


 INSTALL | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/INSTALL b/INSTALL
index cf70893a7..a85a40a24 100644
--- a/INSTALL
+++ b/INSTALL
@@ -251,6 +251,16 @@ source code in the directory that "configure" is in.  For example,
 Note that this is mutually exclusive with using the source directories
 as make can become confused by build files created in the source directories.
 
+Writing third-party autoloadable functions
+------------------------------------------
+
+Third-party autoloadable functions, including but not limited to completion
+functions, should be installed into the share/zsh/site-functions/ directory
+under the respective installation prefix.  That would typically be written as
+$(DESTDIR)$(PREFIX)/share/zsh/site-functions/ in a makefile.  If the
+third-party tool's $(PREFIX) is not the same as zsh's prefix, then that
+directory should be added to $fpath in zsh's initialization files.
+
 
 ================================
 AUTOMATIC NEW USER CONFIGURATION



Messages sorted by: Reverse Date, Date, Thread, Author