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