From 845521d116e91e6ed9c0f048ef2744486e626b0a Mon Sep 17 00:00:00 2001 From: Aaron Bauman Date: Tue, 9 Mar 2021 13:54:29 -0500 Subject: [PATCH] dev-lua/LuaBitOp: fix build on Darwin; keyword ~x64-macos Signed-off-by: Aaron Bauman --- dev-lua/LuaBitOp/LuaBitOp-1.0.2-r102.ebuild | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dev-lua/LuaBitOp/LuaBitOp-1.0.2-r102.ebuild b/dev-lua/LuaBitOp/LuaBitOp-1.0.2-r102.ebuild index 617860f3937a3..7aff8d1d405a1 100644 --- a/dev-lua/LuaBitOp/LuaBitOp-1.0.2-r102.ebuild +++ b/dev-lua/LuaBitOp/LuaBitOp-1.0.2-r102.ebuild @@ -5,7 +5,7 @@ EAPI=7 LUA_COMPAT=( lua5-{1..2} luajit ) -inherit lua toolchain-funcs +inherit flag-o-matic lua toolchain-funcs DESCRIPTION="Bit Operations Library for the Lua Programming Language" HOMEPAGE="http://bitop.luajit.org" @@ -13,7 +13,7 @@ SRC_URI="http://bitop.luajit.org/download/${P}.tar.gz" LICENSE="MIT" SLOT="0" -KEYWORDS="amd64 arm ~arm64 ~hppa ~mips ppc ppc64 sparc x86" +KEYWORDS="amd64 arm ~arm64 ~hppa ~mips ppc ppc64 sparc x86 ~x64-macos" IUSE="test" REQUIRED_USE="${LUA_REQUIRED_USE}" RESTRICT="!test? ( test )" @@ -45,6 +45,9 @@ lua_src_compile() { } src_compile() { + if [[ $CHOST == *-darwin* ]] ; then + append-ldflags "-undefined dynamic_lookup" + fi lua_foreach_impl lua_src_compile } @@ -77,6 +80,14 @@ lua_src_install() { doexe bit.so 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}/bit.so" + install_name_tool -id "${EPREFIX}/usr/$(get_libdir)/${file}" "${ED}/usr/$(get_libdir)/${file}" || die "Failed to adjust install_name" + fi } src_install() {