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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Wed Jul 8 05:36:17 2015 UTC (5 years ago) by patrick
Branch: MAIN
CVS Tags: HEAD
Bump, restrict swig dependency to avoid build failure

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

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

  ViewVC Help
Powered by ViewVC 1.1.20