/[gentoo-x86]/sci-libs/gdal/gdal-2.0.0.ebuild
Gentoo

Contents of /sci-libs/gdal/gdal-2.0.0.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Jul 8 08:28:11 2015 UTC (5 years ago) by patrick
Branch: MAIN
CVS Tags: HEAD
Bump #552544

(Portage version: 2.2.20/cvs/Linux x86_64, unsigned Manifest commit)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/gdal/gdal-1.11.2.ebuild,v 1.1 2015/07/08 05:36:17 patrick Exp $
4
5 EAPI=5
6
7 WANT_AUTOCONF="2.5"
8
9 GENTOO_DEPEND_ON_PERL="no"
10 PYTHON_COMPAT=( python2_7 python3_{3,4} )
11 DISTUTILS_OPTIONAL=1
12
13 inherit autotools eutils libtool perl-module distutils-r1 python-r1 toolchain-funcs java-pkg-opt-2
14
15 DESCRIPTION="Translator library for raster geospatial data formats (includes OGR support)"
16 HOMEPAGE="http://www.gdal.org/"
17 SRC_URI="http://download.osgeo.org/${PN}/${PV}/${P}.tar.gz"
18
19 SLOT="0"
20 LICENSE="MIT"
21 KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
22 IUSE="armadillo +aux_xml curl debug doc fits geos gif gml hdf5 java jpeg jpeg2k mdb mysql netcdf odbc ogdi opencl pdf perl png postgres python ruby spatialite sqlite threads xls"
23
24 RDEPEND="
25 dev-libs/expat
26 dev-libs/json-c
27 dev-libs/libpcre
28 dev-libs/libxml2
29 media-libs/tiff:0=
30 sci-libs/libgeotiff
31 sys-libs/zlib[minizip(+)]
32 armadillo? ( sci-libs/armadillo[lapack] )
33 curl? ( net-misc/curl )
34 fits? ( sci-libs/cfitsio )
35 geos? ( >=sci-libs/geos-2.2.1 )
36 gif? ( media-libs/giflib )
37 gml? ( >=dev-libs/xerces-c-3 )
38 hdf5? ( >=sci-libs/hdf5-1.6.4[szip] )
39 java? ( >=virtual/jre-1.6:* )
40 jpeg? ( virtual/jpeg:0= )
41 jpeg2k? ( media-libs/jasper )
42 mysql? ( virtual/mysql )
43 netcdf? ( sci-libs/netcdf )
44 odbc? ( dev-db/unixODBC )
45 ogdi? ( sci-libs/ogdi )
46 opencl? ( virtual/opencl )
47 pdf? ( >=app-text/poppler-0.24.3:= )
48 perl? ( dev-lang/perl:= )
49 png? ( media-libs/libpng:0= )
50 postgres? ( >=dev-db/postgresql-8.4:= )
51 python? (
52 ${PYTHON_DEPS}
53 dev-python/setuptools[${PYTHON_USEDEP}]
54 dev-python/numpy[${PYTHON_USEDEP}]
55 )
56 ruby? ( dev-lang/ruby:1.9 )
57 sqlite? ( dev-db/sqlite:3 )
58 spatialite? ( dev-db/spatialite )
59 xls? ( dev-libs/freexl )
60 "
61
62 SWIG_DEP=">=dev-lang/swig-2.0.2 <=dev-lang/swig-3.0.4"
63 DEPEND="${RDEPEND}
64 doc? ( app-doc/doxygen )
65 java? ( >=virtual/jdk-1.6 )
66 perl? ( ${SWIG_DEP} )
67 python? ( ${SWIG_DEP} )
68 ruby? ( ${SWIG_DEP} )"
69
70 AT_M4DIR="${S}/m4"
71 MAKEOPTS+=" -j1"
72
73 REQUIRED_USE="
74 spatialite? ( sqlite )
75 mdb? ( java )
76 "
77
78 pkg_setup() {
79 java-pkg-opt-2_pkg_setup
80 }
81
82 src_prepare() {
83 java-pkg-opt-2_src_prepare
84
85 # fix datadir and docdir placement
86 sed -i \
87 -e "s:@datadir@:@datadir@/gdal:" \
88 -e "s:@exec_prefix@/doc:@exec_prefix@/share/doc/${PF}/html:g" \
89 "${S}"/GDALmake.opt.in || die
90
91 # the second sed expression should fix bug 371075
92 sed -i \
93 -e "s:setup.py install:setup.py install --root=\$(DESTDIR):" \
94 -e "s:--prefix=\$(DESTDIR):--prefix=:" \
95 "${S}"/swig/python/GNUmakefile || die
96
97 epatch "${FILESDIR}"/${PN}-1.10.0-ruby-makefile.patch
98
99 # -soname is only accepted by GNU ld/ELF
100 [[ ${CHOST} == *-darwin* ]] \
101 && epatch "${FILESDIR}"/${PN}-1.5.0-install_name.patch \
102 || epatch "${FILESDIR}"/${PN}-1.5.0-soname.patch
103
104 # Fix spatialite/sqlite include issue
105 sed -i \
106 -e 's:spatialite/sqlite3.h:sqlite3.h:g' \
107 ogr/ogrsf_frmts/sqlite/ogr_sqlite.h || die
108
109 # Fix freexl configure check
110 sed -i \
111 -e 's:FREEXL_LIBS=missing):FREEXL_LIBS=missing,-lm):g' \
112 configure.in || die
113
114 sed \
115 -e "s: /usr/: \"${EPREFIX}\"/usr/:g" \
116 -i configure.in || die
117
118 sed \
119 -e 's:^ar:$(AR):g' \
120 -i ogr/ogrsf_frmts/sdts/install-libs.sh || die
121
122 tc-export AR RANLIB
123
124 eautoreconf
125
126 prepare_python() {
127 mkdir -p "${BUILD_DIR}" || die
128 find "${S}" -type d -maxdepth 1 -exec ln -s {} "${BUILD_DIR}"/ \; ||die
129 find "${S}" -type f -maxdepth 1 -exec cp --target="${BUILD_DIR}"/ {} + ||die
130 # mkdir -p "${BUILD_DIR}"/swig/python || die
131 # mkdir -p "${BUILD_DIR}"/apps || die
132 # cp -dpR --target="${BUILD_DIR}"/swig/ \
133 # "${S}"/swig/{python,SWIGmake.base,GNUmakefile} || die
134 # ln -s "${S}"/swig/include "${BUILD_DIR}"/swig/ || die
135 # ln -s "${S}"/apps/gdal-config "${BUILD_DIR}"/apps/ || die
136 # ln -s "${S}"/port "${BUILD_DIR}"/ || die
137 }
138 if use python; then
139 python_foreach_impl prepare_python
140 fi
141 }
142
143 gdal_src_configure() {
144 local myopts=""
145
146 if use ruby; then
147 RUBY_MOD_DIR="$(ruby19 -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')"
148 echo "Ruby module dir is: $RUBY_MOD_DIR"
149 fi
150
151 if use java; then
152 myopts+="
153 --with-java=$(java-config --jdk-home 2>/dev/null)
154 $(use_with mdb)"
155 else
156 myopts+=" --without-java --without-mdb"
157 use mdb && ewarn "mdb requires java use enabled. disabling"
158 fi
159
160 if use sqlite; then
161 myopts+=" LIBS=-lsqlite3"
162 fi
163
164 # pcidsk is internal, because there is no such library yet released
165 # also that thing is developed by the gdal people
166 # kakadu, mrsid jp2mrsid - another jpeg2k stuff, ignore
167 # bsb - legal issues
168 # oracle - disabled, i dont have and can't test
169 # ingres - same story as oracle oci
170 # podofo - we use poppler instead they are exclusive for each other
171 # tiff is a hard dep
172 ECONF_SOURCE="${S}" econf \
173 --includedir="${EPREFIX}/usr/include/${PN}" \
174 --disable-static \
175 --enable-shared \
176 --with-expat \
177 --with-geotiff \
178 --with-grib \
179 --with-libtiff \
180 --with-libz="${EPREFIX}/usr/" \
181 --with-ogr \
182 --without-bsb \
183 --without-dods-root \
184 --without-dwgdirect \
185 --without-epsilon \
186 --without-fme \
187 --without-grass \
188 --without-hdf4 \
189 --without-idb \
190 --without-ingres \
191 --without-jp2mrsid \
192 --without-kakadu \
193 --without-libtool \
194 --without-mrsid \
195 --without-msg \
196 --without-oci \
197 --without-pcraster \
198 --without-podofo \
199 --without-sde \
200 $(use_enable debug) \
201 $(use_with armadillo) \
202 $(use_with aux_xml pam) \
203 $(use_with curl) \
204 --without-ecw \
205 $(use_with fits cfitsio) \
206 $(use_with geos) \
207 $(use_with gif) \
208 $(use_with gml xerces) \
209 $(use_with hdf5) \
210 $(use_with jpeg pcidsk) \
211 $(use_with jpeg) \
212 $(use_with jpeg2k jasper) \
213 $(use_with mysql mysql "${EPREFIX}"/usr/bin/mysql_config) \
214 $(use_with netcdf) \
215 $(use_with odbc) \
216 $(use_with ogdi ogdi "${EPREFIX}"/usr) \
217 $(use_with opencl) \
218 $(use_with pdf poppler) \
219 $(use_with perl) \
220 $(use_with png) \
221 $(use_with postgres pg) \
222 $(use_with python) \
223 $(use_with ruby) \
224 $(use_with spatialite) \
225 $(use_with sqlite sqlite3 "${EPREFIX}"/usr) \
226 $(use_with threads) \
227 $(use_with xls freexl) \
228 ${myopts}
229
230 # mysql-config puts this in (and boy is it a PITA to get it out)
231 if use mysql; then
232 sed -i \
233 -e "s: -rdynamic : :" \
234 GDALmake.opt || die "sed LIBS failed"
235 fi
236
237 if [[ -n $use_python ]]; then
238 # updated for newer swig (must specify the path to input files)
239 sed -i \
240 -e "s: gdal_array.i: ../include/gdal_array.i:" \
241 -e "s:\$(DESTDIR)\$(prefix):\$(DESTDIR)\$(INST_PREFIX):g" \
242 swig/python/GNUmakefile || die "sed python makefile failed"
243 sed -i \
244 -e "s:library_dirs = :library_dirs = /usr/$(get_libdir):g" \
245 swig/python/setup.cfg || die "sed python setup.cfg failed"
246 # -e "s:gdal_config=.*$:gdal_config=../../../apps/gdal-config:g" \
247 fi
248 }
249
250 src_configure() {
251 local use_python=""
252
253 gdal_src_configure
254
255 if use python; then
256 use_python="yes"
257 python_foreach_impl run_in_build_dir gdal_src_configure
258 fi
259 }
260
261 src_compile() {
262 local i
263 for i in perl ruby; do
264 if use $i; then
265 rm "${S}"/swig/$i/*_wrap.cpp
266 emake -C "${S}"/swig/$i generate
267 fi
268 done
269
270 default
271
272 if use perl ; then
273 pushd "${S}"/swig/perl > /dev/null
274 perl-module_src_configure
275 perl-module_src_compile
276 popd > /dev/null
277 fi
278
279 use doc && emake docs
280
281 compile_python() {
282 rm -f swig/python/*_wrap.cpp
283 emake -C swig/python generate
284 emake -C swig/python build
285 }
286 if use python; then
287 python_foreach_impl run_in_build_dir compile_python
288 fi
289 }
290
291 src_install() {
292 if use perl ; then
293 pushd "${S}"/swig/perl > /dev/null
294 perl-module_src_install
295 popd > /dev/null
296 sed -i \
297 -e "s:BINDINGS = python ruby perl:BINDINGS = python ruby:g" \
298 GDALmake.opt || die
299 fi
300
301 default
302
303 if use ruby ; then
304 # weird reinstall collision; needs manual intervention...
305 pushd "${S}"/swig/ruby > /dev/null
306 rm -rf "${D}"${RUBY_MOD_DIR}/gdal
307 exeinto ${RUBY_MOD_DIR}/gdal
308 doexe *.so || die "doins ruby modules failed"
309 popd > /dev/null
310 fi
311
312 use perl && perl_delete_localpod
313
314 dodoc Doxyfile HOWTO-RELEASE NEWS
315
316 if use doc ; then
317 dohtml html/*
318 docinto ogr
319 dohtml ogr/html/*
320 fi
321
322 install_python() {
323 emake -C swig/python DESTDIR="${D}" install
324 }
325 if use python; then
326 python_foreach_impl run_in_build_dir install_python
327 newdoc swig/python/README.txt README-python.txt
328 insinto /usr/share/${PN}/samples
329 doins swig/python/samples/*
330 python_replicate_script "${ED}"/usr/bin/*py
331 fi
332
333 pushd man/man1 > /dev/null
334 for i in * ; do
335 newman ${i} ${i}
336 done
337 popd > /dev/null
338 }
339
340 pkg_postinst() {
341 elog "Check available image and data formats after building with"
342 elog "gdalinfo and ogrinfo (using the --formats switch)."
343 }

  ViewVC Help
Powered by ViewVC 1.1.20