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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Wed Nov 5 15:58:23 2014 UTC (5 years, 8 months ago) by titanofold
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Fix bugs 361299 and 524052.

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

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