summaryrefslogtreecommitdiff
path: root/sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild
diff options
context:
space:
mode:
Diffstat (limited to 'sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild')
-rw-r--r--sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild22
1 files changed, 17 insertions, 5 deletions
diff --git a/sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild b/sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild
index 1d3ae4858241..96c27e44b3cd 100644
--- a/sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild
+++ b/sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild
@@ -3,7 +3,9 @@
EAPI=7
-inherit cmake git-r3
+LUA_COMPAT=( lua5-{1..4} luajit )
+
+inherit cmake git-r3 lua-single
EGIT_REPO_URI="https://github.com/openstreetmap/${PN}.git"
@@ -14,7 +16,8 @@ SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS=""
-IUSE="+lua luajit"
+IUSE="+lua"
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )"
COMMON_DEPEND="
app-arch/bzip2
@@ -22,8 +25,7 @@ COMMON_DEPEND="
dev-libs/expat
sci-libs/proj:=
sys-libs/zlib
- lua? ( dev-lang/lua:0= )
- luajit? ( dev-lang/luajit:= )
+ lua? ( ${LUA_DEPS} )
"
DEPEND="${COMMON_DEPEND}
dev-libs/boost
@@ -35,11 +37,21 @@ RDEPEND="${COMMON_DEPEND}
# Tries to connect to local postgres server and other shenanigans
RESTRICT="test"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4.0-cmake_lua_version.patch
+)
+
src_configure() {
+ # Setting WITH_LUAJIT without "if use lua" guard is safe, upstream
+ # CMakeLists.txt only evaluates it if WITH_LUA is true.
local mycmakeargs=(
-DWITH_LUA=$(usex lua)
- -DWITH_LUAJIT=$(usex luajit)
+ -DWITH_LUAJIT=$(usex lua_single_target_luajit)
-DBUILD_TESTS=OFF
)
+ # To prevent the "unused variable" QA warning
+ if use lua && ! use lua_single_target_luajit; then
+ mycmakeargs+=( -DLUA_VERSION="$(lua_get_version)" )
+ fi
cmake_src_configure
}