dev-db/redis: repeat Lua slotted+unslotted fixes.
authorRobin H. Johnson <robbat2@gentoo.org>
Sun, 8 Oct 2017 23:21:58 +0000 (16:21 -0700)
committerRobin H. Johnson <robbat2@gentoo.org>
Sun, 8 Oct 2017 23:24:04 +0000 (16:24 -0700)
Re-apply the fixes from 5d58e071d2fe843bea503d3cd95998e95247aa39 that
support both slotted & unslotted lua from a single ebuild.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
dev-db/redis/redis-4.0.2.ebuild

index c79e00a9398cf44b08c6a25ff5f046877e441ed8..1449a35678260df3e25598cdb51dbef253e9285a 100644 (file)
@@ -14,8 +14,11 @@ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86
 IUSE="+jemalloc tcmalloc luajit test"
 SLOT="0"
 
+# Redis does NOT build with Lua 5.2 or newer at this time.
+# This should link correctly with both unslotted & slotted Lua, without
+# changes.
 RDEPEND="luajit? ( dev-lang/luajit:2 )
-       !luajit? ( >=dev-lang/lua-5.1:* )
+       !luajit? ( || ( dev-lang/lua:5.1 =dev-lang/lua-5.1*:0 ) )
        tcmalloc? ( dev-util/google-perftools )
        jemalloc? ( >=dev-libs/jemalloc-3.2 )"
 DEPEND="virtual/pkgconfig
@@ -61,10 +64,15 @@ src_prepare() {
        done
        # autodetection of compiler and settings; generates the modified Makefiles
        cp "${FILESDIR}"/configure.ac-3.2 configure.ac
+
+       # Use the correct pkgconfig name for Lua
+       has_version 'dev-lang/lua:5.1' \
+               && LUAPKGCONFIG=lua5.1 \
+               || LUAPKGCONFIG=lua
        sed -i  \
                -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
                -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
-               -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,lua,g" \
+               -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
                configure.ac || die "Sed failed for configure.ac"
        eautoreconf
 }