summaryrefslogtreecommitdiff
path: root/app-shells/fzf/fzf-0.74.3.ebuild
blob: c6e98fb5ebb740f2d95fb0f90669eb4d2b261430 (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
# Copyright 2019-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit go-module readme.gentoo-r1 shell-completion

DESCRIPTION="General-purpose command-line fuzzy finder, written in Golang"
HOMEPAGE="https://github.com/junegunn/fzf"

MY_GIT_REV=15f64c492a08f0840b81540c7d1de35737448086

SRC_URI="https://github.com/junegunn/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://github.com/gentoo-golang-dist/${PN}/releases/download/v${PV}/${P}-vendor.tar.xz"

LICENSE="MIT BSD-with-disclosure"
# Dependent licenses
LICENSE+=" BSD MIT"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~riscv ~x86"

src_compile() {
	local go_ldflags=(
		-X main.version=${PV}
		-X main.revision=${MY_GIT_REV:0:7}
	)
	ego build -trimpath -ldflags "${go_ldflags[*]}" -o bin/${PN} .
}

src_test() {
	ego test -v github.com/junegunn/fzf/src{,/algo,/tui,/util}
}

src_install() {
	dobin bin/${PN}
	doman man/man1/${PN}.1

	dobin bin/${PN}-tmux
	doman man/man1/${PN}-tmux.1

	newbashcomp shell/completion.bash ${PN}
	newzshcomp shell/completion.zsh _${PN}

	insinto /usr/share/vim/vimfiles/plugin
	doins plugin/${PN}.vim

	insinto /usr/share/nvim/runtime/plugin
	doins plugin/${PN}.vim

	insinto /usr/share/fzf
	doins shell/key-bindings.bash
	doins shell/key-bindings.fish
	doins shell/key-bindings.zsh

	readme.gentoo_create_doc
}

pkg_postinst() {
	readme.gentoo_print_elog
}