summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conikost@gentoo.org>2023-10-11 01:12:10 +0200
committerConrad Kostecki <conikost@gentoo.org>2023-10-11 01:35:08 +0200
commit31cfdc2a806bebc88bc4692e3ddfc197176149f1 (patch)
tree8fb02cc0bee1edd2d52a08168910b341bd2ae4fe /dev-lua
parentdev-lua/mpack: drop 1.0.9-r1 (diff)
downloadgentoo-31cfdc2a806bebc88bc4692e3ddfc197176149f1.tar.gz
gentoo-31cfdc2a806bebc88bc4692e3ddfc197176149f1.tar.bz2
gentoo-31cfdc2a806bebc88bc4692e3ddfc197176149f1.zip
dev-lua/mpack: add 1.0.11
Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'dev-lua')
-rw-r--r--dev-lua/mpack/Manifest1
-rw-r--r--dev-lua/mpack/mpack-1.0.11.ebuild116
2 files changed, 117 insertions, 0 deletions
diff --git a/dev-lua/mpack/Manifest b/dev-lua/mpack/Manifest
index f492226d7b82..32e6e5887e35 100644
--- a/dev-lua/mpack/Manifest
+++ b/dev-lua/mpack/Manifest
@@ -1 +1,2 @@
DIST mpack-1.0.10.tar.gz 16256 BLAKE2B 56f279be5b84e89a18a6010320eff9f006cfba6df9621e7b4c338a866170a69589e9e50d0d7deb238ff40634f28aa4d0c43a135c6b7fa9a38ec41b8b669945cd SHA512 879e200d806a4aeb3dc31bf44781bb92b377ee86fe3050692179bff794a2748c175135e4ab5eb59f29202bd36ff27ecc26bab07d0c46c11414361f72abf3dc53
+DIST mpack-1.0.11.tar.gz 16305 BLAKE2B e076043259692dc1aecbb62498cd44e523a44e40c265adeb3edc088f7b81a9e5892b13bbb730107fe64804be684c15510e8aea603abdafc2003c659e6bff9143 SHA512 2bd76e3d12928cb51f475d58e2c8b749f4b2b8b45f72296f6dd46c13b31fee80e0c4859de9332a7232842f511e4a53d30b43aad563980fd026d04fd65fb57b7e
diff --git a/dev-lua/mpack/mpack-1.0.11.ebuild b/dev-lua/mpack/mpack-1.0.11.ebuild
new file mode 100644
index 000000000000..2088da813d5c
--- /dev/null
+++ b/dev-lua/mpack/mpack-1.0.11.ebuild
@@ -0,0 +1,116 @@
+# 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
+}