logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

luarocks-2.4.4.ebuild (1587B)


  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Copyright 2019 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
  3. # Distributed under the terms of the GNU General Public License v2
  4. EAPI=6
  5. inherit lua
  6. DESCRIPTION="A deployment and management system for Lua modules"
  7. HOMEPAGE="https://www.luarocks.org"
  8. SRC_URI="https://luarocks.org/releases/${P}.tar.gz"
  9. LICENSE="MIT"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~ppc ~x86"
  12. IUSE="curl openssl libressl"
  13. DEPEND="
  14. curl? ( net-misc/curl )
  15. !curl? ( net-misc/wget )
  16. openssl? (
  17. !libressl? ( dev-libs/openssl:0= )
  18. libressl? ( dev-libs/libressl:= )
  19. )
  20. !openssl? ( sys-apps/coreutils )
  21. "
  22. RDEPEND="
  23. ${DEPEND}
  24. app-arch/unzip
  25. "
  26. all_lua_prepare() {
  27. # Don't die on gentoo's econf calls!
  28. sed -r \
  29. -e "/die.*Unknown flag:/d" \
  30. -i configure
  31. lua_default
  32. }
  33. each_lua_configure() {
  34. local md5 downloader lua incdir
  35. md5="md5sum"
  36. downloader="wget"
  37. lua="$(lua_get_lua)"
  38. incdir=$(lua_get_pkgvar includedir)
  39. use curl && downloader="curl"
  40. use openssl && md5="openssl"
  41. myeconfargs=()
  42. myeconfargs+=(
  43. --prefix=/usr
  44. --with-lua=/usr
  45. --with-lua-lib="/usr/$(get_libdir)"
  46. --rocks-tree=/usr
  47. --with-downloader="${downloader}"
  48. --with-md5-checker="${md5}"
  49. --lua-suffix="${lua//lua}"
  50. --lua-version="$(lua_get_abi)"
  51. --with-lua-include="${incdir}"
  52. --sysconfdir=/etc/${PN}
  53. )
  54. lua_default
  55. }
  56. each_lua_compile() {
  57. lua_default build
  58. }
  59. pkg_preinst() {
  60. local abi="$(lua_get_abi)"
  61. find "${D}" -type f | xargs sed -e "s:${D}::g" -i || die "sed failed"
  62. for l in luarocks{,-admin}; do
  63. rm "${D}/usr/bin/${l}"
  64. dosym "${l}-${abi}" "/usr/bin/${l}"
  65. done
  66. }