app-misc/lf: add 42

adds BDEPEND for the minimum go version
adds proper src_test phase

Signed-off-by: ingenarel (NeoJesus) <ingenarel_neojesus@disroot.org>
This commit is contained in:
ingenarel (NeoJesus) committed 2026-09-22 07:37:10 +06:00
1 parent d4e503af5f
commit 46f3640e47
2 files changed
+82

No files matched your search

+2
View File
@@ -4,3 +4,5 @@ DIST lf-38-deps.tar.xz 17984560 BLAKE2B 3600702f2c1fb9cbd1f2d97efd65c87a2429ff2b
DIST lf-38.tar.gz 179583 BLAKE2B e960d7e2196bed001fd6f5b4436c2ebf9f364b00d7d950bb1677e579371e2ed0f69fe283d6193d840bfb5754e5723e97aa893dcac8484d89d88cb28b79c8849d SHA512 b9949b64fb658524a8cc71a4442fe89099ec3772aecb35154f2312ed078ad73c1f3a6da1cce6d99806700f46142450618b0fe8842039ae36d78642481de6b078
DIST lf-41-deps.tar.xz 17738296 BLAKE2B cadeb42181fafe603d13595f3b1a4ea892d3258e0ac5610938db24323a2f8aedf9b446da6acb7e8604808ecccd2b7dbfceb513bfaf908b869af9962276c58028 SHA512 10b97824e258ccaf79babb87b06ebb259e527d148b2381cacd713620419d0164c0ccd0030a81ddef661a6f7112d05987e1ebb0fd83754b2b65aca1a5d2a1f2a9
DIST lf-41.tar.gz 197515 BLAKE2B 93afe54572d82f537f03a7bbe8b7da6f1845b58a805d5259a8cb1918a3939af3f88cb408b01d703b1c314db8ae64456c88d0543b5d69feb44a720adc50f40661 SHA512 4a04991165daf408d883fc38bb7ac4f8405bb9f62b0c983c19a95708e9384fd82f621a0be2792bf2e819047e1f6a542624cf47d650a765f872a0b5b7cc80c8c4
DIST lf-42-deps.tar.xz 15932992 BLAKE2B 8a5220a4573654fe2ea81eada555aa6bf9b4387e3978569140f0405abce6bda99ed7a0c82501df71678da2561cd7de38bb27ba53b6a4e3c07078ef0e8f7126ed SHA512 aa46e15db3bcb977f1de45f81d946affb7bc11dc0c12e760ff5b22b3e936f66d36bc578fe788594011f33158b24be85bcd249a2223b95a21fbfbba502def7e13
DIST lf-42.tar.gz 205836 BLAKE2B 05675ecaaccb4488613fdbb2306d3e78388d5687ea391f83976cc79eec991994671e3659cbc765d28710698ae3a57986e0b47de98c6921501887ed9dfe098044 SHA512 59fb07bbc5de589378aa301dee2282f0ab0a5770f41c3c9e40cf45d9b25ff26eaef721c8b38e53883db2f149b33ea4cb641c17694bd359e9d43fa3cced539a3d
+80
View File
@@ -0,0 +1,80 @@
# Copyright 1999-2026 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
https://github.com/ingenarel/guru-depfiles/releases/download/${P}-deps.tar.xz/${P}-go-mod-deps.tar.xz ->
${P}-deps.tar.xz
"
S="${WORKDIR}/${PN}-r${PV}"
fi
LICENSE="MIT"
#gentoo-go-license lf-42.ebuild
LICENSE+=" Apache-2.0 BSD MIT "
# dependency licenses
SLOT="0"
IUSE="+static"
BDEPEND=">=dev-lang/go-1.25.0"
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_test(){
ego test ./...
}
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"
}