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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Sat Jun 11 11:49:31 2011 UTC (9 years ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Whitespace fixes. Depend only on swig-2.0 as it is only we mostly checked. punt overshadowed versions.

(Portage version: 2.2.0_alpha39/cvs/Linux x86_64)

1 # Copyright 1999-2011 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.8.0.ebuild,v 1.4 2011/02/26 22:19:38 signals Exp $
4
5 EAPI="2"
6
7 WANT_AUTOCONF="2.5"
8 RUBY_OPTIONAL="yes"
9 USE_RUBY="ruby18"
10 PYTHON_DEPEND="python? *:2.6"
11
12 inherit autotools eutils perl-module python ruby-ng toolchain-funcs
13
14 DESCRIPTION="GDAL is a translator library for raster geospatial data formats (includes OGR support)"
15 HOMEPAGE="http://www.gdal.org/"
16 SRC_URI="http://download.osgeo.org/gdal/${P}.tar.gz"
17
18 SLOT="0"
19 LICENSE="MIT"
20 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
21
22 IUSE="+aux_xml curl debug doc ecwj2k fits geos gif gml hdf5 jpeg jpeg2k mysql netcdf odbc ogdi perl png postgres python ruby sqlite threads"
23
24 RDEPEND="
25 dev-libs/expat
26 >=media-libs/tiff-4.0.0_beta6
27 sci-libs/libgeotiff
28 sys-libs/zlib
29 curl? ( net-misc/curl )
30 ecwj2k? ( sci-libs/libecwj2 )
31 fits? ( sci-libs/cfitsio )
32 geos? ( >=sci-libs/geos-2.2.1 )
33 gif? ( media-libs/giflib )
34 gml? ( >=dev-libs/xerces-c-3 )
35 hdf5? ( >=sci-libs/hdf5-1.6.4[szip] )
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 perl? ( dev-lang/perl )
43 png? ( media-libs/libpng )
44 postgres? (
45 || (
46 >=dev-db/postgresql-base-8.4
47 >=dev-db/postgresql-server-8.4
48 )
49 )
50 python? ( dev-python/numpy )
51 ruby? ( $(ruby_implementation_depend ruby18) )
52 sqlite? ( >=dev-db/sqlite-3 )
53 "
54
55 DEPEND="${RDEPEND}
56 doc? ( app-doc/doxygen )
57 perl? ( >=dev-lang/swig-1.3.32 )
58 python? ( >=dev-lang/swig-1.3.32 )
59 ruby? ( >=dev-lang/swig-1.3.32 )
60 "
61
62 AT_M4DIR="${S}/m4"
63 MAKEOPTS+=" -j1"
64
65 src_unpack() {
66 # prevent ruby-ng.eclass from messing with the src path
67 default
68 }
69
70 src_prepare() {
71 # fix datadir and docdir placement
72 sed -i \
73 -e "s:@datadir@:@datadir@/gdal:" \
74 -e "s:@exec_prefix@/doc:@exec_prefix@/share/doc/${PF}/html:g" \
75 GDALmake.opt.in || die
76
77 sed -i \
78 -e "s:setup.py install:setup.py install --root=\$(DESTDIR):" \
79 swig/python/GNUmakefile || die
80
81 epatch "${FILESDIR}"/1.7.2-ruby_cflags.patch
82
83 # -soname is only accepted by GNU ld/ELF
84 [[ ${CHOST} == *-darwin* ]] \
85 && epatch "${FILESDIR}"/${PN}-1.5.0-install_name.patch \
86 || epatch "${FILESDIR}"/${PN}-1.5.0-soname.patch
87
88 eautoreconf
89 }
90
91 src_configure() {
92 if use ruby; then
93 RUBY_MOD_DIR="$(ruby18 -r rbconfig -e 'print Config::CONFIG["sitearchdir"]')"
94 echo "Ruby module dir is: $RUBY_MOD_DIR"
95 fi
96
97 # pcidsk is internal, because there is no such library yet released
98 # also that thing is developed by the gdal people
99 # kakadu, mrsid jp2mrsid - another jpeg2k stuff, ignore
100 # bsb - legal issues
101 # oracle - disabled, i dont have and can't test
102 # ingres - same story as oracle oci
103 # tiff is a hard dep
104 econf \
105 --enable-shared \
106 --disable-static \
107 --with-expat \
108 --without-grass \
109 --without-hdf4 \
110 --without-fme \
111 --without-pcraster \
112 --without-kakadu \
113 --without-mrsid \
114 --without-jp2mrsid \
115 --without-msg \
116 --without-bsb \
117 --without-dods-root \
118 --without-oci \
119 --without-ingres \
120 --without-spatialite \
121 --without-dwgdirect \
122 --without-epsilon \
123 --without-idb \
124 --without-sde \
125 --without-libtool \
126 --with-libz="${EPREFIX}/usr/" \
127 --with-ogr \
128 --with-grib \
129 --with-vfk \
130 --with-libtiff \
131 --with-geotiff \
132 $(use_enable debug) \
133 $(use_with postgres pg) \
134 $(use_with fits cfitsio) \
135 $(use_with netcdf) \
136 $(use_with png) \
137 $(use_with jpeg) \
138 $(use_with jpeg pcidsk) \
139 $(use_with gif) \
140 $(use_with ogdi ogdi "${EPREFIX}"/usr) \
141 $(use_with hdf5) \
142 $(use_with jpeg2k jasper) \
143 $(use_with ecwj2k ecw) \
144 $(use_with gml xerces) \
145 $(use_with odbc) \
146 $(use_with curl) \
147 $(use_with sqlite sqlite3 "${EPREFIX}"/usr) \
148 $(use_with mysql mysql "${EPREFIX}"/usr/bin/mysql_config) \
149 $(use_with geos) \
150 $(use_with aux_xml pam) \
151 $(use_with perl) \
152 $(use_with ruby) \
153 $(use_with python) \
154 $(use_with threads) \
155 --with-pymoddir="${EPREFIX}"/$(python_get_sitedir)
156
157 # mysql-config puts this in (and boy is it a PITA to get it out)
158 if use mysql; then
159 sed -i \
160 -e "s: -rdynamic : :" \
161 GDALmake.opt || die "sed LIBS failed"
162 fi
163
164 # updated for newer swig (must specify the path to input files)
165 if use python; then
166 sed -i \
167 -e "s: gdal_array.i: ../include/gdal_array.i:" \
168 -e "s:\$(DESTDIR)\$(prefix):\$(DESTDIR)\$(INST_PREFIX):g" \
169 swig/python/GNUmakefile || die "sed python makefile failed"
170 sed -i \
171 -e "s:library_dirs = :library_dirs = /usr/$(get_libdir):g" \
172 swig/python/setup.cfg || die "sed python setup.cfg failed"
173 fi
174 }
175
176 src_compile() {
177 local i
178 for i in perl ruby python; do
179 if use $i; then
180 rm "${S}"/swig/$i/*_wrap.cpp
181 emake -C "${S}"/swig/$i generate || \
182 die "make generate failed for swig/$i"
183 fi
184 done
185
186 # parallel makes fail
187 emake || die "emake failed"
188
189 if use perl ; then
190 cd "${S}"/swig/perl
191 perl-module_src_prep
192 perl-module_src_compile
193 cd "${S}"
194 fi
195
196 if use doc ; then
197 make docs || die "make docs failed"
198 fi
199 }
200
201 src_install() {
202 if use perl ; then
203 pushd "${S}"/swig/perl > /dev/null
204 perl-module_src_install
205 popd > /dev/null
206 sed -i \
207 -e "s:BINDINGS = python ruby perl:BINDINGS = python ruby:g" \
208 GDALmake.opt || die
209 fi
210
211 emake DESTDIR="${D}" install || die "make install failed"
212
213 if use ruby ; then
214 # weird reinstall collision; needs manual intervention...
215 pushd "${S}"/swig/ruby > /dev/null
216 rm -rf "${D}"${RUBY_MOD_DIR}/gdal
217 exeinto ${RUBY_MOD_DIR}/gdal
218 doexe *.so || die "doins ruby modules failed"
219 popd > /dev/null
220 fi
221
222 use perl && fixlocalpod
223
224 dodoc Doxyfile HOWTO-RELEASE NEWS || die
225
226 if use doc ; then
227 dohtml html/* || die "install html failed"
228 docinto ogr
229 dohtml ogr/html/* || die "install ogr html failed"
230 fi
231
232 if use python; then
233 newdoc swig/python/README.txt README-python.txt || die
234 insinto /usr/share/${PN}/samples
235 doins swig/python/samples/* || die
236 fi
237 }
238
239 pkg_postinst() {
240 echo
241 elog "Check available image and data formats after building with"
242 elog "gdalinfo and ogrinfo (using the --formats switch)."
243 }

  ViewVC Help
Powered by ViewVC 1.1.20