lf-33.ebuild 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Copyright 2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. inherit desktop go-module shell-completion
  5. DESCRIPTION="Terminal file manager"
  6. HOMEPAGE="https://github.com/gokcehan/lf"
  7. SRC_URI="
  8. https://github.com/gokcehan/lf/archive/r${PV}.tar.gz -> ${P}.tar.gz
  9. https://github.com/dm9pZCAq/gentoo-go-deps/releases/download/${P}/${P}-deps.tar.xz
  10. "
  11. S="${WORKDIR}/${PN}-r${PV}"
  12. LICENSE="MIT"
  13. SLOT="0"
  14. KEYWORDS="amd64 ~arm arm64 ppc64 ~s390 x86"
  15. IUSE="+static X"
  16. src_compile() {
  17. local ldflags="-s -w -X main.gVersion=r${PV}"
  18. use static && {
  19. export CGO_ENABLED=0
  20. ldflags+=' -extldflags "-static"'
  21. }
  22. ego build -ldflags="${ldflags}" || die 'go build failed'
  23. }
  24. src_install() {
  25. local DOCS=( README.md etc/{{color,icon}s,lfrc}.example )
  26. dobin "${PN}"
  27. einstalldocs
  28. doman "${PN}.1"
  29. # bash & zsh
  30. insinto "/usr/share/${PN}"
  31. doins "etc/${PN}cd.sh"
  32. newbashcomp "etc/${PN}.bash" "${PN}"
  33. dofishcomp "etc/${PN}.fish"
  34. dofishcomp "etc/${PN}cd.fish"
  35. newzshcomp "etc/${PN}.zsh" "_${PN}"
  36. use X && domenu "${PN}.desktop"
  37. }