summaryrefslogtreecommitdiff
path: root/app-admin/chezmoi/chezmoi-2.73.1.ebuild
blob: fc7556501738381780140233589374e45d7d67da (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
# Copyright 2020-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module shell-completion

DESCRIPTION="Manage your dotfiles across multiple machines, securely"
HOMEPAGE="https://www.chezmoi.io/"
SRC_URI="
	https://github.com/twpayne/chezmoi/archive/v${PV}.tar.gz -> ${P}.tar.gz
	https://github.com/iprok/distfiles/releases/download/${P}/${P}-vendor.tar.xz
"

LICENSE="BSD BSD-2 MIT Apache-2.0 MPL-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~x86"
RESTRICT="mirror"

BDEPEND+=" >=dev-lang/go-1.26.4"
DEPEND="dev-vcs/git"
RDEPEND="${DEPEND}"

src_compile() {
	ego build -o "${PN}" -ldflags "-X main.version=${PV}"
}

src_test() {
	# This regression test clones a repository from GitHub; keep tests offline.
	ego test -ldflags \
		"-X chezmoi.io/chezmoi/v2/internal/chezmoitest.umaskStr=0o022" \
		-skip '^TestScript$/^issue4647$' ./...
}

src_install() {
	dobin "${PN}"

	einstalldocs

	newbashcomp "completions/${PN}-completion.bash" "${PN}"
	dofishcomp "completions/${PN}.fish"
	newzshcomp "completions/${PN}.zsh" "_${PN}"
}