Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-geosciences/mapserver/, sci-geosciences/mapserver/files/
Date: Mon, 30 Jan 2023 09:51:15
Message-Id: 1675072245.2b24ca5a9e9050d5346033478c6e58f15219f87d.andrewammerlaan@gentoo
1 commit: 2b24ca5a9e9050d5346033478c6e58f15219f87d
2 Author: Marco Genasci <fedeliallalinea <AT> gmail <DOT> com>
3 AuthorDate: Mon Dec 5 08:26:16 2022 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 30 09:50:45 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b24ca5a
7
8 sci-geosciences/mapserver: version bump to 8.0.0
9
10 Signed-off-by: Marco Genasci <fedeliallalinea <AT> gmail.com>
11 Closes: https://github.com/gentoo/gentoo/pull/28544
12 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
13
14 sci-geosciences/mapserver/Manifest | 1 +
15 .../files/mapserver-8.0.0-wfs-paging.patch | 12 +
16 sci-geosciences/mapserver/mapserver-8.0.0.ebuild | 291 +++++++++++++++++++++
17 3 files changed, 304 insertions(+)
18
19 diff --git a/sci-geosciences/mapserver/Manifest b/sci-geosciences/mapserver/Manifest
20 index f71ac13a5ac5..2306a474faa7 100644
21 --- a/sci-geosciences/mapserver/Manifest
22 +++ b/sci-geosciences/mapserver/Manifest
23 @@ -1 +1,2 @@
24 DIST mapserver-7.6.4.tar.gz 2718735 BLAKE2B 4d9fc6d215a55af32e0cc125f6119e0e477ddc5a5b2dbea6df1cc7e1ffaf6319f3a855329749aa07f1bca88e79a71c67cb2e8bd62e30bd60e44ecc1b8283d4ce SHA512 ccca87b650df3c1784ba82ca4a58960585d72fb4004fcea43c0dcabf03b9617ba51870bc63dbb2238a7eeb8d4337b6ff152587150912a74eeaf4a3e3d2d584ce
25 +DIST mapserver-8.0.0.tar.gz 2945524 BLAKE2B b67fb10f62e3c8cf4ae6d69863ef841fd2dd4106de55fd08dfc8146191bed1f18f12003455462503afcdb49e45d1368d89be591c152dcabba2b18587d27efaef SHA512 b9275f5e3399efb3cb189472ed28d081055e79da9aa35f7c9b8567b2d2d3cfc425ea7750b36a40db9ab537261c099356dc923e7b91941919d79c38f740327b97
26
27 diff --git a/sci-geosciences/mapserver/files/mapserver-8.0.0-wfs-paging.patch b/sci-geosciences/mapserver/files/mapserver-8.0.0-wfs-paging.patch
28 new file mode 100644
29 index 000000000000..ff78c7f2372e
30 --- /dev/null
31 +++ b/sci-geosciences/mapserver/files/mapserver-8.0.0-wfs-paging.patch
32 @@ -0,0 +1,12 @@
33 +diff --git a/maporaclespatial.c b/maporaclespatial.c
34 +index e7a50319e..5558f0231 100644
35 +--- a/maporaclespatial.c
36 ++++ b/maporaclespatial.c
37 +@@ -2086,6 +2086,7 @@ int msOracleSpatialLayerWhichShapes( layerObj *layer, rectObj rect, int isQuery)
38 + msFree(tmp1_str);
39 +
40 + tmp_str = msStringConcatenate(tmp_str, query_str2);
41 ++ memset(query_str,0,strlen(query_str));
42 + query_str = msStringConcatenate(query_str, tmp_str);
43 + msFree(tmp_str);
44 + }
45
46 diff --git a/sci-geosciences/mapserver/mapserver-8.0.0.ebuild b/sci-geosciences/mapserver/mapserver-8.0.0.ebuild
47 new file mode 100644
48 index 000000000000..fa0e3a656b30
49 --- /dev/null
50 +++ b/sci-geosciences/mapserver/mapserver-8.0.0.ebuild
51 @@ -0,0 +1,291 @@
52 +# Copyright 1999-2023 Gentoo Authors
53 +# Distributed under the terms of the GNU General Public License v2
54 +
55 +EAPI=7
56 +
57 +# Variables for the miscellaneous bindings we provide
58 +PHP_EXT_OPTIONAL_USE="php"
59 +PHP_EXT_NAME="php_mapscriptng"
60 +PHP_EXT_SKIP_PHPIZE="yes"
61 +PHP_EXT_SKIP_PATCHES="yes"
62 +
63 +USE_PHP="php7-4"
64 +PYTHON_COMPAT=( python3_{9..11} )
65 +
66 +WEBAPP_MANUAL_SLOT=yes
67 +WEBAPP_OPTIONAL=yes
68 +
69 +inherit cmake depend.apache perl-functions php-ext-source-r3 python-r1 webapp
70 +
71 +DESCRIPTION="Development environment for building spatially enabled webapps"
72 +HOMEPAGE="https://mapserver.org/"
73 +SRC_URI="https://download.osgeo.org/mapserver/${P}.tar.gz"
74 +
75 +LICENSE="Boost-1.0 BSD BSD-2 ISC MIT tcltk"
76 +KEYWORDS="~amd64 ~x86"
77 +SLOT="0"
78 +
79 +# NOTE: opengl removed for now as no support for it in upstream CMake
80 +IUSE="apache bidi cairo geos mysql oracle perl php postgis python"
81 +
82 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
83 +
84 +# Tests:
85 +# Included tests (tests/*) are seriously outdated
86 +# Upstream's main test suite (msautotest/*) is not in the release tarball,
87 +# and upstream sets 'export-ignore' for that directory.
88 +#
89 +# The eclasses used normally try to run test suites themselves,
90 +# or skip if nothing was found.
91 +# However, because of the php-ext-* eclass usage, this fails and would
92 +# cause errors running non-existent tests, so we have to restrict here.
93 +RESTRICT="test"
94 +
95 +RDEPEND="
96 + >=dev-libs/expat-2.2.8
97 + dev-libs/libxml2:2=
98 + dev-libs/libxslt[crypt]
99 + >=dev-libs/protobuf-c-1.3.2:=
100 + >=media-libs/freetype-2.9.1-r3
101 + >=media-libs/gd-2.0.12:=[truetype,jpeg,png,zlib]
102 + >=media-libs/giflib-5.2.1:=
103 + media-libs/libjpeg-turbo
104 + >=media-libs/libpng-1.6.37:=
105 + >=net-misc/curl-7.69.1
106 + >=sci-libs/gdal-3.0.4:=[oracle?]
107 + >=sci-libs/proj-6.2.1:=
108 + virtual/libiconv
109 + >=x11-libs/agg-2.5-r3
110 + apache? (
111 + app-admin/webapp-config
112 + dev-libs/fcgi
113 + )
114 + bidi? (
115 + dev-libs/fribidi
116 + media-libs/harfbuzz:=
117 + )
118 + cairo? ( x11-libs/cairo )
119 + geos? ( sci-libs/geos )
120 + mysql? ( dev-db/mysql-connector-c:= )
121 + oracle? ( dev-db/oracle-instantclient:= )
122 + perl? ( dev-lang/perl:= )
123 + postgis? (
124 + dev-db/postgis
125 + dev-db/postgresql:=
126 + )
127 + python? ( ${PYTHON_DEPS} )
128 +"
129 +DEPEND="${RDEPEND}"
130 +BDEPEND="
131 + virtual/pkgconfig
132 + perl? ( >=dev-lang/swig-4.0 )
133 + php? ( >=dev-lang/swig-4.0 )
134 + python? (
135 + >=dev-lang/swig-4.0
136 + >=dev-python/setuptools-44.1.0
137 + )
138 +"
139 +
140 +PATCHES=(
141 + "${FILESDIR}"/${P}-wfs-paging.patch
142 +)
143 +
144 +want_apache2 apache
145 +
146 +pkg_setup() {
147 + use apache && webapp_pkg_setup
148 + use perl && perl_set_version
149 +}
150 +
151 +src_prepare() {
152 + cmake_src_prepare
153 +
154 + use php && php-ext-source-r3_src_prepare
155 + use python && python_copy_sources
156 +}
157 +
158 +_generate_cmake_args() {
159 + # Provides a simple, bare config for bindings to build upon
160 + # Need WITH_WMS=ON or build fails
161 + local args=(
162 + "-DCMAKE_SKIP_RPATH=ON"
163 + "-DINSTALL_LIB_DIR=/usr/$(get_libdir)"
164 + "-DWITH_CAIRO=OFF"
165 + "-DWITH_FCGI=OFF"
166 + "-DWITH_FRIBIDI=OFF"
167 + "-DWITH_GEOS=OFF"
168 + "-DWITH_GIF=OFF"
169 + "-DWITH_HARFBUZZ=OFF"
170 + "-DWITH_ICONV=OFF"
171 + "-DWITH_PROTOBUFC=OFF"
172 + "-DWITH_POSTGIS=OFF"
173 + "-DWITH_WMS=ON"
174 + "-DWITH_WCS=OFF"
175 + "-DWITH_WFS=OFF"
176 + "-DWITH_OGCAPI=OFF"
177 + )
178 +
179 + echo "${args[@]}"
180 +}
181 +
182 +src_configure() {
183 + # NOTE: We could make this based on _generate_cmake_args, but
184 + # then we wouldn't be as-explicit about what is enabled/not,
185 + # and reliant on defaults not changing.
186 + # Readability and maintainability is better this way.
187 + local mycmakeargs=(
188 + "-DCMAKE_SKIP_RPATH=ON"
189 + "-DINSTALL_LIB_DIR=/usr/$(get_libdir)"
190 + "-DWITH_CLIENT_WMS=ON"
191 + "-DWITH_CLIENT_WFS=ON"
192 + "-DWITH_CURL=ON"
193 + "-DWITH_GIF=ON"
194 + "-DWITH_ICONV=ON"
195 + "-DWITH_KML=ON"
196 + "-DWITH_LIBXML2=ON"
197 + "-DWITH_PHPNG=OFF"
198 + "-DWITH_PROTOBUFC=ON"
199 + "-DWITH_SOS=ON"
200 + "-DWITH_WMS=ON"
201 + "-DWITH_WFS=ON"
202 + "-DWITH_WCS=ON"
203 + "-DWITH_XMLMAPFILE=ON"
204 + "-DWITH_APACHE_MODULE=$(usex apache ON OFF)"
205 + "-DWITH_CAIRO=$(usex cairo ON OFF)"
206 + "-DWITH_FCGI=$(usex apache ON OFF)"
207 + "-DWITH_GEOS=$(usex geos ON OFF)"
208 + "-DWITH_ORACLESPATIAL=$(usex oracle ON OFF)"
209 + "-DWITH_MYSQL=$(usex mysql ON OFF)"
210 + "-DWITH_FRIBIDI=$(usex bidi ON OFF)"
211 + "-DWITH_HARFBUZZ=$(usex bidi ON OFF)"
212 + "-DWITH_POSTGIS=$(usex postgis ON OFF)"
213 + "-DWITH_PERL=$(usex perl ON OFF)"
214 + )
215 +
216 + use perl && mycmakeargs+=( "-DCUSTOM_PERL_SITE_ARCH_DIR=$(perl_get_raw_vendorlib)" )
217 +
218 + # Configure the standard build first
219 + cmake_src_configure
220 +
221 + # Minimal build for bindings
222 + # Note that we use _generate_cmake_args to get a clean config each time, then add
223 + # in options as appropriate. Otherwise we'd get contamination between bindings.
224 + if use python ; then
225 + mycmakeargs=(
226 + $(_generate_cmake_args)
227 + "-DWITH_PYTHON=ON"
228 + )
229 +
230 + python_foreach_impl cmake_src_configure
231 + python_foreach_impl python_optimize
232 + fi
233 +
234 + if use php ; then
235 + local slot=
236 + for slot in $(php_get_slots) ; do
237 + # Switch to the slot's build dir
238 + php_init_slot_env "${slot}"
239 +
240 + # Take a blank config each time
241 + # Add in only *this* slot's PHP includes dir, etc
242 + mycmakeargs=(
243 + $(_generate_cmake_args)
244 + "-DWITH_PHPNG=ON"
245 + "-DPHP_CONFIG_EXECUTABLE=${PHPCONFIG}"
246 + "-DPHP_INCLUDES=${PHPPREFIX}"
247 + )
248 +
249 + BUILD_DIR="${S}/php${slot}" cmake_src_configure
250 +
251 + # Return to where we left off, in case we add more
252 + # to this phase.
253 + cd "${S}" || die
254 + done
255 + fi
256 +}
257 +
258 +src_compile() {
259 + cmake_src_compile
260 +
261 + if use python ; then
262 + python_foreach_impl cmake_src_compile
263 + fi
264 +
265 + if use php ; then
266 + local slot=
267 + for slot in $(php_get_slots) ; do
268 + # Switch to the slot's build dir
269 + php_init_slot_env "${slot}"
270 +
271 + # Force cmake to build in it
272 + BUILD_DIR="${S}/php${slot}" cmake_src_compile
273 +
274 + # Return to where we left off, in case we add more
275 + # to this phase.
276 + cd "${S}" || die
277 + done
278 + fi
279 +}
280 +
281 +src_install() {
282 + # Needs to be first
283 + use apache && webapp_src_preinst
284 +
285 + if use python ; then
286 + python_foreach_impl cmake_src_install
287 + python_foreach_impl python_optimize
288 + fi
289 +
290 + if use php ; then
291 + php-ext-source-r3_createinifiles
292 +
293 + local slot=
294 + for slot in $(php_get_slots) ; do
295 + php_init_slot_env "${slot}"
296 +
297 + BUILD_DIR="${S}/php${slot}" cmake_src_install
298 +
299 + cd "${S}" || die
300 + done
301 + fi
302 +
303 + # Install this last because this build is the most "fully-featured"
304 + cmake_src_install
305 +
306 + if use apache ; then
307 + # We need a mapserver symlink available in cgi-bin
308 + dosym ../../../../../../../usr/bin/mapserv /usr/share/webapps/${PN}/${PV}/hostroot/cgi-bin/mapserv
309 + webapp_src_install
310 + fi
311 +}
312 +
313 +pkg_preinst() {
314 + # We need to cache the value here of HAD_PHP because we want the
315 + # original package version, not the result of us installing a new one
316 + HAD_PHP=
317 + has_version 'sci-geosciences/mapserver[php]' && HAD_PHP=1
318 +}
319 +
320 +pkg_postinst() {
321 + use apache && webapp_pkg_postinst
322 +
323 + # Let upgrading (from a pre-rewrite version) users know that the PHP module changed
324 + local replacing_version=
325 + for replacing_version in ${REPLACING_VERSIONS} ; do
326 + if ver_test "7.6.0" -gt "${replacing_version}" ; then
327 + if use php && [[ ${HAD_PHP} -eq 1 ]] ; then
328 + elog "Note that MapServer has deprecated the old PHP extension"
329 + elog "You can read more at: "
330 + elog "URL: https://mapserver.org/MIGRATION_GUIDE.html#mapserver-7-2-to-7-4-migration"
331 + elog "This may involve porting some of your PHP scripts to use the new module."
332 + fi
333 +
334 + # Only show the message once
335 + break
336 + fi
337 + done
338 +}
339 +
340 +pkg_prerm() {
341 + use apache && webapp_pkg_prerm
342 +}