blob: 345900a6c31286cafda5d52c0889db754f7cadf6 (
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
65
66
67
68
|
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit go-module bash-completion-r1 desktop xdg-utils
SRC_URI="https://github.com/gokcehan/lf/archive/r${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://github.com/cantcuckthis/gentoo-lf/raw/main/${P}-deps.tar.xz"
DESCRIPTION="Terminal file manager"
HOMEPAGE="https://github.com/gokcehan/lf"
IUSE="+static"
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
LICENSE="MIT"
SLOT="0"
S="${WORKDIR}/${PN}-r${PV}"
src_compile() {
local ldflags="-s -w -X main.gVersion=r${PV}"
use static && {
export CGO_ENABLED=0
ldflags+=' -extldflags "-static"'
}
go build -ldflags="${ldflags}" || die 'go build failed'
}
src_install() {
local DOCS=( README.md etc/lfrc.example )
dobin "${PN}"
einstalldocs
doman "${PN}.1"
# bash & zsh cd script
insinto "/usr/share/${PN}"
doins "etc/${PN}cd.sh"
# bash-completion
newbashcomp "etc/${PN}.bash" "${PN}"
# zsh-completion
insinto /usr/share/zsh/site-functions
newins "etc/${PN}.zsh" "_${PN}"
# fish-completion
insinto /usr/share/fish/vendor_completions.d
doins "etc/${PN}.fish"
insinto /usr/share/fish/vendor_functions.d
doins "etc/${PN}cd.fish"
domenu "${PN}.desktop"
}
src_postinst() {
xdg_desktop_database_update
xdg_mimeinfo_database_update
}
src_postrm() {
xdg_desktop_database_update
xdg_mimeinfo_database_update
}
|