Files
guru/app-misc/lf/lf-9999.ebuild
ingenarel a5bc9e843d app-misc/lf: modify src_unpack() internally instead of redefining
functions should be defined on the order that they are called

for more info, check:
e19c6d5744 (commitcomment-172006236)

Signed-off-by: ingenarel <ingenarelitems@gmail.com>
2025-12-10 07:44:45 +06:00

73 lines
1.4 KiB
Bash

# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit go-module shell-completion desktop xdg
DESCRIPTION="Terminal file manager"
HOMEPAGE="https://github.com/gokcehan/lf"
if [[ "${PV}" == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI="https://github.com/gokcehan/lf.git"
else
KEYWORDS="~amd64 ~arm ~arm64 ~x86"
SRC_URI="https://github.com/gokcehan/${PN}/archive/refs/tags/r${PV}.tar.gz -> ${P}.tar.gz"
# possible depfiles link if used
SRC_URI+=" https://github.com/ingenarel/guru-depfiles/releases/download/${P}-deps.tar.xz/${P}-deps.tar.xz"
S="${WORKDIR}/${PN}-r${PV}"
fi
LICENSE="MIT"
# dependency licenses:
LICENSE+=" Apache-2.0 BSD MIT "
SLOT="0"
IUSE="+static"
src_unpack() {
if [[ "${PV}" == 9999 ]];then
git-r3_src_unpack
go-module_live_vendor
else
default
fi
}
src_compile() {
local ldflags="-w -X main.gVersion=r${PV}"
use static && {
export CGO_ENABLED=0
ldflags+=' -extldflags "-static"'
}
ego build -ldflags="${ldflags}"
}
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}"
bashcomp_alias lf lfcd
# zsh-completion
newzshcomp "etc/${PN}.zsh" "_${PN}"
# fish-completion
dofishcomp "etc/${PN}.fish"
dofishcomp "etc/${PN}cd.fish"
domenu "${PN}.desktop"
}