mpack-1.0.2.ebuild 891 B

123456789101112131415161718192021222324252627282930313233343536
  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. $(tc-getCC) ${CFLAGS} ${LDFLAGS} $($(tc-getPKG_CONFIG) --cflags $(usex luajit 'luajit' 'lua')) -fPIC -DPIC -shared lmpack.c -o mpack.so || die
  20. }
  21. src_test() {
  22. busted -o gtest test.lua || die
  23. }
  24. src_install() {
  25. exeinto "$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD $(usex luajit 'luajit' 'lua'))"
  26. doexe mpack.so
  27. }