lf-24.ebuild 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. inherit go-module bash-completion-r1
  5. EGO_SUM=(
  6. "github.com/gdamore/encoding v1.0.0"
  7. "github.com/gdamore/encoding v1.0.0/go.mod"
  8. "github.com/gdamore/tcell/v2 v2.3.1"
  9. "github.com/gdamore/tcell/v2 v2.3.1/go.mod"
  10. "github.com/lucasb-eyer/go-colorful v1.0.3"
  11. "github.com/lucasb-eyer/go-colorful v1.0.3/go.mod"
  12. "github.com/mattn/go-runewidth v0.0.10"
  13. "github.com/mattn/go-runewidth v0.0.10/go.mod"
  14. "github.com/rivo/uniseg v0.1.0"
  15. "github.com/rivo/uniseg v0.1.0/go.mod"
  16. "golang.org/x/sys v0.0.0-20201119102817-f84b799fce68"
  17. "golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod"
  18. "golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod"
  19. "golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d"
  20. "golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod"
  21. "golang.org/x/text v0.3.0"
  22. "golang.org/x/text v0.3.0/go.mod"
  23. "gopkg.in/djherbis/times.v1 v1.2.0"
  24. "gopkg.in/djherbis/times.v1 v1.2.0/go.mod"
  25. )
  26. go-module_set_globals
  27. SRC_URI="https://github.com/gokcehan/lf/archive/r${PV}.tar.gz -> ${P}.tar.gz
  28. ${EGO_SUM_SRC_URI}"
  29. DESCRIPTION="Terminal file manager"
  30. HOMEPAGE="https://github.com/gokcehan/lf"
  31. IUSE="+static X"
  32. KEYWORDS="amd64 ~arm arm64 ppc64 ~s390 x86"
  33. LICENSE="MIT"
  34. SLOT="0"
  35. S="${WORKDIR}/${PN}-r${PV}"
  36. src_compile() {
  37. local ldflags="-s -w -X main.gVersion=r${PV}"
  38. use static && {
  39. export CGO_ENABLED=0
  40. ldflags+=' -extldflags "-static"'
  41. }
  42. go build -ldflags="${ldflags}" || die 'go build failed'
  43. }
  44. src_install() {
  45. local DOCS=( README.md etc/lfrc.example )
  46. dobin "${PN}"
  47. einstalldocs
  48. doman "${PN}.1"
  49. # bash & zsh
  50. insinto "/usr/share/${PN}"
  51. doins "etc/${PN}cd.sh"
  52. # bash-completion
  53. newbashcomp "etc/${PN}.bash" "${PN}"
  54. # zsh-completion
  55. insinto /usr/share/zsh/site-functions
  56. newins "etc/${PN}.zsh" "_${PN}"
  57. # fish-completion
  58. insinto /usr/share/fish/vendor_completions.d
  59. doins "etc/${PN}.fish"
  60. insinto /usr/share/fish/vendor_functions.d
  61. doins "etc/${PN}cd.fish"
  62. use X && {
  63. insinto /usr/share/applications
  64. doins "${PN}.desktop"
  65. }
  66. }