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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sat Jun 11 11:49:31 2011 UTC (9 years, 1 month ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +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.7.3.ebuild,v 1.3 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"
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 pkg_setup() {
66 # only py2 is supported
67 python_set_active_version 2
68 }
69
70 src_unpack() {
71 # prevent ruby-ng.eclass from messing with the src path
72 default
73 }
74
75 src_prepare() {
76 # fix datadir and docdir placement
77 sed -i \
78 -e "s:@datadir@:@datadir@/gdal:" \
79 -e "s:@exec_prefix@/doc:@exec_prefix@/share/doc/${PF}/html:g" \
80 GDALmake.opt.in || die
81
82 sed -i \
83 -e "s:setup.py install:setup.py install --root=\$(DESTDIR):" \
84 swig/python/GNUmakefile || die
85
86 epatch "${FILESDIR}"/1.7.2-ruby_cflags.patch
87
88 # -soname is only accepted by GNU ld/ELF
89 [[ ${CHOST} == *-darwin* ]] \
90 && epatch "${FILESDIR}"/${PN}-1.5.0-install_name.patch \
91 || epatch "${FILESDIR}"/${PN}-1.5.0-soname.patch
92
93 eautoreconf
94 }
95
96 src_configure() {
97 if use ruby; then
98 RUBY_MOD_DIR="$(ruby18 -r rbconfig -e 'print Config::CONFIG["sitearchdir"]')"
99 echo "Ruby module dir is: $RUBY_MOD_DIR"
100 fi
101
102 # pcidsk is internal, because there is no such library yet released
103 # also that thing is developed by the gdal people
104 # kakadu, mrsid jp2mrsid - another jpeg2k stuff, ignore
105 # bsb - legal issues
106 # oracle - disabled, i dont have and can't test
107 # ingres - same story as oracle oci
108 # tiff is a hard dep
109 econf \
110 --enable-shared \
111 --disable-static \
112 --with-expat \
113 --without-grass \
114 --without-hdf4 \
115 --without-fme \
116 --without-pcraster \
117 --without-kakadu \
118 --without-mrsid \
119 --without-jp2mrsid \
120 --without-msg \
121 --without-bsb \
122 --without-dods-root \
123 --without-oci \
124 --without-ingres \
125 --without-spatialite \
126 --without-dwgdirect \
127 --without-epsilon \
128 --without-idb \
129 --without-sde \
130 --without-libtool \
131 --with-libz="${EPREFIX}/usr/" \
132 --with-ogr \
133 --with-grib \
134 --with-vfk \
135 --with-libtiff \
136 --with-geotiff \
137 $(use_enable debug) \
138 $(use_with postgres pg) \
139 $(use_with fits cfitsio) \
140 $(use_with netcdf) \
141 $(use_with png) \
142 $(use_with jpeg) \
143 $(use_with jpeg pcidsk) \
144 $(use_with gif) \
145 $(use_with ogdi ogdi "${EPREFIX}"/usr) \
146 $(use_with hdf5) \
147 $(use_with jpeg2k jasper) \
148 $(use_with ecwj2k ecw) \
149 $(use_with gml xerces) \
150 $(use_with odbc) \
151 $(use_with curl) \
152 $(use_with sqlite sqlite3 "${EPREFIX}"/usr) \
153 $(use_with mysql mysql "${EPREFIX}"/usr/bin/mysql_config) \
154 $(use_with geos) \
155 $(use_with aux_xml pam) \
156 $(use_with perl) \
157 $(use_with ruby) \
158 $(use_with python) \
159 $(use_with threads) \
160 --with-pymoddir="${EPREFIX}"/$(python_get_sitedir)
161
162 # mysql-config puts this in (and boy is it a PITA to get it out)
163 if use mysql; then
164 sed -i \
165 -e "s: -rdynamic : :" \
166 GDALmake.opt || die "sed LIBS failed"
167 fi
168
169 # updated for newer swig (must specify the path to input files)
170 if use python; then
171 sed -i \
172 -e "s: gdal_array.i: ../include/gdal_array.i:" \
173 -e "s:\$(DESTDIR)\$(prefix):\$(DESTDIR)\$(INST_PREFIX):g" \
174 swig/python/GNUmakefile || die "sed python makefile failed"
175 sed -i \
176 -e "s:library_dirs = :library_dirs = /usr/$(get_libdir):g" \
177 swig/python/setup.cfg || die "sed python setup.cfg failed"
178 fi
179 }
180
181 src_compile() {
182 local i
183 for i in perl ruby python; do
184 if use $i; then
185 rm "${S}"/swig/$i/*_wrap.cpp
186 emake -C "${S}"/swig/$i generate || \
187 die "make generate failed for swig/$i"
188 fi
189 done
190
191 # parallel makes fail
192 emake || die "emake failed"
193
194 if use perl ; then
195 cd "${S}"/swig/perl
196 perl-module_src_prep
197 perl-module_src_compile
198 cd "${S}"
199 fi
200
201 if use doc ; then
202 make docs || die "make docs failed"
203 fi
204 }
205
206 src_install() {
207 if use perl ; then
208 pushd "${S}"/swig/perl > /dev/null
209 perl-module_src_install
210 popd > /dev/null
211 sed -i \
212 -e "s:BINDINGS = python ruby perl:BINDINGS = python ruby:g" \
213 GDALmake.opt || die
214 fi
215
216 emake DESTDIR="${D}" install || die "make install failed"
217
218 if use ruby ; then
219 # weird reinstall collision; needs manual intervention...
220 pushd "${S}"/swig/ruby > /dev/null
221 rm -rf "${D}"${RUBY_MOD_DIR}/gdal
222 exeinto ${RUBY_MOD_DIR}/gdal
223 doexe *.so || die "doins ruby modules failed"
224 popd > /dev/null
225 fi
226
227 use perl && fixlocalpod
228
229 dodoc Doxyfile HOWTO-RELEASE NEWS || die
230
231 if use doc ; then
232 dohtml html/* || die "install html failed"
233 docinto ogr
234 dohtml ogr/html/* || die "install ogr html failed"
235 fi
236
237 if use python; then
238 newdoc swig/python/README.txt README-python.txt || die
239 insinto /usr/share/${PN}/samples
240 doins swig/python/samples/* || die
241 fi
242 }
243
244 pkg_postinst() {
245 echo
246 elog "Check available image and data formats after building with"
247 elog "gdalinfo and ogrinfo (using the --formats switch)."
248 }

  ViewVC Help
Powered by ViewVC 1.1.20