Skip to content

Instantly share code, notes, and snippets.

@hcartiaux
Last active November 7, 2025 09:26
Show Gist options
  • Select an option

  • Save hcartiaux/0f32c3d1d05f8d15a77267b0146583e1 to your computer and use it in GitHub Desktop.

Select an option

Save hcartiaux/0f32c3d1d05f8d15a77267b0146583e1 to your computer and use it in GitHub Desktop.
env-modules PKGBUILD fixed
# Maintainer: snafu
# Contributor: Hyacinthe Cartiaux <hyacinthe dot cartiaux at free dot fr>
pkgname=env-modules
pkgver=5.6.0
pkgrel=2
pkgdesc="Provides for an easy dynamic modification of a user's environment via modulefile."
arch=('i686' 'x86_64')
url="https://envmodules.io/"
license=('GPL-2.0')
depends=('tcl>=8.5' 'procps')
makedepends=('less')
checkdepends=('dejagnu')
optdepends=('nagelfar' 'python-sphinx')
install=env-modules.install
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/envmodules/modules/releases/download/v${pkgver}/modules-${pkgver}.tar.gz")
sha256sums=('9dd78f1543012acd3a1a14ba86dc1dca8f7d176396ea3f0027a92dcf5ff2057c')
# Install locations:
install_prefix=/usr
config_path=/etc
profiled="/etc/profile.d"
moduledir=modules
backup=("${config_path:1}/${moduledir}/init/modulerc")
build() {
cd "modules-$pkgver"
conf=(
--prefix="" \
--bindir=/usr/bin \
--libdir=/usr/lib \
--libexecdir=/usr/lib/env-modules \
--etcdir=/etc \
--initdir=/etc/modules/init \
--with-initconf-in=initdir \
--with-moduleshome=/etc/modules \
--datarootdir=/usr/share \
--mandir=/usr/share/man \
--docdir=/usr/share/doc/$pkgname-$pkgver \
--vimdatadir=/usr/share/vim/vimfiles \
--modulefilesdir=/etc/modules/modulefiles \
--disable-set-binpath \
--disable-set-manpath \
--enable-example-modulefiles \
--enable-doc-install \
)
if type -p nagelfar > /dev/null; then
conf+=(
--with-tcl-linter=$(which nagelfar)
)
fi
./configure "${conf[@]}"
make
}
check() {
cd "modules-$pkgver"
# uncomment if you run into problems... takes quite a while
#make -j1 -k test
}
package() {
cd "modules-$pkgver"
make -j1 DESTDIR="$pkgdir/" install
_profiled="${pkgdir}${profiled}"
mkdir -p "$_profiled"
ln -s ../${moduledir}/init/profile.csh $_profiled/env-modules.csh
ln -s ../${moduledir}/init/profile.sh $_profiled/env-modules.sh
# Keep up with old versions:
ln -s ./perl.pm ${pkgdir}${config_path}/${moduledir}/init/perl
ln -s ./python.py ${pkgdir}${config_path}/${moduledir}/init/python
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment