From d3f4980a29badde11785f1ea8bebc82c4fbfcd89 Mon Sep 17 00:00:00 2001 From: Marek Szuba Date: Fri, 4 Dec 2020 00:30:30 +0100 Subject: [PATCH] app-admin/lsyncd-2.2.3: migrate to lua-single.eclass Upstream uses a customised variant of a really old version of FindLua.cmake which is not easy to replace with a modern stock version because it sets paths to lua and luac. Fortunately, it was simple enough to patch to only accept one specific ABI version. Was masked to begin with and I have kept the relevant package.mask line where it was. Closes: https://bugs.gentoo.org/752516 Signed-off-by: Marek Szuba --- .../lsyncd-2.2.3-cmake_lua_version.patch | 20 ++++++++++++++++++ app-admin/lsyncd/lsyncd-2.2.3.ebuild | 21 ++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 app-admin/lsyncd/files/lsyncd-2.2.3-cmake_lua_version.patch diff --git a/app-admin/lsyncd/files/lsyncd-2.2.3-cmake_lua_version.patch b/app-admin/lsyncd/files/lsyncd-2.2.3-cmake_lua_version.patch new file mode 100644 index 0000000000000..7a6cccb1445d9 --- /dev/null +++ b/app-admin/lsyncd/files/lsyncd-2.2.3-cmake_lua_version.patch @@ -0,0 +1,20 @@ +--- a/cmake/FindLua.cmake ++++ b/cmake/FindLua.cmake +@@ -36,7 +36,7 @@ + #SET(_POSSIBLE_LUA_LIBRARY lua) + + # Determine possible naming suffixes (there is no standard for this) +-SET(_POSSIBLE_SUFFIXES "52" "5.2" "-5.2" "53" "5.3" "-5.3" "") ++SET(_POSSIBLE_SUFFIXES "${LUA_ABI_VERSION}") + + # Set up possible search names and locations + FOREACH(_SUFFIX ${_POSSIBLE_SUFFIXES}) +@@ -53,7 +53,7 @@ + + # Find the lua executable + FIND_PROGRAM(LUA_COMPILER +- NAMES luac5.3 ${_POSSIBLE_LUA_COMPILER} ++ NAMES ${_POSSIBLE_LUA_COMPILER} + ) + + # Find the lua header diff --git a/app-admin/lsyncd/lsyncd-2.2.3.ebuild b/app-admin/lsyncd/lsyncd-2.2.3.ebuild index 9b83dd0fc77ef..705a0e4067e6a 100644 --- a/app-admin/lsyncd/lsyncd-2.2.3.ebuild +++ b/app-admin/lsyncd/lsyncd-2.2.3.ebuild @@ -1,10 +1,13 @@ # Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI="6" +EAPI=7 CMAKE_IN_SOURCE_BUILD="YES_PLEASE_OMG" -inherit cmake-utils +LUA_COMPAT=( lua5-{2,3} ) +LUA_REQ_USE="deprecated" + +inherit cmake lua-single DESCRIPTION="Live Syncing (Mirror) Daemon" HOMEPAGE="https://github.com/axkibe/lsyncd" @@ -14,15 +17,27 @@ LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" -CDEPEND=">=dev-lang/lua-5.2[deprecated]" +REQUIRED_USE="${LUA_REQUIRED_USE}" + +CDEPEND="${LUA_DEPS}" DEPEND="${CDEPEND} app-text/asciidoc virtual/pkgconfig" RDEPEND="${CDEPEND} net-misc/rsync" +# Both lua and luac are invoked at build time +BDEPEND="${CDEPEND}" PATCHES=( + "${FILESDIR}"/${PN}-2.2.3-cmake_lua_version.patch "${FILESDIR}"/${PN}-2.3.3-mandir.patch ) S=${WORKDIR}/${PN}-release-${PV} + +src_configure() { + local mycmakeargs=( + -DLUA_ABI_VERSION=$(ver_cut 1-2 $(lua_get_version)) + ) + cmake_src_configure +}