Gentoo Archives: gentoo-commits

From: Aaron Bauman <bman@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/gdal/
Date: Tue, 03 Dec 2019 04:18:21
Message-Id: 1575346672.17d23a3e384f97ac3703ba9650a30df3c3f7ac63.bman@gentoo
1 commit: 17d23a3e384f97ac3703ba9650a30df3c3f7ac63
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 1 20:50:12 2019 +0000
4 Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 3 04:17:52 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17d23a3e
7
8 sci-libs/gdal: python3_8, EAPI-7 bump
9
10 Dropping python2_7 for dev-python/numpy dependency.
11
12 Package-Manager: Portage-2.3.80, Repoman-2.3.18
13 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
14 Signed-off-by: Aaron Bauman <bman <AT> gentoo.org>
15
16 sci-libs/gdal/gdal-2.4.1-r2.ebuild | 321 +++++++++++++++++++++++++++++++++++++
17 1 file changed, 321 insertions(+)
18
19 diff --git a/sci-libs/gdal/gdal-2.4.1-r2.ebuild b/sci-libs/gdal/gdal-2.4.1-r2.ebuild
20 new file mode 100644
21 index 00000000000..fa26cc48e93
22 --- /dev/null
23 +++ b/sci-libs/gdal/gdal-2.4.1-r2.ebuild
24 @@ -0,0 +1,321 @@
25 +# Copyright 1999-2019 Gentoo Authors
26 +# Distributed under the terms of the GNU General Public License v2
27 +
28 +EAPI=7
29 +
30 +GENTOO_DEPEND_ON_PERL="no"
31 +PYTHON_COMPAT=( python3_{5,6,7,8} )
32 +DISTUTILS_OPTIONAL=1
33 +inherit autotools perl-module distutils-r1 flag-o-matic java-pkg-opt-2 toolchain-funcs
34 +
35 +DESCRIPTION="Translator library for raster geospatial data formats (includes OGR support)"
36 +HOMEPAGE="https://gdal.org/"
37 +SRC_URI="https://download.osgeo.org/${PN}/${PV}/${P}.tar.gz"
38 +
39 +SLOT="0/2.3"
40 +LICENSE="BSD Info-ZIP MIT"
41 +KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
42 +IUSE="armadillo +aux_xml curl debug doc fits geos gif gml hdf5 java jpeg jpeg2k lzma mdb mysql netcdf odbc ogdi opencl oracle pdf perl png postgres python spatialite sqlite threads webp xls zstd"
43 +
44 +REQUIRED_USE="
45 + mdb? ( java )
46 + python? ( ${PYTHON_REQUIRED_USE} )
47 + spatialite? ( sqlite )
48 +"
49 +
50 +BDEPEND="
51 + doc? ( app-doc/doxygen )
52 + java? ( >=virtual/jdk-1.7:* )
53 + perl? ( dev-lang/swig:0 )
54 + python? (
55 + dev-lang/swig:0
56 + dev-python/setuptools[${PYTHON_USEDEP}]
57 + )"
58 +
59 +DEPEND="
60 + dev-libs/expat
61 + dev-libs/json-c:=
62 + dev-libs/libpcre
63 + dev-libs/libxml2:=
64 + media-libs/tiff:0=
65 + sci-libs/libgeotiff:=
66 + sys-libs/zlib:=[minizip(+)]
67 + armadillo? ( sci-libs/armadillo:=[lapack] )
68 + curl? ( net-misc/curl )
69 + fits? ( sci-libs/cfitsio:= )
70 + geos? ( >=sci-libs/geos-2.2.1 )
71 + gif? ( media-libs/giflib:= )
72 + gml? ( >=dev-libs/xerces-c-3.1 )
73 + hdf5? ( >=sci-libs/hdf5-1.6.4:=[szip] )
74 + jpeg? ( virtual/jpeg:0= )
75 + jpeg2k? ( media-libs/openjpeg:2= )
76 + lzma? ( || (
77 + app-arch/xz-utils
78 + app-arch/lzma
79 + ) )
80 + mdb? ( dev-java/jackcess:1 )
81 + mysql? ( virtual/mysql )
82 + netcdf? ( sci-libs/netcdf:= )
83 + odbc? ( dev-db/unixODBC )
84 + ogdi? ( sci-libs/ogdi )
85 + opencl? ( virtual/opencl )
86 + oracle? ( dev-db/oracle-instantclient:= )
87 + pdf? ( app-text/poppler:= )
88 + perl? ( dev-lang/perl:= )
89 + png? ( media-libs/libpng:0= )
90 + postgres? ( >=dev-db/postgresql-8.4:= )
91 + python? (
92 + ${PYTHON_DEPS}
93 + dev-python/numpy[${PYTHON_USEDEP}]
94 + )
95 + spatialite? ( dev-db/spatialite )
96 + sqlite? ( dev-db/sqlite:3 )
97 + webp? ( media-libs/libwebp:= )
98 + xls? ( dev-libs/freexl )
99 + zstd? ( app-arch/zstd:= )"
100 +
101 +RDEPEND="${DEPEND}
102 + java? ( >=virtual/jre-1.7:* )"
103 +
104 +PATCHES=(
105 + "${FILESDIR}/${PN}-2.2.3-soname.patch"
106 + "${FILESDIR}/${PN}-2.2.3-bashcomp-path.patch" # bug 641866
107 + "${FILESDIR}/${PN}-2.3.0-curl.patch" # bug 659840
108 + "${FILESDIR}/${P}-poppler-0.75.patch"
109 + "${FILESDIR}/${P}-poppler-0.76.patch"
110 + "${FILESDIR}/${P}-swig-4.patch" # bug 689110
111 + "${FILESDIR}/${P}-poppler-0.82.patch"
112 +)
113 +
114 +src_prepare() {
115 + # fix datadir and docdir placement
116 + sed -e "s:@datadir@:@datadir@/gdal:" \
117 + -e "s:@exec_prefix@/doc:@exec_prefix@/share/doc/${PF}/html:g" \
118 + -i "${S}"/GDALmake.opt.in || die
119 +
120 + # the second sed expression should fix bug 371075
121 + sed -e "s:setup.py install:setup.py install --root=\$(DESTDIR):" \
122 + -e "s:--prefix=\$(DESTDIR):--prefix=:" \
123 + -i "${S}"/swig/python/GNUmakefile || die
124 +
125 + # Fix spatialite/sqlite include issue
126 + sed -e 's:spatialite/sqlite3.h:sqlite3.h:g' \
127 + -i ogr/ogrsf_frmts/sqlite/ogr_sqlite.h || die
128 +
129 + # Fix freexl configure check
130 + sed -e 's:FREEXL_LIBS=missing):FREEXL_LIBS=missing,-lm):g' \
131 + -i configure.ac || die
132 +
133 + sed -e "s: /usr/: \"${EPREFIX}\"/usr/:g" \
134 + -i configure.ac || die
135 +
136 + sed -e 's:^ar:$(AR):g' \
137 + -i ogr/ogrsf_frmts/sdts/install-libs.sh || die
138 +
139 + # updated for newer swig (must specify the path to input files)
140 + sed -e "s: gdal_array.i: ../include/gdal_array.i:" \
141 + -e "s:\$(DESTDIR)\$(prefix):\$(DESTDIR)\$(INST_PREFIX):g" \
142 + -i swig/python/GNUmakefile || die "sed python makefile failed"
143 + sed -e "s:library_dirs = :library_dirs = /usr/$(get_libdir):g" \
144 + -i swig/python/setup.cfg || die "sed python setup.cfg failed"
145 +
146 + default
147 +
148 + eautoreconf
149 +}
150 +
151 +src_configure() {
152 + # bug 619148
153 + append-cxxflags -std=c++14
154 +
155 + local myconf=(
156 + # charls - not packaged in Gentoo ebuild repository
157 + # kakadu, mrsid jp2mrsid - another jpeg2k stuff, ignore
158 + # bsb - legal issues
159 + # ingres - same story as oracle oci
160 + # jasper - disabled because unmaintained and vulnerable; openjpeg will be used as JPEG-2000 provider instead
161 + # podofo - we use poppler instead they are exclusive for each other
162 + # tiff is a hard dep
163 + --includedir="${EPREFIX}"/usr/include/${PN}
164 + --disable-pdf-plugin
165 + --disable-static
166 + --enable-shared
167 + --with-expat
168 + --with-cryptopp=no
169 + --with-geotiff
170 + --with-grib
171 + --with-hide-internal-symbols
172 + --with-libjson-c="${EPREFIX}"/usr/
173 + --with-libtiff
174 + --with-libtool
175 + --with-libz="${EPREFIX}"/usr/
176 + --with-gnm
177 + --without-bsb
178 + --without-charls
179 + --without-dods-root
180 + --without-ecw
181 + --without-epsilon
182 + --without-fgdb
183 + --without-fme
184 + --without-gta
185 + --without-grass
186 + --without-hdf4
187 + --without-idb
188 + --without-ingres
189 + --without-jasper
190 + --without-jp2lura
191 + --without-jp2mrsid
192 + --without-kakadu
193 + --without-kea
194 + --without-libkml
195 + --without-mongocxx
196 + --without-mrsid
197 + --without-mrsid_lidar
198 + --without-msg
199 + --without-mrf
200 + --without-rasdaman
201 + --without-rasterlite2
202 + --without-pcraster
203 + --without-pdfium
204 + --without-podofo
205 + --without-qhull
206 + --without-sde
207 + --without-sfcgal
208 + --without-sosi
209 + --without-teigha
210 + --disable-lto
211 + $(use_enable debug)
212 + $(use_with armadillo)
213 + $(use_with aux_xml pam)
214 + $(use_with curl)
215 + $(use_with fits cfitsio)
216 + $(use_with geos)
217 + $(use_with gif)
218 + $(use_with gml xerces)
219 + $(use_with hdf5)
220 + $(use_with jpeg pcidsk) # pcidsk is internal, because there is no such library yreleased developer by gdal
221 + $(use_with jpeg)
222 + $(use_with jpeg2k openjpeg)
223 + $(use_with lzma liblzma)
224 + $(use_with mysql mysql "${EPREFIX}"/usr/bin/mysql_config)
225 + $(use_with netcdf)
226 + $(use_with oracle oci)
227 + $(use_with odbc)
228 + $(use_with ogdi ogdi "${EPREFIX}"/usr)
229 + $(use_with opencl)
230 + $(use_with pdf poppler)
231 + $(use_with perl)
232 + $(use_with png)
233 + $(use_with postgres pg)
234 + $(use_with python)
235 + $(use_with spatialite)
236 + $(use_with sqlite sqlite3 "${EPREFIX}"/usr)
237 + $(use_with threads)
238 + $(use_with webp)
239 + $(use_with xls freexl)
240 + $(use_with zstd)
241 + )
242 +
243 + tc-export AR RANLIB
244 +
245 + if use java; then
246 + myconf+=(
247 + --with-java=$(java-config --jdk-home 2>/dev/null)
248 + --with-jvm-lib=dlopen
249 + $(use_with mdb)
250 + )
251 + else
252 + myconf+=( --without-java --without-mdb )
253 + fi
254 +
255 + if use sqlite; then
256 + append-libs -lsqlite3
257 + fi
258 +
259 + # bug #632660
260 + if use ogdi; then
261 + tc-export PKG_CONFIG
262 + append-cflags $(${PKG_CONFIG} --cflags libtirpc)
263 + append-cxxflags $(${PKG_CONFIG} --cflags libtirpc)
264 + fi
265 +
266 + ECONF_SOURCE="${S}" econf "${myconf[@]}"
267 +
268 + # mysql-config puts this in (and boy is it a PITA to get it out)
269 + if use mysql; then
270 + sed -e "s: -rdynamic : :" \
271 + -i GDALmake.opt || die "sed LIBS failed"
272 + fi
273 +}
274 +
275 +src_compile() {
276 + if use perl; then
277 + rm "${S}"/swig/perl/*_wrap.cpp || die
278 + emake -C "${S}"/swig/perl generate
279 + fi
280 +
281 + # gdal-config needed before generating Python bindings
282 + default
283 +
284 + if use perl ; then
285 + pushd "${S}"/swig/perl > /dev/null || die
286 + perl-module_src_configure
287 + perl-module_src_compile
288 + popd > /dev/null || die
289 + fi
290 +
291 + if use python; then
292 + rm -f "${S}"/swig/python/*_wrap.cpp || die
293 + emake -C "${S}"/swig/python generate
294 + pushd "${S}"/swig/python > /dev/null || die
295 + distutils-r1_src_compile
296 + popd > /dev/null || die
297 + fi
298 +
299 + use doc && emake docs
300 +}
301 +
302 +src_install() {
303 + if use perl ; then
304 + pushd "${S}"/swig/perl > /dev/null || die
305 + myinst=( DESTDIR="${D}" )
306 + perl-module_src_install
307 + popd > /dev/null || die
308 + sed -e 's:BINDINGS = \(.*\) perl:BINDINGS = \1:g' \
309 + -i GDALmake.opt || die
310 + fi
311 +
312 + use perl && perl_delete_localpod
313 +
314 + local DOCS=( Doxyfile HOWTO-RELEASE NEWS )
315 + use doc && HTML_DOCS=( html/. )
316 +
317 + default
318 +
319 + python_install() {
320 + distutils-r1_python_install
321 + python_doscript scripts/*.py
322 + }
323 +
324 + if use python; then
325 + # Don't clash with gdal's docs
326 + unset DOCS HTML_DOCS
327 +
328 + pushd "${S}"/swig/python > /dev/null || die
329 + distutils-r1_src_install
330 + popd > /dev/null || die
331 +
332 + newdoc swig/python/README.txt README-python.txt
333 +
334 + insinto /usr/share/${PN}/samples
335 + doins -r swig/python/samples/
336 + fi
337 +
338 + doman "${S}"/man/man*/*
339 + find "${D}" -name '*.la' -type f -delete || die
340 +}
341 +
342 +pkg_postinst() {
343 + elog "Check available image and data formats after building with"
344 + elog "gdalinfo and ogrinfo (using the --formats switch)."
345 +}