Skip to content

Commit

Permalink
dev-lua/LuaBitOp: fix build on Darwin; keyword ~x64-macos
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Bauman <[email protected]>
  • Loading branch information
FuzzyGophers committed Mar 9, 2021
1 parent 77abfd4 commit 845521d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions dev-lua/LuaBitOp/LuaBitOp-1.0.2-r102.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ 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"
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 )"
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 845521d

Please sign in to comment.