Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/gdal/, sci-libs/gdal/files/
Date: Sun, 04 Feb 2018 10:18:17
Message-Id: 1517739325.1b2289888f129d28cc0238e38f41fffdf5b55353.asturm@gentoo
1 commit: 1b2289888f129d28cc0238e38f41fffdf5b55353
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 4 00:43:49 2018 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 4 10:15:25 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b228988
7
8 sci-libs/gdal: Drop old
9
10 Closes: https://bugs.gentoo.org/643996
11 Package-Manager: Portage-2.3.24, Repoman-2.3.6
12
13 sci-libs/gdal/Manifest | 1 -
14 sci-libs/gdal/files/gdal-1.5.0-soname-r1.patch | 13 -
15 .../gdal-2.0.3-add-dlopen-support-for-jvm.patch | 232 ----------------
16 sci-libs/gdal/files/gdal-2.0.3-install_name.patch | 49 ----
17 sci-libs/gdal/gdal-2.0.3.ebuild | 291 ---------------------
18 5 files changed, 586 deletions(-)
19
20 diff --git a/sci-libs/gdal/Manifest b/sci-libs/gdal/Manifest
21 index b105313f67a..17fbd88fc85 100644
22 --- a/sci-libs/gdal/Manifest
23 +++ b/sci-libs/gdal/Manifest
24 @@ -1,2 +1 @@
25 -DIST gdal-2.0.3.tar.gz 11589011 BLAKE2B 2b9d319be24e377aff751c7ae4d6c89812c47fe2a0b9476936b2f3423e4f5593034a6303346e05709c9a7cffd71703ae80f72c689218ae0337794d35afcb3a1d SHA512 3ed2a084fa146fab8d5f5e039480ab935edaefebe9e55f85bf637a4487a3f56951c93055395850e7bf35d5a6d6e901f741ae01ad64be87597aabfad52f1c5e90
26 DIST gdal-2.2.3.tar.gz 13754766 BLAKE2B d9482e7ee40bb5558fbbb43b750dfb95344abe45142c19e1f767535d3fc127fa9d6ed4496d730a25cb4132980efbffb4685e8663798fa05515b8548edb689e42 SHA512 841e5ba3c1a442b678dcaabac719ea7707b817f3dc717a34430dc7ba1f2c27fa88e27b7a8645075fae6e16373b36e6c50f674bdd6b70d10059e6bc4be7a72046
27
28 diff --git a/sci-libs/gdal/files/gdal-1.5.0-soname-r1.patch b/sci-libs/gdal/files/gdal-1.5.0-soname-r1.patch
29 deleted file mode 100644
30 index ec35018868d..00000000000
31 --- a/sci-libs/gdal/files/gdal-1.5.0-soname-r1.patch
32 +++ /dev/null
33 @@ -1,13 +0,0 @@
34 ---- old/GDALmake.opt.in.orig 2008-02-02 18:25:48.000000000 -0800
35 -+++ new/GDALmake.opt.in 2008-02-02 18:54:53.000000000 -0800
36 -@@ -97,6 +97,10 @@
37 - GDAL_SLIB = $(GDAL_ROOT)/libgdal.$(SO_EXT)
38 - GDAL_SLIB_LINK = -L$(GDAL_ROOT) -lgdal
39 -
40 -+# for building without libtool
41 -+GDAL_SLIB_SO_VER = $(GDAL_VERSION_MAJOR).$(LIBGDAL_CURRENT).$(LIBGDAL_REVISION)
42 -+GDAL_SLIB_SONAME = -Wl,-soname,libgdal.$(SO_EXT).$(GDAL_VERSION_MAJOR)
43 -+
44 - # Mac OS X Framework definition
45 - MACOSX_FRAMEWORK = @MACOSX_FRAMEWORK@
46 -
47
48 diff --git a/sci-libs/gdal/files/gdal-2.0.3-add-dlopen-support-for-jvm.patch b/sci-libs/gdal/files/gdal-2.0.3-add-dlopen-support-for-jvm.patch
49 deleted file mode 100644
50 index 7c35d1cb124..00000000000
51 --- a/sci-libs/gdal/files/gdal-2.0.3-add-dlopen-support-for-jvm.patch
52 +++ /dev/null
53 @@ -1,232 +0,0 @@
54 -From baba2c213770972e79be6be4902716278f351fb4 Mon Sep 17 00:00:00 2001
55 -From: James Le Cuirot <chewi@g.o>
56 -Date: Wed, 24 Aug 2016 23:32:13 +0100
57 -Subject: [PATCH 1/2] Allow libjvm.so to be dlopen'd with --with-jvm-lib=dlopen
58 -
59 -Having to set LD_LIBRARY_PATH is a pain and relying on the rpath can
60 -be problematic when libjvm.so lives in a versioned directory. Some
61 -distributions even allow per-user JVM selection so checking the value
62 -of JAVA_HOME at runtime allows this choice to be respected.
63 -
64 -libjvm.so's location is hard to predict (amd64 vs i386, jre or not?)
65 -so ${JAVA_HOME}/bin/java -XshowSettings is executed to find its
66 -location. If JAVA_HOME is not set then java is executed from the PATH
67 -instead.
68 ----
69 - gdal/configure | 11 +++++-
70 - gdal/configure.in | 7 +++-
71 - gdal/ogr/ogrsf_frmts/mdb/ogrmdbjackcess.cpp | 57 +++++++++++++++++++++++++++--
72 - gdal/port/cpl_config.h.in | 3 ++
73 - 4 files changed, 71 insertions(+), 7 deletions(-)
74 -
75 -diff --git a/configure b/configure
76 -index 75e4e279de..acdfa439de 100755
77 ---- a/configure
78 -+++ b/configure
79 -@@ -1753,7 +1753,7 @@ Optional Packages:
80 - --with-python=ARG Enable python bindings (ARG=yes, no, or path to python binary)
81 - --with-java Include Java support (ARG=yes, no or JDK home path) [default=no]
82 - --with-mdb Include MDB driver
83 -- --with-jvm-lib=ARG ARG points to Java libjvm path
84 -+ --with-jvm-lib=ARG ARG is dlopen or points to Java libjvm path
85 - --with-jvm-lib-add-rpath Add the libjvm path to the RPATH (no by default)
86 - --with-rasdaman=DIR Include rasdaman support (DIR is rasdaman's install dir).
87 - --with-armadillo=ARG Include Armadillo support for faster TPS transform computation (ARG=yes/no/path to armadillo install root) [default=no]
88 -@@ -29491,7 +29491,14 @@ if test "${with_jvm_lib_add_rpath+set}" = set; then :
89 - fi
90 -
91 -
92 -- if test "x$with_jvm_lib" != "x"; then
93 -+ if test "x$with_jvm_lib" = "xdlopen"; then
94 -+
95 -+cat >>confdefs.h <<_ACEOF
96 -+#define JVM_LIB_DLOPEN 1
97 -+_ACEOF
98 -+
99 -+ JVM_LIB="-ldl"
100 -+ elif test "x$with_jvm_lib" != "x"; then
101 - if test -d "$with_jvm_lib"; then
102 - saved_LDFLAGS="$LDFLAGS"
103 - LDFLAGS="$LDFLAGS -L$with_jvm_lib"
104 -diff --git a/configure.in b/configure.in
105 -index 91efa5a32a..546ff04049 100644
106 ---- a/configure.in
107 -+++ b/configure.in
108 -@@ -4213,11 +4213,14 @@ if test "$with_mdb" = "yes" ; then
109 - AC_MSG_ERROR("--with-java must be specified.")
110 - fi
111 -
112 -- AC_ARG_WITH(jvm-lib, [ --with-jvm-lib=[ARG] ARG points to Java libjvm path],,)
113 -+ AC_ARG_WITH(jvm-lib, [ --with-jvm-lib=[ARG] ARG is dlopen or points to Java libjvm path],,)
114 -
115 - AC_ARG_WITH(jvm-lib-add-rpath,[ --with-jvm-lib-add-rpath Add the libjvm path to the RPATH (no by default)],,)
116 -
117 -- if test "x$with_jvm_lib" != "x"; then
118 -+ if test "x$with_jvm_lib" = "xdlopen"; then
119 -+ AC_DEFINE_UNQUOTED(JVM_LIB_DLOPEN, 1, [Define to 1 if libjvm.so should be dlopen'd])
120 -+ JVM_LIB="-ldl"
121 -+ elif test "x$with_jvm_lib" != "x"; then
122 - if test -d "$with_jvm_lib"; then
123 - saved_LDFLAGS="$LDFLAGS"
124 - LDFLAGS="$LDFLAGS -L$with_jvm_lib"
125 -diff --git a/ogr/ogrsf_frmts/mdb/ogrmdbjackcess.cpp b/ogr/ogrsf_frmts/mdb/ogrmdbjackcess.cpp
126 -index b068adf777..bc54a115df 100644
127 ---- a/ogr/ogrsf_frmts/mdb/ogrmdbjackcess.cpp
128 -+++ b/ogr/ogrsf_frmts/mdb/ogrmdbjackcess.cpp
129 -@@ -29,6 +29,11 @@
130 -
131 - #include "ogr_mdb.h"
132 -
133 -+#if JVM_LIB_DLOPEN
134 -+#include <limits.h>
135 -+#include <stdio.h>
136 -+#endif
137 -+
138 - CPL_CVSID("$Id: ogrmdbjackcess.cpp 27044 2014-03-16 23:41:27Z rouault $");
139 -
140 - static JavaVM *jvm_static = NULL;
141 -@@ -161,9 +166,41 @@ int OGRMDBJavaEnv::Init()
142 - {
143 - JavaVM* vmBuf[1];
144 - jsize nVMs;
145 -+ int ret = 0;
146 -+
147 -+#if JVM_LIB_DLOPEN
148 -+ const char *jvmLibPtr = "libjvm.so";
149 -+ char jvmLib[PATH_MAX];
150 -+
151 -+ FILE *javaCmd = popen("\"${JAVA_HOME}${JAVA_HOME:+/bin/}java\" -XshowSettings 2>&1 | sed -n '/\\bsun\\.boot\\.library\\.path =/s:.* = \\(.*\\):\\1/server/libjvm.so:p'", "r");
152 -+
153 -+ if (javaCmd != NULL)
154 -+ {
155 -+ size_t javaCmdRead = fread(jvmLib, 1, PATH_MAX, javaCmd);
156 -+ ret = pclose(javaCmd);
157 -+
158 -+ if (ret == 0 && javaCmdRead >= 2)
159 -+ {
160 -+ /* Chomp the new line */
161 -+ jvmLib[javaCmdRead - 1] = '\0';
162 -+ jvmLibPtr = jvmLib;
163 -+ }
164 -+ }
165 -+
166 -+ jint (*pfnJNI_GetCreatedJavaVMs)(JavaVM **, jsize, jsize *);
167 -+ pfnJNI_GetCreatedJavaVMs = (jint (*)(JavaVM **, jsize, jsize *))
168 -+ CPLGetSymbol(jvmLibPtr, "JNI_GetCreatedJavaVMs");
169 -+
170 -+ if (pfnJNI_GetCreatedJavaVMs == NULL)
171 -+ return FALSE;
172 -+ else
173 -+ ret = pfnJNI_GetCreatedJavaVMs(vmBuf, 1, &nVMs);
174 -+#else
175 -+ ret = JNI_GetCreatedJavaVMs(vmBuf, 1, &nVMs);
176 -+#endif
177 -
178 - /* Are we already called from Java ? */
179 -- if (JNI_GetCreatedJavaVMs(vmBuf, 1, &nVMs) == JNI_OK && nVMs == 1)
180 -+ if (ret == JNI_OK && nVMs == 1)
181 - {
182 - jvm = vmBuf[0];
183 - if (jvm->GetEnv((void **)&env, JNI_VERSION_1_2) == JNI_OK)
184 -@@ -194,8 +231,22 @@ int OGRMDBJavaEnv::Init()
185 - args.nOptions = 0;
186 - args.ignoreUnrecognized = JNI_FALSE;
187 -
188 -- int ret = JNI_CreateJavaVM(&jvm, (void **)&env, &args);
189 -- if (ret != 0 || jvm == NULL || env == NULL)
190 -+#if JVM_LIB_DLOPEN
191 -+ jint (*pfnJNI_CreateJavaVM)(JavaVM **, void **, void *);
192 -+ pfnJNI_CreateJavaVM = (jint (*)(JavaVM **, void **, void *))
193 -+ CPLGetSymbol(jvmLibPtr, "JNI_CreateJavaVM");
194 -+
195 -+ if (pfnJNI_CreateJavaVM == NULL)
196 -+ return FALSE;
197 -+ else
198 -+ ret = pfnJNI_CreateJavaVM(&jvm, (void **)&env, &args);
199 -+#else
200 -+ ret = JNI_CreateJavaVM(&jvm, (void **)&env, &args);
201 -+#endif
202 -+
203 -+ CPLFree(pszClassPathOption);
204 -+
205 -+ if (ret != JNI_OK || jvm == NULL || env == NULL)
206 - {
207 - CPLError(CE_Failure, CPLE_AppDefined, "JNI_CreateJavaVM failed (%d)", ret);
208 - return FALSE;
209 -diff --git a/port/cpl_config.h.in b/port/cpl_config.h.in
210 -index 313729fd3e..e8fa21140a 100644
211 ---- a/port/cpl_config.h.in
212 -+++ b/port/cpl_config.h.in
213 -@@ -161,6 +161,9 @@
214 - /* For .cpp files, define as const if the declaration of iconv() needs const. */
215 - #undef ICONV_CPP_CONST
216 -
217 -+/* Define to 1 if libjvm.so should be dlopen'd */
218 -+#undef JVM_LIB_DLOPEN
219 -+
220 - /* Define to the sub-directory in which libtool stores uninstalled libraries.
221 - */
222 - #undef LT_OBJDIR
223 ---
224 -2.11.0
225 -
226 -
227 -From cd6bbb60ced62b6176482e86c54ab618e2592ac8 Mon Sep 17 00:00:00 2001
228 -From: James Le Cuirot <chewi@g.o>
229 -Date: Thu, 25 Aug 2016 21:26:20 +0100
230 -Subject: [PATCH 2/2] Fetch jackcess classpath using java-config instead of
231 - using CLASSPATH
232 -
233 ----
234 - gdal/ogr/ogrsf_frmts/mdb/ogrmdbjackcess.cpp | 26 ++++++++++++++++++++++----
235 - 1 file changed, 22 insertions(+), 4 deletions(-)
236 -
237 -diff --git a/ogr/ogrsf_frmts/mdb/ogrmdbjackcess.cpp b/ogr/ogrsf_frmts/mdb/ogrmdbjackcess.cpp
238 -index bc54a115df..5b0972677e 100644
239 ---- a/ogr/ogrsf_frmts/mdb/ogrmdbjackcess.cpp
240 -+++ b/ogr/ogrsf_frmts/mdb/ogrmdbjackcess.cpp
241 -@@ -218,19 +218,37 @@ int OGRMDBJavaEnv::Init()
242 - JavaVMInitArgs args;
243 - JavaVMOption options[1];
244 - args.version = JNI_VERSION_1_2;
245 -- const char* pszClassPath = CPLGetConfigOption("CLASSPATH", NULL);
246 -- CPLString osClassPathOption;
247 -+
248 -+ FILE *javaCmd = popen("java-config --with-dependencies --classpath=jackcess-1", "r");
249 -+
250 -+ const char* pszClassPath = NULL;
251 -+ if (javaCmd != NULL)
252 -+ {
253 -+ pszClassPath = CPLReadLine(javaCmd);
254 -+ ret = pclose(javaCmd);
255 -+
256 -+ if (ret != 0)
257 -+ pszClassPath = NULL;
258 -+ }
259 -+
260 -+ if (pszClassPath == NULL)
261 -+ pszClassPath = CPLGetConfigOption("CLASSPATH", NULL);
262 -+
263 -+ char* pszClassPathOption = NULL;
264 - if (pszClassPath)
265 - {
266 - args.nOptions = 1;
267 -- osClassPathOption.Printf("-Djava.class.path=%s", pszClassPath);
268 -- options[0].optionString = (char*) osClassPathOption.c_str();
269 -+ pszClassPathOption = CPLStrdup(CPLSPrintf("-Djava.class.path=%s", pszClassPath));
270 -+ options[0].optionString = pszClassPathOption;
271 - args.options = options;
272 - }
273 - else
274 - args.nOptions = 0;
275 - args.ignoreUnrecognized = JNI_FALSE;
276 -
277 -+ if (javaCmd != NULL)
278 -+ CPLReadLine(NULL);
279 -+
280 - #if JVM_LIB_DLOPEN
281 - jint (*pfnJNI_CreateJavaVM)(JavaVM **, void **, void *);
282 - pfnJNI_CreateJavaVM = (jint (*)(JavaVM **, void **, void *))
283 ---
284 -2.11.0
285 -
286
287 diff --git a/sci-libs/gdal/files/gdal-2.0.3-install_name.patch b/sci-libs/gdal/files/gdal-2.0.3-install_name.patch
288 deleted file mode 100644
289 index 1e83d55ecf7..00000000000
290 --- a/sci-libs/gdal/files/gdal-2.0.3-install_name.patch
291 +++ /dev/null
292 @@ -1,49 +0,0 @@
293 -Unbreak compilation on Darwin
294 -
295 -Author: Fabian Groffen <grobian@g.o>
296 -
297 ---- gdal-2.0.3.old/GDALmake.opt.in
298 -+++ gdal-2.0.3/GDALmake.opt.in
299 -@@ -104,6 +104,10 @@ GDAL_LIB = $(GDAL_ROOT)/libgdal.a
300 - GDAL_SLIB = $(GDAL_ROOT)/libgdal.$(SO_EXT)
301 - GDAL_SLIB_LINK = -L$(GDAL_ROOT) -lgdal
302 -
303 -+# for building without libtool
304 -+GDAL_SLIB_SO_VER = $(GDAL_VERSION_MAJOR).$(LIBGDAL_CURRENT).$(LIBGDAL_REVISION)
305 -+GDAL_SLIB_SONAME = -install_name $(INST_LIB)/libgdal.$(GDAL_VERSION_MAJOR).$(SO_EXT)
306 -+
307 - # Mac OS X Framework definition
308 - MACOSX_FRAMEWORK = @MACOSX_FRAMEWORK@
309 -
310 ---- gdal-2.0.3.old/GNUmakefile
311 -+++ gdal-2.0.3/GNUmakefile
312 -@@ -208,7 +208,7 @@ else
313 -
314 - ifeq ($(HAVE_LD_SHARED),yes)
315 -
316 --GDAL_SLIB_B = $(notdir $(GDAL_SLIB))
317 -+GDAL_SLIB_B = libgdal
318 -
319 - install-lib:
320 -
321 -@@ -216,14 +216,14 @@ install-lib:
322 - ifeq ($(MACOSX_FRAMEWORK),yes)
323 - $(INSTALL_LIB) $(GDAL_SLIB) $(DESTDIR)$(INST_LIB)/GDAL
324 - else
325 -- rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B)
326 -- rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR)
327 -- rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER)
328 -- $(INSTALL_LIB) $(GDAL_SLIB) $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER)
329 -+ rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).dylib
330 -+ rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR).dylib
331 -+ rm -f $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER).dylib
332 -+ $(INSTALL_LIB) $(GDAL_SLIB) $(DESTDIR)$(INST_LIB)/$(GDAL_SLIB_B).$(GDAL_VER).dylib
333 - (cd $(DESTDIR)$(INST_LIB) ; \
334 -- ln -s $(GDAL_SLIB_B).$(GDAL_VER) $(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR))
335 -+ ln -s $(GDAL_SLIB_B).$(GDAL_VER).dylib $(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR).dylib)
336 - (cd $(DESTDIR)$(INST_LIB) ; \
337 -- ln -s $(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR) $(GDAL_SLIB_B))
338 -+ ln -s $(GDAL_SLIB_B).$(GDAL_VERSION_MAJOR).dylib $(GDAL_SLIB_B).dylib)
339 - $(INSTALL_DIR) $(DESTDIR)$(INST_LIB)/gdalplugins
340 - endif
341 -
342
343 diff --git a/sci-libs/gdal/gdal-2.0.3.ebuild b/sci-libs/gdal/gdal-2.0.3.ebuild
344 deleted file mode 100644
345 index ee3dfedc4d8..00000000000
346 --- a/sci-libs/gdal/gdal-2.0.3.ebuild
347 +++ /dev/null
348 @@ -1,291 +0,0 @@
349 -# Copyright 1999-2018 Gentoo Foundation
350 -# Distributed under the terms of the GNU General Public License v2
351 -
352 -EAPI="6"
353 -
354 -GENTOO_DEPEND_ON_PERL="no"
355 -PYTHON_COMPAT=( python2_7 python3_{4,5} )
356 -DISTUTILS_OPTIONAL=1
357 -
358 -inherit autotools perl-module distutils-r1 toolchain-funcs flag-o-matic java-pkg-opt-2
359 -
360 -DESCRIPTION="Translator library for raster geospatial data formats (includes OGR support)"
361 -HOMEPAGE="http://www.gdal.org/"
362 -SRC_URI="http://download.osgeo.org/${PN}/${PV}/${P}.tar.gz"
363 -
364 -SLOT="0/2"
365 -LICENSE="BSD Info-ZIP MIT"
366 -KEYWORDS="amd64 ~arm ~arm64 ~ia64 ppc ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
367 -IUSE="armadillo +aux_xml curl debug doc fits geos gif gml hdf5 java jpeg jpeg2k mdb mysql netcdf odbc ogdi opencl oracle pdf perl png postgres python spatialite sqlite threads xls"
368 -
369 -COMMON_DEPEND="dev-libs/expat
370 - dev-libs/json-c:=
371 - dev-libs/libpcre
372 - dev-libs/libxml2:=
373 - media-libs/tiff:0=
374 - sci-libs/libgeotiff
375 - sys-libs/zlib[minizip(+)]
376 - armadillo? ( sci-libs/armadillo:=[lapack] )
377 - curl? ( net-misc/curl )
378 - fits? ( sci-libs/cfitsio:= )
379 - geos? ( >=sci-libs/geos-2.2.1 )
380 - gif? ( media-libs/giflib:= )
381 - gml? ( >=dev-libs/xerces-c-3 )
382 - hdf5? ( >=sci-libs/hdf5-1.6.4:=[szip] )
383 - jpeg? ( virtual/jpeg:0= )
384 - jpeg2k? ( media-libs/openjpeg:2= )
385 - mdb? ( dev-java/jackcess:1 )
386 - mysql? ( virtual/mysql )
387 - netcdf? ( sci-libs/netcdf:= )
388 - odbc? ( dev-db/unixODBC )
389 - ogdi? ( sci-libs/ogdi )
390 - opencl? ( virtual/opencl )
391 - oracle? ( dev-db/oracle-instantclient:= )
392 - pdf? ( >=app-text/poppler-0.24.3:= )
393 - perl? ( dev-lang/perl:= )
394 - png? ( media-libs/libpng:0= )
395 - postgres? ( >=dev-db/postgresql-8.4:= )
396 - python? (
397 - ${PYTHON_DEPS}
398 - dev-python/setuptools[${PYTHON_USEDEP}]
399 - dev-python/numpy[${PYTHON_USEDEP}]
400 - )
401 - sqlite? ( dev-db/sqlite:3 )
402 - spatialite? ( dev-db/spatialite )
403 - xls? ( dev-libs/freexl )"
404 -
405 -RDEPEND="${COMMON_DEPEND}
406 - java? ( >=virtual/jre-1.7:* )"
407 -
408 -DEPEND="${COMMON_DEPEND}
409 - doc? ( app-doc/doxygen )
410 - java? ( >=virtual/jdk-1.7:* )
411 - perl? ( dev-lang/swig:0 )
412 - python? ( dev-lang/swig:0 )"
413 -
414 -REQUIRED_USE="mdb? ( java )
415 - python? ( ${PYTHON_REQUIRED_USE} )
416 - spatialite? ( sqlite )
417 -"
418 -
419 -src_prepare() {
420 - local PATCHES=()
421 - local PATCHES=( "${FILESDIR}"/gdal-2.0.3-add-dlopen-support-for-jvm.patch )
422 -
423 - # -soname is only accepted by GNU ld/ELF
424 - if [[ ${CHOST} == *-darwin* ]]; then
425 - PATCHES+=( "${FILESDIR}"/${PN}-2.0.3-install_name.patch )
426 - else
427 - PATCHES+=( "${FILESDIR}"/${PN}-1.5.0-soname-r1.patch )
428 - fi
429 -
430 - # fix datadir and docdir placement
431 - sed -i \
432 - -e "s:@datadir@:@datadir@/gdal:" \
433 - -e "s:@exec_prefix@/doc:@exec_prefix@/share/doc/${PF}/html:g" \
434 - "${S}"/GDALmake.opt.in || die
435 -
436 - # the second sed expression should fix bug 371075
437 - sed -i \
438 - -e "s:setup.py install:setup.py install --root=\$(DESTDIR):" \
439 - -e "s:--prefix=\$(DESTDIR):--prefix=:" \
440 - "${S}"/swig/python/GNUmakefile || die
441 -
442 - # Fix spatialite/sqlite include issue
443 - sed -i \
444 - -e 's:spatialite/sqlite3.h:sqlite3.h:g' \
445 - ogr/ogrsf_frmts/sqlite/ogr_sqlite.h || die
446 -
447 - # Fix freexl configure check
448 - sed -i \
449 - -e 's:FREEXL_LIBS=missing):FREEXL_LIBS=missing,-lm):g' \
450 - configure.in || die
451 -
452 - sed \
453 - -e "s: /usr/: \"${EPREFIX}\"/usr/:g" \
454 - -i configure.in || die
455 -
456 - sed \
457 - -e 's:^ar:$(AR):g' \
458 - -i ogr/ogrsf_frmts/sdts/install-libs.sh || die
459 -
460 - # updated for newer swig (must specify the path to input files)
461 - sed -i \
462 - -e "s: gdal_array.i: ../include/gdal_array.i:" \
463 - -e "s:\$(DESTDIR)\$(prefix):\$(DESTDIR)\$(INST_PREFIX):g" \
464 - swig/python/GNUmakefile || die "sed python makefile failed"
465 - sed -i \
466 - -e "s:library_dirs = :library_dirs = /usr/$(get_libdir):g" \
467 - swig/python/setup.cfg || die "sed python setup.cfg failed"
468 -
469 - default
470 -
471 - # bug 626844, poppler headers require C++11
472 - use pdf && append-cxxflags -std=c++11
473 -
474 - tc-export AR RANLIB
475 -
476 - mv configure.{in,ac} || die
477 -
478 - eautoreconf
479 -}
480 -
481 -src_configure() {
482 - local myopts=""
483 -
484 - if use java; then
485 - myopts+="
486 - --with-java=$(java-config --jdk-home 2>/dev/null)
487 - --with-jvm-lib=dlopen
488 - $(use_with mdb)"
489 - else
490 - myopts+=" --without-java --without-mdb"
491 - fi
492 -
493 - if use sqlite; then
494 - myopts+=" LIBS=-lsqlite3"
495 - fi
496 -
497 - # pcidsk is internal, because there is no such library yet released
498 - # also that thing is developed by the gdal people
499 - # kakadu, mrsid jp2mrsid - another jpeg2k stuff, ignore
500 - # bsb - legal issues
501 - # ingres - same story as oracle oci
502 - # jasper - disabled because unmaintained and vulnerable; openjpeg will be used as JPEG-2000 provider instead
503 - # podofo - we use poppler instead they are exclusive for each other
504 - # tiff is a hard dep
505 - ECONF_SOURCE="${S}" econf \
506 - --includedir="${EPREFIX}/usr/include/${PN}" \
507 - --disable-static \
508 - --enable-shared \
509 - --with-expat \
510 - --with-geotiff \
511 - --with-grib \
512 - --with-libtiff \
513 - --with-libz="${EPREFIX}/usr/" \
514 - --with-ogr \
515 - --without-bsb \
516 - --without-dods-root \
517 - --without-dwgdirect \
518 - --without-epsilon \
519 - --without-fme \
520 - --without-grass \
521 - --without-hdf4 \
522 - --without-idb \
523 - --without-ingres \
524 - --without-jasper \
525 - --without-jp2mrsid \
526 - --without-kakadu \
527 - --without-libtool \
528 - --without-mrsid \
529 - --without-msg \
530 - --without-pcraster \
531 - --without-podofo \
532 - --without-sde \
533 - $(use_enable debug) \
534 - $(use_with armadillo) \
535 - $(use_with aux_xml pam) \
536 - $(use_with curl) \
537 - --without-ecw \
538 - $(use_with fits cfitsio) \
539 - $(use_with geos) \
540 - $(use_with gif) \
541 - $(use_with gml xerces) \
542 - $(use_with hdf5) \
543 - $(use_with jpeg pcidsk) \
544 - $(use_with jpeg) \
545 - $(use_with jpeg2k openjpeg) \
546 - $(use_with mysql mysql "${EPREFIX}"/usr/bin/mysql_config) \
547 - $(use_with netcdf) \
548 - $(use_with oracle oci) \
549 - $(use_with odbc) \
550 - $(use_with ogdi ogdi "${EPREFIX}"/usr) \
551 - $(use_with opencl) \
552 - $(use_with pdf poppler) \
553 - $(use_with perl) \
554 - $(use_with png) \
555 - $(use_with postgres pg) \
556 - $(use_with python) \
557 - $(use_with spatialite) \
558 - $(use_with sqlite sqlite3 "${EPREFIX}"/usr) \
559 - $(use_with threads) \
560 - $(use_with xls freexl) \
561 - ${myopts}
562 -
563 - # mysql-config puts this in (and boy is it a PITA to get it out)
564 - if use mysql; then
565 - sed -i \
566 - -e "s: -rdynamic : :" \
567 - GDALmake.opt || die "sed LIBS failed"
568 - fi
569 -}
570 -
571 -src_compile() {
572 - if use perl; then
573 - rm "${S}"/swig/perl/*_wrap.cpp || die
574 - emake -C "${S}"/swig/perl generate
575 - fi
576 -
577 - # gdal-config needed before generating Python bindings
578 - default
579 -
580 - if use perl ; then
581 - pushd "${S}"/swig/perl > /dev/null || die
582 - perl-module_src_configure
583 - perl-module_src_compile
584 - popd > /dev/null || die
585 - fi
586 -
587 - if use python; then
588 - rm -f "${S}"swig/python/*_wrap.cpp || die
589 - emake -C "${S}"/swig/python generate
590 - pushd "${S}"/swig/python > /dev/null || die
591 - distutils-r1_src_compile
592 - popd > /dev/null || die
593 - fi
594 -
595 - use doc && emake docs
596 -}
597 -
598 -src_install() {
599 - if use perl ; then
600 - pushd "${S}"/swig/perl > /dev/null || die
601 - perl-module_src_install
602 - popd > /dev/null || die
603 - sed -e 's:BINDINGS = \(.*\) perl:BINDINGS = \1:g' \
604 - -i GDALmake.opt || die
605 - fi
606 -
607 - use perl && perl_delete_localpod
608 -
609 - local DOCS=( Doxyfile HOWTO-RELEASE NEWS )
610 - use doc && HTML_DOCS=( html/. )
611 -
612 - default
613 -
614 - python_install() {
615 - distutils-r1_python_install
616 - python_doscript scripts/*.py
617 - }
618 -
619 - if use python; then
620 - # Don't clash with gdal's docs
621 - unset DOCS HTML_DOCS
622 -
623 - pushd "${S}"/swig/python > /dev/null || die
624 - distutils-r1_src_install
625 - popd > /dev/null || die
626 -
627 - newdoc swig/python/README.txt README-python.txt
628 -
629 - insinto /usr/share/${PN}/samples
630 - doins swig/python/samples/*
631 - fi
632 -
633 - doman "${S}"/man/man*/*
634 -}
635 -
636 -pkg_postinst() {
637 - elog "Check available image and data formats after building with"
638 - elog "gdalinfo and ogrinfo (using the --formats switch)."
639 -}