Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/gdal/
Date: Tue, 04 Jan 2022 11:35:05
Message-Id: 1641296080.188fd670f4bf39726bc0468d7d21fa4f6b666b22.sam@gentoo
1 commit: 188fd670f4bf39726bc0468d7d21fa4f6b666b22
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 4 11:34:40 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 4 11:34:40 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=188fd670
7
8 sci-libs/gdal: add 3.4.1
9
10 Bug: https://bugs.gentoo.org/830370
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 sci-libs/gdal/Manifest | 1 +
14 sci-libs/gdal/gdal-3.4.1.ebuild | 323 ++++++++++++++++++++++++++++++++++++++++
15 2 files changed, 324 insertions(+)
16
17 diff --git a/sci-libs/gdal/Manifest b/sci-libs/gdal/Manifest
18 index 47abf004c3d3..a5856f680d13 100644
19 --- a/sci-libs/gdal/Manifest
20 +++ b/sci-libs/gdal/Manifest
21 @@ -1,2 +1,3 @@
22 DIST gdal-3.3.3.tar.gz 19600111 BLAKE2B 2d4558062b35016372d6964884296878fdcef0afa83fb03b10cd902ce101ec52f551d48014d95b391d19b8db13d7ca1d639575b39e9421780f4212bef02dd51f SHA512 c49e4555e598e4182e6419758c31df08d46b8b061480f08be09d61e840057529bd833338eaa8c1ecfe1c6a0cc8cd6a073bf15fa6cdae003e4475485cf3851145
23 DIST gdal-3.4.0.tar.gz 20008930 BLAKE2B b4dad7226d2cfee3bdcab9782d2d35355501c1dd830d247099f6a8030311b86e7620e90f7bba675bf49dc47d166ab586fabe45ba02d9d7e9a73829194da6b360 SHA512 e363258172cff9647804be11f28ebec1614ddfbfc6eed72d44700c23aea674267e413099555d25e784d567ea915b5fb9092ff74b98d890dfcb8aae56b0575eb6
24 +DIST gdal-3.4.1.tar.gz 20022859 BLAKE2B fe6da8b3f098839bc5da9e49932a7a8e172b5dcb79f34eaa5f82a336cab3666223ae6f354c7847d1090e312838cc2e121e357c914cca3375541ee8ed31746edc SHA512 dcfd5f5ceac633838db2a92af6f6eb1c9fca55216885f071c7d8df8fc119aa800b2854c6e5ae84cdeea531e7e61296ad4378d798107c19d80d2ba4e1094299bf
25
26 diff --git a/sci-libs/gdal/gdal-3.4.1.ebuild b/sci-libs/gdal/gdal-3.4.1.ebuild
27 new file mode 100644
28 index 000000000000..620283cbc410
29 --- /dev/null
30 +++ b/sci-libs/gdal/gdal-3.4.1.ebuild
31 @@ -0,0 +1,323 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +GENTOO_DEPEND_ON_PERL="no"
38 +PYTHON_COMPAT=( python3_{8,9,10} )
39 +DISTUTILS_OPTIONAL=1
40 +inherit autotools bash-completion-r1 distutils-r1 flag-o-matic java-pkg-opt-2 perl-module toolchain-funcs
41 +
42 +DESCRIPTION="Translator library for raster geospatial data formats (includes OGR support)"
43 +HOMEPAGE="https://gdal.org/"
44 +SRC_URI="https://download.osgeo.org/${PN}/${PV}/${P}.tar.gz"
45 +
46 +# subslot is libgdal.so.<SONAME>
47 +SLOT="0/30"
48 +LICENSE="BSD Info-ZIP MIT"
49 +KEYWORDS="~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
50 +IUSE="armadillo +aux-xml curl cpu_flags_x86_avx cpu_flags_x86_sse cpu_flags_x86_ssse3 debug doc fits geos gif gml hdf5 heif java jpeg jpeg2k lzma mdb mysql netcdf odbc ogdi opencl oracle pdf perl png postgres python spatialite sqlite threads webp xls zstd"
51 +
52 +REQUIRED_USE="
53 + mdb? ( java )
54 + python? ( ${PYTHON_REQUIRED_USE} )
55 + spatialite? ( sqlite )
56 +"
57 +
58 +BDEPEND="
59 + virtual/pkgconfig
60 + doc? ( app-doc/doxygen )
61 + java? (
62 + dev-java/ant-core
63 + dev-lang/swig:0
64 + >=virtual/jdk-1.8:*
65 + )
66 + perl? ( dev-lang/swig:0 )
67 + python? (
68 + dev-lang/swig:0
69 + dev-python/setuptools[${PYTHON_USEDEP}]
70 + )
71 +"
72 +DEPEND="
73 + dev-libs/expat
74 + dev-libs/json-c:=
75 + dev-libs/libpcre
76 + dev-libs/libxml2:2
77 + dev-libs/openssl:=
78 + media-libs/tiff
79 + >=sci-libs/libgeotiff-1.5.1-r1:=
80 + >=sci-libs/proj-6.0.0:=
81 + sys-libs/zlib[minizip(+)]
82 + armadillo? ( sci-libs/armadillo:=[lapack] )
83 + curl? ( net-misc/curl )
84 + fits? ( sci-libs/cfitsio:= )
85 + geos? ( >=sci-libs/geos-3.8.0 )
86 + gif? ( media-libs/giflib:= )
87 + gml? ( >=dev-libs/xerces-c-3.1 )
88 + heif? ( media-libs/libheif:= )
89 + hdf5? ( >=sci-libs/hdf5-1.6.4:=[szip] )
90 + jpeg? ( virtual/jpeg:0= )
91 + jpeg2k? ( media-libs/openjpeg:2= )
92 + lzma? ( || (
93 + app-arch/xz-utils
94 + app-arch/lzma
95 + ) )
96 + mdb? ( dev-java/jackcess:1 )
97 + mysql? ( virtual/mysql )
98 + netcdf? ( sci-libs/netcdf:= )
99 + odbc? ( dev-db/unixODBC )
100 + ogdi? ( sci-libs/ogdi )
101 + opencl? ( virtual/opencl )
102 + oracle? ( dev-db/oracle-instantclient:= )
103 + pdf? ( app-text/poppler:= )
104 + perl? ( dev-lang/perl:= )
105 + png? ( media-libs/libpng:0= )
106 + postgres? ( >=dev-db/postgresql-8.4:= )
107 + python? (
108 + ${PYTHON_DEPS}
109 + dev-python/numpy[${PYTHON_USEDEP}]
110 + )
111 + spatialite? ( dev-db/spatialite )
112 + sqlite? ( dev-db/sqlite:3 )
113 + webp? ( media-libs/libwebp:= )
114 + xls? ( dev-libs/freexl )
115 + zstd? ( app-arch/zstd:= )
116 +"
117 +RDEPEND="${DEPEND}
118 + java? ( >=virtual/jre-1.8:* )
119 +"
120 +
121 +PATCHES=(
122 + "${FILESDIR}/${PN}-2.2.3-soname.patch"
123 + "${FILESDIR}/${PN}-2.3.0-curl.patch" # bug 659840
124 + "${FILESDIR}/${PN}-3.3.0-libdir.patch"
125 +)
126 +
127 +src_prepare() {
128 + default
129 +
130 + # Drop a --prefix hack in the upstream build system
131 + # We don't want the line at all, so let's just drop it rather than
132 + # trying to put in the right libdir value.
133 + # bug #696106
134 + sed -e '/\$ADD_PREFIX\/lib/d' \
135 + -i configure.ac || die
136 +
137 + sed -e "s: /usr/: \"${EPREFIX}\"/usr/:g" \
138 + -i configure.ac || die
139 +
140 + sed -e 's:^ar:$(AR):g' \
141 + -i ogr/ogrsf_frmts/sdts/install-libs.sh || die
142 +
143 + # SWIG: Use of the include path to find the input file is deprecated and will not work with ccache.
144 + sed -e "s: gdal_array.i: ../include/gdal_array.i:" \
145 + -i swig/python/GNUmakefile || die "sed python makefile failed"
146 +
147 + # autoconf 2.70+
148 + # bug #775209
149 + config_rpath_update .
150 +
151 + eautoreconf
152 +}
153 +
154 +src_configure() {
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-lto
165 + --disable-static
166 + --disable-driver-bsb
167 + --disable-driver-mrf
168 + --disable-pdf-plugin
169 + --enable-shared
170 + --enable-driver-grib
171 + --with-bash-completion="$(get_bashcompdir)"
172 + --with-cpp14
173 + --with-crypto
174 + --with-cryptopp=no
175 + --with-expat
176 + --with-geotiff
177 + --with-gnm
178 + --with-hide-internal-symbols
179 + --with-libjson-c="${ESYSROOT}"/usr
180 + --with-libtiff
181 + --with-libtool
182 + --with-libz="${ESYSROOT}"/usr
183 + --without-blosc
184 + --without-charls
185 + --without-dods-root
186 + --without-ecw
187 + --without-fgdb
188 + --without-fme
189 + --without-gta
190 + --without-grass
191 + --without-hdf4
192 + --without-idb
193 + --without-ingres
194 + --without-jasper
195 + --without-jp2lura
196 + --without-jp2mrsid
197 + # libjxl yet packaged.
198 + --without-jxl
199 + --without-kakadu
200 + --without-kea
201 + --without-libkml
202 + --without-lz4
203 + --without-mongocxx
204 + --without-mrsid
205 + --without-mrsid_lidar
206 + --without-msg
207 + --without-rasdaman
208 + --without-rasterlite2
209 + # Revisit when OpenEXR 3 / ilmmath migration is more complete in tree
210 + --without-exr
211 + --without-pcraster
212 + --without-pdfium
213 + --without-perl
214 + --without-podofo
215 + --without-python
216 + --without-qhull
217 + --without-sfcgal
218 + --without-sosi
219 + --without-teigha
220 + $(use_enable debug)
221 + $(use_with armadillo)
222 + $(use_with aux-xml pam)
223 + $(use_with curl)
224 + $(use_with cpu_flags_x86_avx avx)
225 + $(use_with cpu_flags_x86_sse sse)
226 + $(use_with cpu_flags_x86_ssse3 ssse3)
227 + $(use_with fits cfitsio)
228 + $(use_with geos)
229 + $(use_with gif)
230 + $(use_with gml xerces)
231 + $(use_with heif)
232 + $(use_with hdf5)
233 + $(use_with jpeg pcidsk) # pcidsk is internal, because there is no such library released developer by gdal
234 + $(use_with jpeg)
235 + $(use_with jpeg2k openjpeg)
236 + $(use_with lzma liblzma)
237 + $(use_with mysql mysql "${EPREFIX}"/usr/bin/mysql_config)
238 + $(use_with netcdf)
239 + $(use_with oracle oci)
240 + $(use_with odbc)
241 + $(use_with ogdi ogdi "${EPREFIX}"/usr)
242 + $(use_with opencl)
243 + $(use_with pdf poppler)
244 + $(use_with png)
245 + $(use_with postgres pg)
246 + $(use_with spatialite)
247 + $(use_with sqlite sqlite3 "${EPREFIX}"/usr)
248 + $(use_with threads)
249 + $(use_with webp)
250 + $(use_with xls freexl)
251 + $(use_with zstd)
252 + )
253 +
254 + tc-export AR RANLIB
255 +
256 + if use java; then
257 + myconf+=(
258 + --with-java=$(java-config --jdk-home 2>/dev/null)
259 + --with-jvm-lib=dlopen
260 + $(use_with mdb)
261 + )
262 + else
263 + myconf+=( --without-java --without-mdb )
264 + fi
265 +
266 + if use sqlite; then
267 + append-libs -lsqlite3
268 + fi
269 +
270 + # bug #632660
271 + if use ogdi; then
272 + append-cflags $($(tc-getPKG_CONFIG) --cflags libtirpc)
273 + append-cxxflags $($(tc-getPKG_CONFIG) --cflags libtirpc)
274 + fi
275 +
276 + ECONF_SOURCE="${S}" econf "${myconf[@]}"
277 +
278 + # mysql-config puts this in (and boy is it a PITA to get it out)
279 + if use mysql; then
280 + sed -e "s: -rdynamic : :" \
281 + -i GDALmake.opt || die "sed LIBS failed"
282 + fi
283 +}
284 +
285 +src_compile() {
286 + if use perl; then
287 + rm "${S}"/swig/perl/*_wrap.cpp || die
288 + emake -C "${S}"/swig/perl generate
289 + fi
290 +
291 + # gdal-config needed before generating Python bindings
292 + default
293 +
294 + if use java; then
295 + pushd "${S}"/swig/java > /dev/null || die
296 + emake
297 + popd > /dev/null || die
298 + fi
299 +
300 + if use perl; then
301 + pushd "${S}"/swig/perl > /dev/null || die
302 + perl-module_src_configure
303 + perl-module_src_compile
304 + popd > /dev/null || die
305 + fi
306 +
307 + if use python; then
308 + rm -f "${S}"/swig/python/*_wrap.cpp || die
309 + emake -C "${S}"/swig/python generate
310 + pushd "${S}"/swig/python > /dev/null || die
311 + distutils-r1_src_compile
312 + popd > /dev/null || die
313 + fi
314 +
315 + use doc && emake docs
316 +}
317 +
318 +src_install() {
319 + use doc && local HTML_DOCS=( html/. )
320 +
321 + default
322 +
323 + # Respect libdir in pkgconfig file
324 + sed -i -e "s:\${exec_prefix}/lib:\${exec_prefix}/$(get_libdir):" "${ED}"/usr/$(get_libdir)/pkgconfig/gdal.pc || die
325 +
326 + use java && java-pkg_dojar "${S}"/swig/java/gdal.jar
327 +
328 + if use perl; then
329 + pushd "${S}"/swig/perl > /dev/null || die
330 + myinst=( DESTDIR="${D}" )
331 + perl-module_src_install
332 + popd > /dev/null || die
333 + perl_delete_localpod
334 + fi
335 +
336 + if use python; then
337 + # Don't clash with gdal's docs
338 + unset DOCS HTML_DOCS
339 +
340 + pushd "${S}"/swig/python > /dev/null || die
341 + distutils-r1_src_install
342 + popd > /dev/null || die
343 +
344 + newdoc swig/python/README.rst README-python.rst
345 + fi
346 +
347 + doman "${S}"/man/man*/*
348 + find "${ED}" -name '*.la' -type f -delete || die
349 +}
350 +
351 +pkg_postinst() {
352 + elog "Check available image and data formats after building with"
353 + elog "gdalinfo and ogrinfo (using the --formats switch)."
354 +}