aboutsummaryrefslogtreecommitdiff
blob: d4053b39c425c20628b6e9b6a10efb4728b061db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{6,7,8} )

inherit autotools python-single-r1

DESCRIPTION="Dynamic modification of a user's environment via modulefiles"
HOMEPAGE="http://modules.sourceforge.net/"
SRC_URI="https://github.com/cea-hpc/modules/releases/download/v${PV}/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="compat test"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

DEPEND="
	${PYTHON_DEPS}
	dev-lang/tcl:0=
	dev-tcltk/tclx
	compat? ( x11-libs/libX11 )
"
RDEPEND="${DEPEND}"
BDEPEND="
	test? ( dev-util/dejagnu )
"

src_prepare() {
	default

	cd "${S}/lib" || die
	eautoreconf

	if use compat; then
		cd "${S}/compat" || die
		eautoreconf
	fi
}

src_configure() {
	local myconf=(
		--disable-versioning
		--prefix="${EPREFIX}/usr/share/Modules"
		--mandir="${EPREFIX}/usr/share/man"
		--docdir="${EPREFIX}/usr/share/doc/${P}"
		--libdir="${EPREFIX}/usr/share/Modules/$(get_libdir)"
		--datarootdir="${EPREFIX}/usr/share"
		--modulefilesdir="${EPREFIX}/etc/modulefiles"
		--with-tcl="${EPREFIX}/usr/$(get_libdir)"
		--with-python="${PYTHON}"
		$(use_enable compat compat-version)
	)
	./configure "${myconf[@]}" ${EXTRA_ECONF[@]} || die "configure failed"
}

src_install() {
	default
	dosym ../../usr/share/Modules/init/profile.sh /etc/profile.d/modules.sh
	dosym ../../usr/share/Modules/init/profile.csh /etc/profile.d/modules.csh
	dodir /etc/modulefiles
}