1 |
commit: 73b87ef1bb28bd52657bcbb89e22c32e4a46579f |
2 |
Author: Marek Szuba <marecki <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 23 11:46:26 2020 +0000 |
4 |
Commit: Marek Szuba <marecki <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 23 11:48:41 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73b87ef1 |
7 |
|
8 |
sci-geosciences/osm2pgsql: migrate to lua-single.eclass |
9 |
|
10 |
The usual CMake deal. According to upstream scripts supports all the Lua |
11 |
implementations currently in the tree, I have confirmed that it builds |
12 |
and installs (tests are restricted) fine against: lua5.1, lua5.4, and luajit. |
13 |
|
14 |
Both the latest release and the live ebuild. |
15 |
|
16 |
Closes: https://bugs.gentoo.org/752834 |
17 |
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org> |
18 |
|
19 |
profiles/package.mask | 1 + |
20 |
.../files/osm2pgsql-1.4.0-cmake_lua_version.patch | 11 +++++ |
21 |
.../osm2pgsql/osm2pgsql-1.4.0-r100.ebuild | 55 ++++++++++++++++++++++ |
22 |
.../osm2pgsql/osm2pgsql-99999999.ebuild | 22 +++++++-- |
23 |
4 files changed, 84 insertions(+), 5 deletions(-) |
24 |
|
25 |
diff --git a/profiles/package.mask b/profiles/package.mask |
26 |
index 57ad788e0fe..94a353fc484 100644 |
27 |
--- a/profiles/package.mask |
28 |
+++ b/profiles/package.mask |
29 |
@@ -522,6 +522,7 @@ kde-apps/kdebase-meta:5 |
30 |
>=net-mail/dovecot-2.3.11.3-r100 |
31 |
>=net-p2p/eiskaltdcpp-2.2.10-r100 |
32 |
>=sci-astronomy/celestia-1.7.0_pre20200316-r100 |
33 |
+>=sci-geosciences/osm2pgsql-1.4.0-r100 |
34 |
>=sci-libs/libsc-2.2-r100 |
35 |
>=sci-libs/p4est-2.2-r100 |
36 |
>=sci-libs/plplot-5.15.0-r100 |
37 |
|
38 |
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 |
39 |
new file mode 100644 |
40 |
index 00000000000..d7f35345ef5 |
41 |
--- /dev/null |
42 |
+++ b/sci-geosciences/osm2pgsql/files/osm2pgsql-1.4.0-cmake_lua_version.patch |
43 |
@@ -0,0 +1,11 @@ |
44 |
+--- a/CMakeLists.txt |
45 |
++++ b/CMakeLists.txt |
46 |
+@@ -185,7 +185,7 @@ |
47 |
+ include_directories(SYSTEM ${LUAJIT_INCLUDE_DIR}) |
48 |
+ set(HAVE_LUAJIT 1) |
49 |
+ else() |
50 |
+- find_package(Lua REQUIRED) |
51 |
++ find_package(Lua ${LUA_VERSION} EXACT REQUIRED) |
52 |
+ include_directories(SYSTEM ${LUA_INCLUDE_DIR}) |
53 |
+ endif() |
54 |
+ set(HAVE_LUA 1) |
55 |
|
56 |
diff --git a/sci-geosciences/osm2pgsql/osm2pgsql-1.4.0-r100.ebuild b/sci-geosciences/osm2pgsql/osm2pgsql-1.4.0-r100.ebuild |
57 |
new file mode 100644 |
58 |
index 00000000000..ac4caa5df5a |
59 |
--- /dev/null |
60 |
+++ b/sci-geosciences/osm2pgsql/osm2pgsql-1.4.0-r100.ebuild |
61 |
@@ -0,0 +1,55 @@ |
62 |
+# Copyright 1999-2020 Gentoo Authors |
63 |
+# Distributed under the terms of the GNU General Public License v2 |
64 |
+ |
65 |
+EAPI=7 |
66 |
+ |
67 |
+LUA_COMPAT=( lua5-{1..4} luajit ) |
68 |
+ |
69 |
+inherit cmake lua-single |
70 |
+ |
71 |
+DESCRIPTION="Converts OSM planet.osm data to a PostgreSQL/PostGIS database" |
72 |
+HOMEPAGE="https://osm2pgsql.org/" |
73 |
+SRC_URI="https://github.com/openstreetmap/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" |
74 |
+ |
75 |
+LICENSE="GPL-2" |
76 |
+SLOT="0" |
77 |
+KEYWORDS="~amd64 ~x86" |
78 |
+IUSE="+lua" |
79 |
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )" |
80 |
+ |
81 |
+COMMON_DEPEND=" |
82 |
+ app-arch/bzip2 |
83 |
+ dev-db/postgresql:= |
84 |
+ dev-libs/expat |
85 |
+ sci-libs/proj:= |
86 |
+ sys-libs/zlib |
87 |
+ lua? ( ${LUA_DEPS} ) |
88 |
+" |
89 |
+DEPEND="${COMMON_DEPEND} |
90 |
+ dev-libs/boost |
91 |
+" |
92 |
+RDEPEND="${COMMON_DEPEND} |
93 |
+ dev-db/postgis |
94 |
+" |
95 |
+ |
96 |
+# Tries to connect to local postgres server and other shenanigans |
97 |
+RESTRICT="test" |
98 |
+ |
99 |
+PATCHES=( |
100 |
+ "${FILESDIR}"/${PN}-1.4.0-cmake_lua_version.patch |
101 |
+) |
102 |
+ |
103 |
+src_configure() { |
104 |
+ # Setting WITH_LUAJIT without "if use lua" guard is safe, upstream |
105 |
+ # CMakeLists.txt only evaluates it if WITH_LUA is true. |
106 |
+ local mycmakeargs=( |
107 |
+ -DWITH_LUA=$(usex lua) |
108 |
+ -DWITH_LUAJIT=$(usex lua_single_target_luajit) |
109 |
+ -DBUILD_TESTS=OFF |
110 |
+ ) |
111 |
+ # To prevent the "unused variable" QA warning |
112 |
+ if use lua && ! use lua_single_target_luajit; then |
113 |
+ mycmakeargs+=( -DLUA_VERSION="$(lua_get_version)" ) |
114 |
+ fi |
115 |
+ cmake_src_configure |
116 |
+} |
117 |
|
118 |
diff --git a/sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild b/sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild |
119 |
index 1d3ae485824..96c27e44b3c 100644 |
120 |
--- a/sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild |
121 |
+++ b/sci-geosciences/osm2pgsql/osm2pgsql-99999999.ebuild |
122 |
@@ -3,7 +3,9 @@ |
123 |
|
124 |
EAPI=7 |
125 |
|
126 |
-inherit cmake git-r3 |
127 |
+LUA_COMPAT=( lua5-{1..4} luajit ) |
128 |
+ |
129 |
+inherit cmake git-r3 lua-single |
130 |
|
131 |
EGIT_REPO_URI="https://github.com/openstreetmap/${PN}.git" |
132 |
|
133 |
@@ -14,7 +16,8 @@ SRC_URI="" |
134 |
LICENSE="GPL-2" |
135 |
SLOT="0" |
136 |
KEYWORDS="" |
137 |
-IUSE="+lua luajit" |
138 |
+IUSE="+lua" |
139 |
+REQUIRED_USE="lua? ( ${LUA_REQUIRED_USE} )" |
140 |
|
141 |
COMMON_DEPEND=" |
142 |
app-arch/bzip2 |
143 |
@@ -22,8 +25,7 @@ COMMON_DEPEND=" |
144 |
dev-libs/expat |
145 |
sci-libs/proj:= |
146 |
sys-libs/zlib |
147 |
- lua? ( dev-lang/lua:0= ) |
148 |
- luajit? ( dev-lang/luajit:= ) |
149 |
+ lua? ( ${LUA_DEPS} ) |
150 |
" |
151 |
DEPEND="${COMMON_DEPEND} |
152 |
dev-libs/boost |
153 |
@@ -35,11 +37,21 @@ RDEPEND="${COMMON_DEPEND} |
154 |
# Tries to connect to local postgres server and other shenanigans |
155 |
RESTRICT="test" |
156 |
|
157 |
+PATCHES=( |
158 |
+ "${FILESDIR}"/${PN}-1.4.0-cmake_lua_version.patch |
159 |
+) |
160 |
+ |
161 |
src_configure() { |
162 |
+ # Setting WITH_LUAJIT without "if use lua" guard is safe, upstream |
163 |
+ # CMakeLists.txt only evaluates it if WITH_LUA is true. |
164 |
local mycmakeargs=( |
165 |
-DWITH_LUA=$(usex lua) |
166 |
- -DWITH_LUAJIT=$(usex luajit) |
167 |
+ -DWITH_LUAJIT=$(usex lua_single_target_luajit) |
168 |
-DBUILD_TESTS=OFF |
169 |
) |
170 |
+ # To prevent the "unused variable" QA warning |
171 |
+ if use lua && ! use lua_single_target_luajit; then |
172 |
+ mycmakeargs+=( -DLUA_VERSION="$(lua_get_version)" ) |
173 |
+ fi |
174 |
cmake_src_configure |
175 |
} |