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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations) (download)
Mon Aug 3 23:03:10 2015 UTC (4 years, 11 months ago) by mrueg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +1 -1 lines
FILE REMOVED
Remove old.

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

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

  ViewVC Help
Powered by ViewVC 1.1.20