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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Mon Nov 8 17:37:06 2010 UTC (9 years, 8 months ago) by xarthisius
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
media-libs/jpeg -> virtual/jpeg. Drop old.

(Portage version: 2.1.9.24/cvs/Linux x86_64)

1 # Copyright 1999-2010 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.1-r1.ebuild,v 1.6 2010/07/01 14:43:06 ssuominen Exp $
4
5 EAPI="3"
6
7 WANT_AUTOCONF="2.5"
8 RUBY_OPTIONAL="yes"
9 USE_RUBY="ruby18"
10
11 inherit autotools eutils perl-module python ruby toolchain-funcs
12
13 DESCRIPTION="GDAL is a translator library for raster geospatial data formats (includes OGR support)"
14 HOMEPAGE="http://www.gdal.org/"
15 SRC_URI="http://download.osgeo.org/gdal/${P}.tar.gz"
16
17 SLOT="0"
18 LICENSE="MIT"
19 KEYWORDS="~amd64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~ppc-macos ~x86-linux ~x86-macos"
20 # need to get these arches updated on several libs first
21 #KEYWORDS="~alpha ~hppa"
22
23 IUSE="curl debug doc ecwj2k fits geos gif gml hdf hdf5 jpeg jpeg2k mysql \
24 netcdf odbc png ogdi perl postgres python ruby sqlite threads"
25
26 RDEPEND=">=sys-libs/zlib-1.1.4
27 >=media-libs/tiff-3.9.1
28 sci-libs/libgeotiff
29 dev-libs/expat
30 curl? ( net-misc/curl )
31 jpeg? ( media-libs/jpeg )
32 gif? ( media-libs/giflib )
33 png? ( media-libs/libpng )
34 perl? ( dev-lang/perl )
35 python? ( virtual/python
36 dev-python/numpy )
37 ruby? ( >=dev-lang/ruby-1.8.4.20060226 )
38 fits? ( sci-libs/cfitsio )
39 ogdi? ( sci-libs/ogdi )
40 gml? ( >=dev-libs/xerces-c-3 )
41 hdf5? ( >=sci-libs/hdf5-1.6.4 )
42 postgres? ( dev-db/postgresql-base )
43 || (
44 netcdf? ( sci-libs/netcdf )
45 hdf? ( sci-libs/hdf )
46 )
47 || (
48 jpeg2k? ( media-libs/jasper )
49 ecwj2k? ( sci-libs/libecwj2 )
50 )
51 mysql? ( virtual/mysql )
52 odbc? ( dev-db/unixODBC )
53 geos? ( >=sci-libs/geos-2.2.1 )
54 sqlite? ( >=dev-db/sqlite-3 )"
55
56 DEPEND="${RDEPEND}
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 doc? ( app-doc/doxygen )"
61
62 EPATCH_OPTS="-F3"
63 AT_M4DIR="${S}/m4"
64
65 pkg_setup() {
66 if [ -n "${GDAL_CONFIGURE_OPTS}" ]; then
67 elog "User-specified configure options are ${GDAL_CONFIGURE_OPTS}."
68 else
69 elog "User-specified configure options are not set."
70 elog "If needed, set GDAL_CONFIGURE_OPTS to enable grass support."
71 fi
72 }
73
74 src_prepare() {
75 eaclocal
76 eautoconf
77
78 # this just preps the source for the last patch below
79 sed -i -e "s|-Xcompiler -shared|-shared|" \
80 swig/ruby/RubyMakefile.mk || die "sed failed"
81
82 epatch "${FILESDIR}"/${PN}-1.4.2-datadir.patch \
83 "${FILESDIR}"/${PN}-1.5.1-python-install.patch \
84 "${FILESDIR}"/${PN}-1.6.0-swig-fix.patch \
85 "${FILESDIR}"/${PN}-1.6.1-ruby-make.patch \
86 "${FILESDIR}"/${P}-warp_fix.patch
87
88 [[ ${CHOST} == *-darwin* ]] \
89 && epatch "${FILESDIR}"/${PN}-1.5.0-install_name.patch \
90 || epatch "${FILESDIR}"/${PN}-1.5.0-soname.patch
91
92 if useq hdf && useq netcdf; then
93 ewarn "Netcdf and HDF4 are incompatible due to certain tools in"
94 ewarn "common; HDF5 is now the preferred choice for HDF data."
95 die "Please disable either the hdf or netcdf use flag."
96 fi
97 }
98
99 src_configure() {
100 local pkg_conf="${GDAL_CONFIGURE_OPTS}"
101 local use_conf=""
102
103 pkg_conf="${pkg_conf} --enable-shared=yes --with-pic \
104 --with-libgrass=no --without-libtool --with-expat=${EPREFIX}/usr"
105
106 use_conf="$(use_with jpeg) $(use_with jpeg pcidsk) $(use_with png) $(use_with mysql) \
107 $(use_with postgres pg) $(use_with python) $(use_with ruby) \
108 $(use_with threads) $(use_with fits cfitsio) $(use_with perl) \
109 $(use_with netcdf) $(use_with hdf hdf4) $(use_with geos) \
110 $(use_with sqlite sqlite3 "${EPREFIX}"/usr) $(use_with jpeg2k jasper) $(use_with odbc) \
111 $(use_with gml xerces) $(use_with hdf5) $(use_with curl) \
112 $(use_enable debug)"
113
114 # It can't find this
115 if useq ogdi ; then
116 use_conf="--with-ogdi=${EPREFIX}/usr ${use_conf}"
117 fi
118
119 if useq mysql ; then
120 use_conf="--with-mysql=${EPREFIX}/usr/bin/mysql_config ${use_conf}"
121 fi
122
123 if useq gif ; then
124 use_conf="--with-gif=internal ${use_conf}"
125 else
126 use_conf="--with-gif=no ${use_conf}"
127 fi
128
129 if useq python ; then
130 use_conf="--with-pymoddir=${EPREFIX}/$(python_get_sitedir) ${use_conf}"
131 fi
132
133 if useq ruby ; then
134 RUBY_MOD_DIR=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitearchdir"]')
135 fi
136
137 # Fix doc path just in case
138 sed -i -e "s:@exec_prefix@/doc:@exec_prefix@/share/doc/${PF}/html:g" \
139 GDALmake.opt.in || die "sed gdalmake.opt failed"
140
141 econf ${pkg_conf} ${use_conf} || die "econf failed"
142
143 # mysql-config puts this in (and boy is it a PITA to get it out)
144 sed \
145 -i -e "s| -rdynamic | |" \
146 GDALmake.opt || die "sed LIBS failed"
147
148 # updated for newer swig (must specify the path to input files)
149 if useq python; then
150 sed -i -e "s| gdal_array.i| ../include/gdal_array.i|" \
151 -i -e "s:\$(DESTDIR)\$(prefix):\$(DESTDIR)\$(INST_PREFIX):g" \
152 swig/python/GNUmakefile || die "sed python makefile failed"
153 sed -i -e "s#library_dirs = #library_dirs = /usr/$(get_libdir):#g" \
154 swig/python/setup.cfg || die "sed python setup.cfg failed"
155 fi
156 }
157
158 src_compile() {
159 local i
160 for i in perl ruby python; do
161 if useq $i; then
162 rm "${S}"/swig/$i/*_wrap.cpp
163 emake -C "${S}"/swig/$i generate || \
164 die "make generate failed for swig/$i"
165 fi
166 done
167
168 # parallel makes fail on the ogr stuff (C++, what can I say?)
169 # also failing with gcc4 in libcsf
170 emake -j1 || die "emake failed"
171
172 if useq perl ; then
173 cd "${S}"/swig/perl
174 perl-module_src_prep
175 perl-module_src_compile
176 cd "${S}"
177 fi
178
179 if useq doc ; then
180 make docs || die "make docs failed"
181 fi
182 }
183
184 src_install() {
185 if useq perl ; then
186 cd "${S}"/swig/perl
187 perl-module_src_install
188 sed -i -e "s:BINDINGS = python ruby perl:BINDINGS = python ruby:g" \
189 GDALmake.opt
190 cd "${S}"
191 fi
192
193 # einstall causes sandbox violations on /usr/lib/libgdal.so
194 emake DESTDIR="${D}" install \
195 || die "make install failed"
196
197 if useq ruby ; then
198 # weird reinstall collision; needs manual intervention...
199 cd "${S}"/swig/ruby
200 rm -rf "${D}"${RUBY_MOD_DIR}/gdal
201 exeinto ${RUBY_MOD_DIR}/gdal
202 doexe *.so || die "doins ruby modules failed"
203 cd "${S}"
204 fi
205
206 use perl && fixlocalpod
207
208 dodoc Doxyfile HOWTO-RELEASE NEWS
209
210 if useq doc ; then
211 dohtml html/* || die "install html failed"
212 docinto ogr
213 dohtml ogr/html/* || die "install ogr html failed"
214 fi
215
216 if useq python; then
217 newdoc swig/python/README.txt README-python.txt
218 dodir /usr/share/${PN}/samples
219 insinto /usr/share/${PN}/samples
220 doins swig/python/samples/*
221 fi
222 }
223
224 pkg_postinst() {
225 elog
226 elog "If you need libgrass support, then you must rebuild gdal, after"
227 elog "installing the latest Grass, and set the following option:"
228 elog
229 elog "GDAL_CONFIGURE_OPTS=--with-grass=\$GRASS_HOME emerge gdal"
230 elog
231 elog "GDAL is most useful with full graphics support enabled via various"
232 elog "USE flags: png, jpeg, gif, jpeg2k, etc. Also python, fits, ogdi,"
233 elog "geos, and support for either netcdf or HDF4 is available, as well as"
234 elog "grass, and mysql, sqlite, or postgres (grass support requires grass 6"
235 elog "and rebuilding gdal). HDF5 support is now included."
236 elog
237 elog "Note: tiff and geotiff are now hard depends, so no USE flags."
238 elog "Also, this package will check for netcdf before hdf, so if you"
239 elog "prefer hdf, please emerge hdf with USE=szip prior to emerging"
240 elog "gdal. Detailed API docs require doxygen (man pages are free)."
241 elog
242 elog "Check available image and data formats after building with"
243 elog "gdalinfo and ogrinfo (using the --formats switch)."
244 elog
245 }

  ViewVC Help
Powered by ViewVC 1.1.20