From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1498640-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id B98E115A7D9
	for <garchives@archives.gentoo.org>; Sun, 19 Mar 2023 22:12:56 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 3D31FE0874;
	Sun, 19 Mar 2023 22:12:55 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 10A2EE0874
	for <gentoo-commits@lists.gentoo.org>; Sun, 19 Mar 2023 22:12:55 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id BC34F34135A
	for <gentoo-commits@lists.gentoo.org>; Sun, 19 Mar 2023 22:12:53 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id DC41D8F0
	for <gentoo-commits@lists.gentoo.org>; Sun, 19 Mar 2023 22:12:50 +0000 (UTC)
From: "Conrad Kostecki" <conikost@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Conrad Kostecki" <conikost@gentoo.org>
Message-ID: <1679263961.a11d546c00d99701446ae27f25b57cce24fc2ea6.conikost@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lua/mpack/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-lua/mpack/Manifest dev-lua/mpack/mpack-1.0.10.ebuild
X-VCS-Directories: dev-lua/mpack/
X-VCS-Committer: conikost
X-VCS-Committer-Name: Conrad Kostecki
X-VCS-Revision: a11d546c00d99701446ae27f25b57cce24fc2ea6
X-VCS-Branch: master
Date: Sun, 19 Mar 2023 22:12:50 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 015761e3-e7ca-400e-b7dc-f99a7941396c
X-Archives-Hash: 1cdb50c5d0caa945a4f8b292d9cfd075

commit:     a11d546c00d99701446ae27f25b57cce24fc2ea6
Author:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 19 22:10:47 2023 +0000
Commit:     Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sun Mar 19 22:12:41 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a11d546c

dev-lua/mpack: add 1.0.10

Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>

 dev-lua/mpack/Manifest            |   1 +
 dev-lua/mpack/mpack-1.0.10.ebuild | 113 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 114 insertions(+)

diff --git a/dev-lua/mpack/Manifest b/dev-lua/mpack/Manifest
index 00e09b45279c..47c151b429a8 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.9.tar.gz 16087 BLAKE2B 062f0deaa9ea359486933b5736591ea3ee78886e31259b721d88ef44762403185b881d076ca35fe6e8c16ab756d36698fec1ca893ab3667635e388456a8ad417 SHA512 c663a6cb29c1ae3f88baf25d36b076c35b35b96a16f9df472f8063009dc70886071cc27bf9224aceb86afb5c590ac072fd484435f40ecc4961eabfb5df08f395

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
+}