lf-32.ebuild 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. https://github.com/dm9pZCAq/gentoo-go-deps/releases/download/${P}/${P}-vendor.tar.xz
  11. "
  12. S="${WORKDIR}/${PN}-r${PV}"
  13. LICENSE="MIT"
  14. SLOT="0"
  15. KEYWORDS="amd64 ~arm arm64 ppc64 ~s390 x86"
  16. IUSE="+static X"
  17. src_compile() {
  18. local ldflags="-s -w -X main.gVersion=r${PV}"
  19. use static && {
  20. export CGO_ENABLED=0
  21. ldflags+=' -extldflags "-static"'
  22. }
  23. ego build -ldflags="${ldflags}" || die 'go build failed'
  24. }
  25. src_install() {
  26. local DOCS=( README.md etc/{{color,icon}s,lfrc}.example )
  27. dobin "${PN}"
  28. einstalldocs
  29. doman "${PN}.1"
  30. # bash & zsh
  31. insinto "/usr/share/${PN}"
  32. doins "etc/${PN}cd.sh"
  33. newbashcomp "etc/${PN}.bash" "${PN}"
  34. dofishcomp "etc/${PN}.fish"
  35. dofishcomp "etc/${PN}cd.fish"
  36. newzshcomp "etc/${PN}.zsh" "_${PN}"
  37. use X && domenu "${PN}.desktop"
  38. }