summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnafu2017-05-07 20:55:22 +0200
committersnafu2017-05-07 20:55:22 +0200
commitfdaa553f5d50882738184f3adfcd30f781a06044 (patch)
treee7a706f54d05903f78a3820f7739903a7980748b
parent25b8a3a9e6b347b6559633c2e61166a01ba7ccb2 (diff)
downloadaur-fdaa553f5d50882738184f3adfcd30f781a06044.tar.gz
zsh-completion patch
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD24
-rw-r--r--env-modules-tcl.install16
-rw-r--r--zshcomp.patch53
4 files changed, 104 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index dc9e4a9fb23b..2da76b978475 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -13,3 +13,21 @@ pkgbase = env-modules-tcl
pkgname = env-modules-tcl
+pkgbase = env-modules-tcl
+ pkgdesc = Provides for an easy dynamic modification of a user's environment via modulefile (tcl-only-version).
+ pkgver = 1.832
+ pkgrel = 4
+ url = https://sourceforge.net/projects/modules/
+ install = env-modules-tcl.install
+ arch = i686
+ arch = x86_64
+ license = GPLv2
+ checkdepends = dejagnu
+ depends = tcl>=7.4
+ source = https://sourceforge.net/projects/modules/files/Modules-Tcl/modules-tcl-1.832.tar.gz
+ source = zshcomp.patch
+ md5sums = 3a40bf6177cc438481672ce028544828
+ md5sums = 4b7a5d66a1668fac5b3837723edceea4
+
+pkgname = env-modules-tcl
+
diff --git a/PKGBUILD b/PKGBUILD
index 477063c36b8b..f46f03b23e95 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Your Name <youremail@domain.com>
pkgname=env-modules-tcl
pkgver=1.832
-pkgrel=3
+pkgrel=4
epoch=
pkgdesc="Provides for an easy dynamic modification of a user's environment via modulefile (tcl-only-version)."
arch=('i686' 'x86_64')
@@ -19,14 +19,25 @@ backup=()
options=()
install=
changelog=
-source=("https://sourceforge.net/projects/modules/files/Modules-Tcl/modules-tcl-$pkgver.tar.gz")
-md5sums=('3a40bf6177cc438481672ce028544828')
+source=("https://sourceforge.net/projects/modules/files/Modules-Tcl/modules-tcl-$pkgver.tar.gz" "zshcomp.patch")
noextract=()
validpgpkeys=()
+install="env-modules-tcl.install"
+md5sums=('3a40bf6177cc438481672ce028544828'
+ '4b7a5d66a1668fac5b3837723edceea4')
+
+install_prefix=/usr
build() {
cd modules-tcl-$pkgver
- ./configure --prefix=/usr --disable-set-binpath --disable-set-manpath
+ patch -p1 < ../zshcomp.patch
+ ./configure \
+ --prefix=$install_prefix \
+ --docdir=$install_prefix/doc/modules-tcl \
+ --initdir=$install_prefix/env-modules/init \
+ --modulefilesdir=$install_prefix/env-modules/modulefiles \
+ --disable-set-binpath --disable-set-manpath
+
make
}
@@ -36,7 +47,6 @@ package() {
_profiled="$pkgdir/etc/profile.d/"
mkdir -p "$_profiled"
- ln -s /usr/init/profile.csh $_profiled/env-modules-tcl.csh
- ln -s /usr/init/profile.sh $_profiled/env-modules-tcl.sh
+ ln -s $install_prefix/env-modules/init/profile.csh $_profiled/env-modules-tcl.csh
+ ln -s $install_prefix/env-modules/init/profile.sh $_profiled/env-modules-tcl.sh
}
-
diff --git a/env-modules-tcl.install b/env-modules-tcl.install
new file mode 100644
index 000000000000..59d6bb759ff1
--- /dev/null
+++ b/env-modules-tcl.install
@@ -0,0 +1,16 @@
+
+post_install() {
+ echo ""
+ echo "ZSH: For the use of module-cmd in a none-login Z-shell enviroment"
+ echo "the following entry should be added to the zshrc "
+ echo "(or zshenv if the module-cmd should be available in shell-scripts)"
+ echo ""
+ echo " (( \${+functions[module]} )) || source /usr/env-modules/init/zsh"
+ echo ""
+}
+
+post_upgrade() {
+ post_install
+}
+
+
diff --git a/zshcomp.patch b/zshcomp.patch
new file mode 100644
index 000000000000..aae7debcca3d
--- /dev/null
+++ b/zshcomp.patch
@@ -0,0 +1,53 @@
+--- modules-tcl-1.832/init/zsh.in 2017-04-29 08:23:22.000000000 +0200
++++ modules-tcl-1.832-patched/init/zsh.in 2017-05-07 18:41:21.812267826 +0200
+@@ -83,3 +83,48 @@
+ if [ -r @initdir@/modulerc -a "$MODULEPATH" = '' -a "$LOADEDMODULES" = '' ]; then
+ source @initdir@/modulerc
+ fi
++
++# zsh-completion function, improves the standard zsh-completion (_module):
++# - support for symlinks
++# - directory-wise completion
++function _module_completion () {
++ local _module_path_prefix
++ local -a _module_search_path _module_type_d _module_type_f
++ _module_path_prefix=$(echo ${words[$CURRENT]} | sed -ne 's#\(.*/\).*#\1#p')
++ _module_search_paths=(${^${(@s/:/)MODULEPATH}}/$_module_path_prefix)
++
++ _module_type_d=()
++ _module_type_f=()
++ eval $(find $_module_search_paths -mindepth 1 -maxdepth 1 -not -name '.modulerc' -not -name '.version' -printf "_module_type_%Y+=${_module_path_prefix}%P\n" 2> /dev/null)
++
++ if [[ "$@" != "dir" ]]; then
++ compadd -q -S / ${_module_type_d}
++ compadd ${_module_type_f}
++ else
++ compadd ${_module_type_d}
++ fi
++}
++
++# module avail should only complete directories
++function _module_avail {
++ _module_completion dir
++}
++
++# all the other use the full completion:
++local -a _module_complete_functions=( \
++ _module_help \
++ _module_load \
++ _module_switch \
++ _module_display \
++ _module_whatis \
++ _module_initadd \
++ _module_initprepend \
++ _module_initrm \
++ _module_initswitch \
++)
++
++for _module_complete_function in $_module_complete_functions ; do
++ $_module_complete_function () {
++ _module_completion
++ }
++done
++
++# vim: syntax=zsh