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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Fri Jul 22 22:55:24 2011 UTC (8 years, 11 months ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Version bump to the latest. Drop older.

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

  ViewVC Help
Powered by ViewVC 1.1.20