fennel-0.5.0.ebuild 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # Copyright 2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. LUA_COMPAT=( lua5-{1..4} luajit )
  5. inherit lua optfeature
  6. DESCRIPTION="Lua Lisp Language"
  7. HOMEPAGE="
  8. https://fennel-lang.org/
  9. https://github.com/bakpakin/Fennel
  10. "
  11. SRC_URI="
  12. https://github.com/bakpakin/${PN}/archive/refs/tags/${PV}.tar.gz
  13. -> ${P}.tar.gz
  14. "
  15. LICENSE="MIT"
  16. SLOT="0"
  17. KEYWORDS="amd64 arm ppc x86 ~amd64-linux ~x86-linux"
  18. REQUIRED_USE="${LUA_REQUIRED_USE}"
  19. RDEPEND="
  20. ${LUA_DEPS}
  21. app-eselect/eselect-lua
  22. "
  23. DEPEND="${RDEPEND}"
  24. S="${WORKDIR}/$(
  25. f="${PN::1}"
  26. printf '%s' "${f^^}${P:1}"
  27. )"
  28. src_prepare() {
  29. default
  30. lua_copy_sources
  31. }
  32. lua_src_compile() {
  33. cd "${BUILD_DIR}" || die
  34. emake "${PN}"
  35. }
  36. src_compile() {
  37. lua_foreach_impl lua_src_compile
  38. }
  39. lua_src_install() {
  40. cd "${BUILD_DIR}" || die
  41. insinto "$(lua_get_lmod_dir)"
  42. doins *.lua
  43. }
  44. src_install() {
  45. local DOCS=( [^C]*.md ) # skip CODE-OF-CONDUCT and CONTRIBUTING
  46. lua_foreach_impl lua_src_install
  47. einstalldocs
  48. (
  49. set -eo pipefail
  50. for dir in "${WORKDIR}/${P}"-*; do :; done
  51. cd "${dir}"
  52. sed '1,1s;^.*$;#!/usr/bin/lua;' ./fennel \
  53. | newbin /proc/self/fd/0 "${PN}"
  54. ) || die
  55. }
  56. pkg_postinst() {
  57. optfeature "readline support" dev-lua/readline
  58. }