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