readline-3.0.ebuild 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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 flag-o-matic lua toolchain-funcs
  6. DESCRIPTION="Interface to the readline library"
  7. HOMEPAGE="http://pjb.com.au/comp/lua/readline.html"
  8. SRC_URI="http://www.pjb.com.au/comp/lua/${P}.tar.gz -> lua-${P}.tar.gz"
  9. LICENSE="MIT"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux"
  12. RDEPEND="
  13. ${LUA_DEPS}
  14. sys-libs/readline
  15. >=dev-lua/luaposix-30[${LUA_USEDEP}]
  16. "
  17. DEPEND="${RDEPEND}"
  18. BDEPEND="virtual/pkgconfig"
  19. REQUIRED_USE="${LUA_REQUIRED_USE}"
  20. src_prepare() {
  21. default
  22. lua_copy_sources
  23. }
  24. cc_info() {
  25. tc-export_build_env
  26. local cflags=(
  27. ${BUILD_CFLAGS}
  28. ${BUILD_LDFLAGS}
  29. ${BUILD_CPPFLAGS}
  30. $(lua_get_LIBS)
  31. "-I$(lua_get_include_dir)"
  32. )
  33. set -- "$(tc-getCC)" -fPIC -shared "${cflags[@]}" "${@}"
  34. einfo "${*}"
  35. "${@}"
  36. }
  37. lua_src_compile() (
  38. cd "${BUILD_DIR}" || die
  39. local pkgconf=(
  40. $(
  41. "$(tc-getPKG_CONFIG)" --libs --cflags-only-I "${PN}"
  42. )
  43. )
  44. filter-flags -fPIE -fpie
  45. cc_info "${pkgconf[@]}" "C-${PN}.c" -o "C-${PN}.so"
  46. )
  47. src_compile() {
  48. lua_foreach_impl lua_src_compile
  49. }
  50. lua_src_install() (
  51. cd "${BUILD_DIR}" || die
  52. exeinto "$(lua_get_cmod_dir)"
  53. doexe *.so
  54. insinto "$(lua_get_lmod_dir)"
  55. doins *.lua
  56. )
  57. src_install() {
  58. local DOCS=( doc/* )
  59. lua_foreach_impl lua_src_install
  60. einstalldocs
  61. }