diff options
Diffstat (limited to 'dev-lua/mpack')
-rw-r--r-- | dev-lua/mpack/Manifest | 2 | ||||
-rw-r--r-- | dev-lua/mpack/mpack-1.0.10.ebuild | 113 |
2 files changed, 115 insertions, 0 deletions
diff --git a/dev-lua/mpack/Manifest b/dev-lua/mpack/Manifest index e696d1d27c24..2f5e58bfa601 100644 --- a/dev-lua/mpack/Manifest +++ b/dev-lua/mpack/Manifest @@ -1,3 +1,5 @@ +DIST mpack-1.0.10.tar.gz 16256 BLAKE2B 56f279be5b84e89a18a6010320eff9f006cfba6df9621e7b4c338a866170a69589e9e50d0d7deb238ff40634f28aa4d0c43a135c6b7fa9a38ec41b8b669945cd SHA512 879e200d806a4aeb3dc31bf44781bb92b377ee86fe3050692179bff794a2748c175135e4ab5eb59f29202bd36ff27ecc26bab07d0c46c11414361f72abf3dc53 DIST mpack-1.0.9.tar.gz 16087 BLAKE2B 062f0deaa9ea359486933b5736591ea3ee78886e31259b721d88ef44762403185b881d076ca35fe6e8c16ab756d36698fec1ca893ab3667635e388456a8ad417 SHA512 c663a6cb29c1ae3f88baf25d36b076c35b35b96a16f9df472f8063009dc70886071cc27bf9224aceb86afb5c590ac072fd484435f40ecc4961eabfb5df08f395 +EBUILD mpack-1.0.10.ebuild 2302 BLAKE2B 2f8039340d91352998fd3a1a366edc12264c9816f1eaa27aa5cb200ad405847639d4f05ab48ec2c5a3dccf44e8a32a66b09668d8e47cd18f22fcc3ca44147a01 SHA512 98d2a1fe6aa9c22a4f74f43e1710d81cf1b78972b74e1d9d1ec7754ffe704f6421be2cc16e79fdcd0a4c29313794239b38d97d4a2af52cc544060d1b2295f951 EBUILD mpack-1.0.9-r1.ebuild 2299 BLAKE2B 81972f5a84aa553852c0c6fc59010e1f67116280ea0e2106d0dadd9bc1f6cb3e990367561c5790f8b646c65b49c8267a83d343021ff3c144f432ef94f0468ff1 SHA512 1c51651b30ff803991d706755ae64262e56c629b701d5487e6e9f5f73b3a9ca8278175cc772f916bc225541d6ca311af7412f87658abd91452ce5289c49efae5 MISC metadata.xml 337 BLAKE2B 552e6b193055ff86ce3bc29ec14b7ba72bf99ba5458c8588af1d53b6d393759118103d95f9b3e3f4c8582b19f7daccf0a5b619a8b171f5c74e2a8ad4f0648875 SHA512 6cc2098e7e31232ff9b6aa2cecfe7f9cde61d1ee36efb190d87330a5b6088a9d43f999d3cbce632925c01e35806c09022170230934f526febe1bd24c384b3ce1 diff --git a/dev-lua/mpack/mpack-1.0.10.ebuild b/dev-lua/mpack/mpack-1.0.10.ebuild new file mode 100644 index 000000000000..1c6415df4d35 --- /dev/null +++ b/dev-lua/mpack/mpack-1.0.10.ebuild @@ -0,0 +1,113 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-{1..4} luajit ) + +inherit lua toolchain-funcs + +MY_PN="lib${PN}-lua" + +DESCRIPTION="Lua bindings for libmpack" +HOMEPAGE="https://github.com/libmpack/libmpack-lua/" +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 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 ~x64-macos" +IUSE="test" +REQUIRED_USE="${LUA_REQUIRED_USE}" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-libs/libmpack + ${LUA_DEPS} +" +DEPEND="${RDEPEND}" +BDEPEND=" + virtual/pkgconfig + test? ( + dev-lua/busted[${LUA_USEDEP}] + dev-lua/lua_cliargs[${LUA_USEDEP}] + ${RDEPEND} + ) +" + +src_prepare() { + default + + lua_copy_sources +} + +lua_src_compile() { + pushd "${BUILD_DIR}" || die + + local myemakeargs=( + "CC=$(tc-getCC)" + "LUA_INCLUDE=$(lua_get_CFLAGS)" + "LUA_LIB=" + "USE_SYSTEM_MPACK=yes" + "USE_SYSTEM_LUA=yes" + ) + + emake "${myemakeargs[@]}" + + popd +} + +src_compile() { + lua_foreach_impl lua_src_compile +} + +lua_src_test() { + pushd "${BUILD_DIR}" || die + + # "[ 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. + if [[ ${ELUA} == "luajit" ]]; then + ewarn "Not running tests under ${ELUA} because they are known to fail" + return + fi + + busted --lua="${ELUA}" test.lua || die + + popd +} + +src_test() { + lua_foreach_impl lua_src_test +} + +lua_src_install() { + pushd "${BUILD_DIR}" || die + + local installdir="$(lua_get_cmod_dir)" + local myemakeargs=( + "DESTDIR=${ED}" + "LUA_CMOD_INSTALLDIR=${installdir#$EPREFIX}" + "USE_SYSTEM_MPACK=yes" + "USE_SYSTEM_LUA=yes" + ) + + emake "${myemakeargs[@]}" install + + popd + + if [[ ${CHOST} == *-darwin* ]] ; then + local luav=$(lua_get_version) + # we only want the major version (e.g. 5.1) + local luamv=${luav:0:3} + local file="lua/${luamv}/mpack.so" + install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${file}" "${ED}/usr/$(get_libdir)/${file}" || die "Failed to adjust install_name" + fi +} + +src_install() { + lua_foreach_impl lua_src_install + + einstalldocs +} |