Gentoo Archives: gentoo-commits

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