diff options
author | Marek Szuba <marecki@gentoo.org> | 2020-12-23 11:46:26 +0000 |
---|---|---|
committer | Marek Szuba <marecki@gentoo.org> | 2020-12-23 11:48:41 +0000 |
commit | 73b87ef1bb28bd52657bcbb89e22c32e4a46579f (patch) | |
tree | 28dde32c630ce8764d5f6f789db01e2841b2d150 /sci-geosciences | |
parent | dev-java/javatoolkit: removed obsolete 0.6.3 (diff) | |
download | gentoo-73b87ef1bb28bd52657bcbb89e22c32e4a46579f.tar.gz gentoo-73b87ef1bb28bd52657bcbb89e22c32e4a46579f.tar.bz2 gentoo-73b87ef1bb28bd52657bcbb89e22c32e4a46579f.zip |
sci-geosciences/osm2pgsql: migrate to lua-single.eclass
The usual CMake deal. According to upstream scripts supports all the Lua
implementations currently in the tree, I have confirmed that it builds
and installs (tests are restricted) fine against: lua5.1, lua5.4, and luajit.
Both the latest release and the live ebuild.
Closes: https://bugs.gentoo.org/752834
Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'sci-geosciences')
3 files changed, 83 insertions, 5 deletions
diff --git a/sci-geosciences/osm2pgsql/files/osm2pgsql-1.4.0-cmake_lua_version.patch b/sci-geosciences/osm2pgsql/files/osm2pgsql-1.4.0-cmake_lua_version.patch new file mode 100644 index 000000000000..d7f35345ef52 --- /dev/null +++ b/sci-geosciences/osm2pgsql/files/osm2pgsql-1.4.0-cmake_lua_version.patch @@ -0,0 +1,11 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -185,7 +185,7 @@ + include_directories(SYSTEM ${LUAJIT_INCLUDE_DIR}) + set(HAVE_LUAJIT 1) + else() +- find_package(Lua REQUIRED) ++ find_package(Lua ${LUA_VERSION} EXACT REQUIRED) + include_directories(SYSTEM ${LUA_INCLUDE_DIR}) + endif() + set(HAVE_LUA 1) diff --git a/sci-geosciences/osm2pgsql/osm2pgsql-1.4.0-r100.ebuild b/sci-geosciences/osm2pgsql/osm2pgsql-1.4.0-r100.ebuild new file mode 100644 index 000000000000..ac4caa5df5a2 --- /dev/null +++ b/sci-geosciences/osm2pgsql/osm2pgsql-1.4.0-r100.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..4} luajit ) + +inherit cmake lua-single + +DESCRIPTION="Converts OSM planet.osm data to a PostgreSQL/PostGIS database" +HOMEPAGE="https://osm2pgsql.org/" +SRC_URI="https://github.com/openstreetmap/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="+lua" +REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )" + +COMMON_DEPEND=" + app-arch/bzip2 + dev-db/postgresql:= + dev-libs/expat + sci-libs/proj:= + sys-libs/zlib + lua? ( ${LUA_DEPS} ) +" +DEPEND="${COMMON_DEPEND} + dev-libs/boost +" +RDEPEND="${COMMON_DEPEND} + dev-db/postgis +" + +# 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 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 +} 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 } |