summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conikost@gentoo.org>2020-11-29 19:48:02 +0100
committerConrad Kostecki <conikost@gentoo.org>2020-11-29 19:48:26 +0100
commita953d9771f23a7f2646bdd23e7c194a5a5428fbd (patch)
treec3eb180c34db00c08f624e72a22e5fdc8cf4bdde /dev-lua/mpack
parentdev-lua/mpack: drop old version (diff)
downloadgentoo-a953d9771f23a7f2646bdd23e7c194a5a5428fbd.tar.gz
gentoo-a953d9771f23a7f2646bdd23e7c194a5a5428fbd.tar.bz2
gentoo-a953d9771f23a7f2646bdd23e7c194a5a5428fbd.zip
dev-lua/mpack: bump to version 1.0.8 (non slotted lua)
Package-Manager: Portage-3.0.9, Repoman-3.0.2 Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'dev-lua/mpack')
-rw-r--r--dev-lua/mpack/mpack-1.0.8.ebuild71
1 files changed, 71 insertions, 0 deletions
diff --git a/dev-lua/mpack/mpack-1.0.8.ebuild b/dev-lua/mpack/mpack-1.0.8.ebuild
new file mode 100644
index 000000000000..d43aed70bcc8
--- /dev/null
+++ b/dev-lua/mpack/mpack-1.0.8.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MY_PN="lib${PN}-lua"
+
+inherit toolchain-funcs
+
+DESCRIPTION="Lua bindings for libmpack"
+HOMEPAGE="https://github.com/libmpack/libmpack/"
+SRC_URI="https://github.com/${MY_PN/-lua/}/${MY_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="luajit test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ dev-libs/libmpack
+ luajit? ( >=dev-lang/lua-5.1:= )
+ !luajit? ( dev-lang/luajit:2= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ virtual/pkgconfig
+ test? (
+ dev-lua/busted
+ ${RDEPEND}
+ )
+"
+
+src_compile() {
+ local myemakeargs=(
+ "CC=$(tc-getCC)"
+ "LUA_INCLUDE=$($(tc-getPKG_CONFIG) --cflags $(usex luajit 'luajit' 'lua'))"
+ "LUA_LIB=$($(tc-getPKG_CONFIG) --libs $(usex luajit 'luajit' 'lua'))"
+ "USE_SYSTEM_MPACK=yes"
+ "USE_SYSTEM_LUA=yes"
+ )
+
+ emake "${myemakeargs[@]}"
+}
+
+src_test() {
+ if use luajit; then
+ # "[ FAILED ] test.lua @ 279: mpack should not leak memory"
+ # It doesn't seem upstream actually support LuaJIT so were this up to me
+ # I would drop it from LUA_COMPAT, unfortunately there are packages in the
+ # tree which currently expect it to be supported.
+ ewarn "Not running tests under ${ELUA} because they are known to fail"
+ return
+ else
+ busted --lua=lua test.lua || die
+ fi
+}
+
+src_install() {
+ local myemakeargs=(
+ "DESTDIR=${ED}"
+ "LUA_CMOD_INSTALLDIR=$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD $(usex luajit 'luajit' 'lua'))"
+ "USE_SYSTEM_MPACK=yes"
+ "USE_SYSTEM_LUA=yes"
+ )
+
+ emake "${myemakeargs[@]}" install
+
+ einstalldocs
+}