summaryrefslogtreecommitdiff
path: root/app-shells/direnv/direnv-2.34.0-r0.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'app-shells/direnv/direnv-2.34.0-r0.ebuild')
-rw-r--r--app-shells/direnv/direnv-2.34.0-r0.ebuild48
1 files changed, 48 insertions, 0 deletions
diff --git a/app-shells/direnv/direnv-2.34.0-r0.ebuild b/app-shells/direnv/direnv-2.34.0-r0.ebuild
new file mode 100644
index 0000000..e34d8f7
--- /dev/null
+++ b/app-shells/direnv/direnv-2.34.0-r0.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit go-module greadme
+
+DESCRIPTION="Environment variable manager for shell"
+HOMEPAGE="https://github.com/direnv/direnv"
+SRC_URI="https://github.com/direnv/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+SRC_URI+=" https://share.terinstock.com/${P}-vendor.tar.xz"
+
+LICENSE="MIT"
+LICENSE+=" BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+RESTRICT="test" # fails
+
+src_prepare() {
+ default
+ sed -i -e "/selfPath, err/cselfPath := \"${EPREFIX}/usr/bin/direnv\"" internal/cmd/cmd_hook.go || die
+}
+
+src_compile() {
+ emake all
+
+ mkdir shell-init || die
+ for shell in bash zsh fish elvish pwsh tcsh; do
+ ./direnv hook ${shell} > shell-init/${shell} || die
+ done
+}
+
+src_install() {
+ einstalldocs
+ emake DESTDIR="${ED}" PREFIX="/usr" install
+
+ insinto "/usr/share/${PN}"
+ doins -r shell-init
+
+ greadme_stdin <<-EOF
+ Gentoo installs direnv's shell-init code under
+ /usr/share/direnv/shell-init/
+ Therefore, instead of using, e.g. 'eval \"\$(direnv hook zsh)\"' in
+ your .zshrc you can put \"source /usr/share/direnv/shell-init/zsh\"
+ there, which avoids the cost of forking a process. Although direnv
+ does that a lot anyways.
+EOF
+}