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

Contents of /sci-libs/gdal/gdal-1.11.1-r3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Wed Jul 8 05:36:17 2015 UTC (5 years ago) by patrick
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +2 -2 lines
Bump, restrict swig dependency to avoid build failure

(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.1-r3.ebuild,v 1.6 2015/04/26 17:19:23 pacho 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 # Fix swig-3.0.3 problem (bug #534168)
123 epatch "${FILESDIR}"/${PN}-1.11.1-swig-3.0.3.patch
124
125 # bug 540132
126 epatch "${FILESDIR}"/${PN}-1.11.1-poppler-0.31.0-support.patch
127
128 tc-export AR RANLIB
129
130 eautoreconf
131
132 prepare_python() {
133 mkdir -p "${BUILD_DIR}" || die
134 find "${S}" -type d -maxdepth 1 -exec ln -s {} "${BUILD_DIR}"/ \; ||die
135 find "${S}" -type f -maxdepth 1 -exec cp --target="${BUILD_DIR}"/ {} + ||die
136 # mkdir -p "${BUILD_DIR}"/swig/python || die
137 # mkdir -p "${BUILD_DIR}"/apps || die
138 # cp -dpR --target="${BUILD_DIR}"/swig/ \
139 # "${S}"/swig/{python,SWIGmake.base,GNUmakefile} || die
140 # ln -s "${S}"/swig/include "${BUILD_DIR}"/swig/ || die
141 # ln -s "${S}"/apps/gdal-config "${BUILD_DIR}"/apps/ || die
142 # ln -s "${S}"/port "${BUILD_DIR}"/ || die
143 }
144 if use python; then
145 python_foreach_impl prepare_python
146 fi
147 }
148
149 gdal_src_configure() {
150 local myopts=""
151
152 if use ruby; then
153 RUBY_MOD_DIR="$(ruby19 -r rbconfig -e 'print RbConfig::CONFIG["sitearchdir"]')"
154 echo "Ruby module dir is: $RUBY_MOD_DIR"
155 fi
156
157 if use java; then
158 myopts+="
159 --with-java=$(java-config --jdk-home 2>/dev/null)
160 $(use_with mdb)"
161 else
162 myopts+=" --without-java --without-mdb"
163 use mdb && ewarn "mdb requires java use enabled. disabling"
164 fi
165
166 if use sqlite; then
167 myopts+=" LIBS=-lsqlite3"
168 fi
169
170 # pcidsk is internal, because there is no such library yet released
171 # also that thing is developed by the gdal people
172 # kakadu, mrsid jp2mrsid - another jpeg2k stuff, ignore
173 # bsb - legal issues
174 # oracle - disabled, i dont have and can't test
175 # ingres - same story as oracle oci
176 # podofo - we use poppler instead they are exclusive for each other
177 # tiff is a hard dep
178 ECONF_SOURCE="${S}" econf \
179 --includedir="${EPREFIX}/usr/include/${PN}" \
180 --disable-static \
181 --enable-shared \
182 --with-expat \
183 --with-geotiff \
184 --with-grib \
185 --with-libtiff \
186 --with-libz="${EPREFIX}/usr/" \
187 --with-ogr \
188 --without-bsb \
189 --without-dods-root \
190 --without-dwgdirect \
191 --without-epsilon \
192 --without-fme \
193 --without-grass \
194 --without-hdf4 \
195 --without-idb \
196 --without-ingres \
197 --without-jp2mrsid \
198 --without-kakadu \
199 --without-libtool \
200 --without-mrsid \
201 --without-msg \
202 --without-oci \
203 --without-pcraster \
204 --without-podofo \
205 --without-sde \
206 $(use_enable debug) \
207 $(use_with armadillo) \
208 $(use_with aux_xml pam) \
209 $(use_with curl) \
210 --without-ecw \
211 $(use_with fits cfitsio) \
212 $(use_with geos) \
213 $(use_with gif) \
214 $(use_with gml xerces) \
215 $(use_with hdf5) \
216 $(use_with jpeg pcidsk) \
217 $(use_with jpeg) \
218 $(use_with jpeg2k jasper) \
219 $(use_with mysql mysql "${EPREFIX}"/usr/bin/mysql_config) \
220 $(use_with netcdf) \
221 $(use_with odbc) \
222 $(use_with ogdi ogdi "${EPREFIX}"/usr) \
223 $(use_with opencl) \
224 $(use_with pdf poppler) \
225 $(use_with perl) \
226 $(use_with png) \
227 $(use_with postgres pg) \
228 $(use_with python) \
229 $(use_with ruby) \
230 $(use_with spatialite) \
231 $(use_with sqlite sqlite3 "${EPREFIX}"/usr) \
232 $(use_with threads) \
233 $(use_with xls freexl) \
234 ${myopts}
235
236 # mysql-config puts this in (and boy is it a PITA to get it out)
237 if use mysql; then
238 sed -i \
239 -e "s: -rdynamic : :" \
240 GDALmake.opt || die "sed LIBS failed"
241 fi
242
243 if [[ -n $use_python ]]; then
244 # updated for newer swig (must specify the path to input files)
245 sed -i \
246 -e "s: gdal_array.i: ../include/gdal_array.i:" \
247 -e "s:\$(DESTDIR)\$(prefix):\$(DESTDIR)\$(INST_PREFIX):g" \
248 swig/python/GNUmakefile || die "sed python makefile failed"
249 sed -i \
250 -e "s:library_dirs = :library_dirs = /usr/$(get_libdir):g" \
251 swig/python/setup.cfg || die "sed python setup.cfg failed"
252 # -e "s:gdal_config=.*$:gdal_config=../../../apps/gdal-config:g" \
253 fi
254 }
255
256 src_configure() {
257 local use_python=""
258
259 gdal_src_configure
260
261 if use python; then
262 use_python="yes"
263 python_foreach_impl run_in_build_dir gdal_src_configure
264 fi
265 }
266
267 src_compile() {
268 local i
269 for i in perl ruby; do
270 if use $i; then
271 rm "${S}"/swig/$i/*_wrap.cpp
272 emake -C "${S}"/swig/$i generate
273 fi
274 done
275
276 default
277
278 if use perl ; then
279 pushd "${S}"/swig/perl > /dev/null
280 perl-module_src_configure
281 perl-module_src_compile
282 popd > /dev/null
283 fi
284
285 use doc && emake docs
286
287 compile_python() {
288 rm -f swig/python/*_wrap.cpp
289 emake -C swig/python generate
290 emake -C swig/python build
291 }
292 if use python; then
293 python_foreach_impl run_in_build_dir compile_python
294 fi
295 }
296
297 src_install() {
298 if use perl ; then
299 pushd "${S}"/swig/perl > /dev/null
300 perl-module_src_install
301 popd > /dev/null
302 sed -i \
303 -e "s:BINDINGS = python ruby perl:BINDINGS = python ruby:g" \
304 GDALmake.opt || die
305 fi
306
307 default
308
309 if use ruby ; then
310 # weird reinstall collision; needs manual intervention...
311 pushd "${S}"/swig/ruby > /dev/null
312 rm -rf "${D}"${RUBY_MOD_DIR}/gdal
313 exeinto ${RUBY_MOD_DIR}/gdal
314 doexe *.so || die "doins ruby modules failed"
315 popd > /dev/null
316 fi
317
318 use perl && perl_delete_localpod
319
320 dodoc Doxyfile HOWTO-RELEASE NEWS
321
322 if use doc ; then
323 dohtml html/*
324 docinto ogr
325 dohtml ogr/html/*
326 fi
327
328 install_python() {
329 emake -C swig/python DESTDIR="${D}" install
330 }
331 if use python; then
332 python_foreach_impl run_in_build_dir install_python
333 newdoc swig/python/README.txt README-python.txt
334 insinto /usr/share/${PN}/samples
335 doins swig/python/samples/*
336 python_replicate_script "${ED}"/usr/bin/*py
337 fi
338
339 pushd man/man1 > /dev/null
340 for i in * ; do
341 newman ${i} ${i}
342 done
343 popd > /dev/null
344 }
345
346 pkg_postinst() {
347 elog "Check available image and data formats after building with"
348 elog "gdalinfo and ogrinfo (using the --formats switch)."
349 }

  ViewVC Help
Powered by ViewVC 1.1.20