summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Bauman <bman@gentoo.org>2021-03-09 13:21:35 -0500
committerAaron Bauman <bman@gentoo.org>2021-03-09 13:21:35 -0500
commit8547f12dc95fb46445d540486669aed209507392 (patch)
tree7fed5ec10a23c26228dfba29ecd8178c42f26632 /dev-lua/lpeg
parentapp-office/gnucash: Cleanup (diff)
downloadgentoo-8547f12dc95fb46445d540486669aed209507392.tar.gz
gentoo-8547f12dc95fb46445d540486669aed209507392.tar.bz2
gentoo-8547f12dc95fb46445d540486669aed209507392.zip
dev-lua/lpeg: fix build on Darwin; keyword for x64-macos
Signed-off-by: Aaron Bauman <bman@gentoo.org>
Diffstat (limited to 'dev-lua/lpeg')
-rw-r--r--dev-lua/lpeg/lpeg-1.0.2-r101.ebuild15
1 files changed, 14 insertions, 1 deletions
diff --git a/dev-lua/lpeg/lpeg-1.0.2-r101.ebuild b/dev-lua/lpeg/lpeg-1.0.2-r101.ebuild
index 769fbe86123a..fd6789b18f6e 100644
--- a/dev-lua/lpeg/lpeg-1.0.2-r101.ebuild
+++ b/dev-lua/lpeg/lpeg-1.0.2-r101.ebuild
@@ -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}"
@@ -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
}
@@ -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() {