teal-9999.ebuild 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 2024 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=8
  4. MY_PN="tl"
  5. LUA_COMPAT=( lua5-{1..4} luajit )
  6. inherit lua-single
  7. DESCRIPTION="The compiler for Teal, a typed dialect of Lua"
  8. HOMEPAGE="
  9. https://github.com/teal-language/tl
  10. https://github.com/teal-language
  11. "
  12. if [ "${PV}" = 9999 ]; then
  13. inherit git-r3
  14. EGIT_BRANCH='next'
  15. EGIT_REPO_URI="https://github.com/${PN}-language/${MY_PN}"
  16. else
  17. SRC_URI="https://github.com/${PN}-language/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  18. S="${WORKDIR}/${MY_PN}-${PV}"
  19. KEYWORDS="amd64"
  20. fi
  21. LICENSE="MIT"
  22. SLOT="0"
  23. REQUIRED_USE="${LUA_REQUIRED_USE}"
  24. DEPEND="
  25. ${LUA_DEPS}
  26. $(lua_gen_cond_dep '
  27. >=dev-lua/compat53-0.11[${LUA_USEDEP}]
  28. dev-lua/lua-argparse[${LUA_USEDEP}]
  29. dev-lua/luafilesystem[${LUA_USEDEP}]
  30. ')
  31. "
  32. RDEPEND="${DEPEND}"
  33. src_prepare() {
  34. default
  35. # change shebang
  36. sed -i "./${MY_PN}" \
  37. -e '1s;^.*$;#!'"${LUA}"';'
  38. }
  39. src_compile() {
  40. emake selfbuild
  41. }
  42. src_install() {
  43. local DOCS=( docs/*.md )
  44. dobin "./${MY_PN}"
  45. insinto "$(lua_get_lmod_dir)"
  46. doins "./${MY_PN}.lua"
  47. einstalldocs
  48. }