Skip to content

Commit

Permalink
dev-lua/lpeg: fix build on Darwin; keyword for 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 63193d6 commit 8547f12
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion dev-lua/lpeg/lpeg-1.0.2-r101.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SRC_URI="http://www.inf.puc-rio.br/~roberto/${PN}/${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 debug doc"
REQUIRED_USE="${LUA_REQUIRED_USE}"

Expand All @@ -39,6 +39,11 @@ lua_src_prepare() {
src_prepare() {
default
use debug && append-cflags -DLPEG_DEBUG

if [[ ${CHOST} == *-darwin* ]] ; then
append-ldflags "-undefined dynamic_lookup"
fi

lua_foreach_impl lua_src_prepare
}

Expand Down Expand Up @@ -70,6 +75,14 @@ lua_src_install() {
instdir="$(lua_get_lmod_dir)"
insinto "${instdir#${EPREFIX}}"
doins re.lua

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}/lpeg.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 8547f12

Please sign in to comment.