mpack-1.0.3.ebuild 1012 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit toolchain-funcs
  5. DESCRIPTION="Lua bindings for libmpack"
  6. HOMEPAGE="https://github.com/tarruda/libmpack/"
  7. SRC_URI="https://github.com/tarruda/libmpack/archive/${PV}.tar.gz -> ${P}.tar.gz"
  8. S="${WORKDIR}/libmpack-${PV}/binding/lua"
  9. LICENSE="MIT"
  10. SLOT="0"
  11. KEYWORDS="~amd64"
  12. IUSE="luajit test"
  13. RDEPEND="!luajit? ( >=dev-lang/lua-5.1:= )
  14. luajit? ( dev-lang/luajit:2= )"
  15. DEPEND="${RDEPEND}
  16. virtual/pkgconfig
  17. test? ( dev-lua/busted )"
  18. src_compile() {
  19. emake \
  20. CC="$(tc-getCC)" \
  21. USE_SYSTEM_LUA=yes \
  22. LUA_INCLUDE="$($(tc-getPKG_CONFIG) --cflags $(usex luajit 'luajit' 'lua'))" \
  23. LUA_LIB="$($(tc-getPKG_CONFIG) --libs $(usex luajit 'luajit' 'lua'))"
  24. }
  25. src_test() {
  26. busted -o gtest test.lua || die
  27. }
  28. src_install() {
  29. emake \
  30. DESTDIR="${D}" \
  31. USE_SYSTEM_LUA=yes \
  32. LUA_CMOD_INSTALLDIR="$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD $(usex luajit 'luajit' 'lua'))" \
  33. install
  34. }