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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Mon Jun 24 23:48:21 2013 UTC (7 years ago) by titanofold
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Actually apply the changes from bug 468592. Thanks Jean-Claude Repetto.

(Portage version: 2.1.11.62/cvs/Linux x86_64, signed Manifest commit with key D1BBFDA0)

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

  ViewVC Help
Powered by ViewVC 1.1.20