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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.25 - (show annotations) (download)
Mon Jun 24 11:09:35 2013 UTC (7 years ago) by titanofold
Branch: MAIN
CVS Tags: HEAD
Changes since 1.24: +1 -1 lines
FILE REMOVED
Version bump. (Bug 468592) Call java-pkg-opt-2 functions. (Bug 471262; thanks to Tom Wijsman) Remove "=external". (Bug 470046; thanks to Ronan Dunklau.) Clean out old versions and patches, and update hdf to hdf5 in the local USE description.

(Portage version: 2.1.11.62/cvs/Linux x86_64, signed Manifest commit with key D1BBFDA0)

1 # Copyright 1999-2012 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.6.3-r1.ebuild,v 1.24 2012/05/19 20:01:03 ssuominen Exp $
4
5 EAPI=3
6
7 WANT_AUTOCONF="2.5"
8
9 RUBY_OPTIONAL="yes"
10 USE_RUBY="ruby18"
11
12 PYTHON_DEPEND="python? 2"
13
14 inherit autotools eutils perl-module python ruby 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 IUSE="curl debug doc ecwj2k fits geos gif gml hdf hdf5 jpeg jpeg2k mysql netcdf odbc png ogdi perl postgres python ruby sqlite threads"
24
25 RDEPEND="
26 dev-libs/expat
27 media-libs/tiff:0
28 sci-libs/libgeotiff
29 sys-libs/zlib
30 curl? ( net-misc/curl )
31 jpeg? ( virtual/jpeg )
32 gif? ( media-libs/giflib )
33 png? ( media-libs/libpng )
34 perl? ( dev-lang/perl )
35 python? ( dev-python/numpy )
36 ruby? ( >=dev-lang/ruby-1.8.4.20060226 )
37 fits? ( sci-libs/cfitsio )
38 ogdi? ( sci-libs/ogdi )
39 gml? ( >=dev-libs/xerces-c-3 )
40 hdf5? ( >=sci-libs/hdf5-1.6.4 )
41 postgres? ( dev-db/postgresql-base )
42 || (
43 netcdf? ( sci-libs/netcdf )
44 hdf? ( sci-libs/hdf )
45 )
46 || (
47 jpeg2k? ( media-libs/jasper )
48 ecwj2k? ( sci-libs/libecwj2 )
49 )
50 mysql? ( virtual/mysql )
51 odbc? ( dev-db/unixODBC )
52 geos? ( >=sci-libs/geos-2.2.1 )
53 sqlite? ( >=dev-db/sqlite-3 )"
54
55 DEPEND="${RDEPEND}
56 perl? ( >=dev-lang/swig-1.3.32 )
57 python? ( >=dev-lang/swig-1.3.32 )
58 ruby? ( >=dev-lang/swig-1.3.32 )
59 doc? ( app-doc/doxygen )"
60
61 AT_M4DIR="${S}/m4"
62
63 pkg_setup() {
64 if [ -n "${GDAL_CONFIGURE_OPTS}" ]; then
65 elog "User-specified configure options are ${GDAL_CONFIGURE_OPTS}."
66 else
67 elog "User-specified configure options are not set."
68 elog "If needed, set GDAL_CONFIGURE_OPTS to enable grass support."
69 fi
70 python_set_active_version 2
71 }
72
73 src_prepare() {
74 eaclocal
75 eautoconf
76
77 epatch \
78 "${FILESDIR}"/${PN}-1.4.2-datadir.patch \
79 "${FILESDIR}"/${PN}-1.5.1-python-install.patch \
80 "${FILESDIR}"/${PN}-1.6.0-swig-fix.patch \
81 "${FILESDIR}"/${PN}-1.6.1-ruby-make.patch \
82 "${FILESDIR}"/${PN}-1.6.3-libpng15.patch
83
84 [[ ${CHOST} == *-darwin* ]] \
85 && epatch "${FILESDIR}"/${PN}-1.5.0-install_name.patch \
86 || epatch "${FILESDIR}"/${PN}-1.5.0-soname.patch
87
88 has_version '>=sys-libs/zlib-1.2.5.1-r1' && \
89 sed -i -e '1i#define OF(x) x' port/cpl_minizip_ioapi.h
90 }
91
92 src_configure() {
93 local pkg_conf="${GDAL_CONFIGURE_OPTS}"
94 local use_conf=""
95
96 pkg_conf="${pkg_conf} --enable-shared=yes --with-pic \
97 --with-libgrass=no --without-libtool --with-expat=${EPREFIX}/usr"
98
99 if use hdf && use netcdf; then
100 ewarn "Netcdf and HDF4 are incompatible due to certain tools in"
101 ewarn "common; HDF5 is now the preferred choice for HDF data."
102 ewarn "Disabling hdf4 in favor of NetCDF..."
103 use_conf="--with-netcdf --with-hdf4=no"
104 elif use hdf && ! use netcdf; then
105 use_conf="--with-netcdf=no --with-hdf4"
106 else
107 use_conf="$(use_with netcdf)"
108 fi
109
110 use_conf="$(use_with jpeg) $(use_with png) $(use_with mysql) \
111 $(use_with gml xerces) $(use_with hdf5) $(use_with curl) \
112 $(use_with postgres pg) $(use_with python) $(use_with ruby) \
113 $(use_with threads) $(use_with fits cfitsio) $(use_with perl) \
114 $(use_with sqlite sqlite3 ="${EPREFIX}"/usr) $(use_with geos) \
115 $(use_with jpeg2k jasper) $(use_with odbc) $(use_enable debug)"
116
117 # It can't find this
118 if use ogdi ; then
119 use_conf="--with-ogdi=${EPREFIX}/usr ${use_conf}"
120 fi
121
122 if use mysql ; then
123 use_conf="--with-mysql=${EPREFIX}/usr/bin/mysql_config ${use_conf}"
124 fi
125
126 if use gif ; then
127 use_conf="--with-gif=internal ${use_conf}"
128 else
129 use_conf="--with-gif=no ${use_conf}"
130 fi
131
132 if use python ; then
133 use_conf="--with-pymoddir=${EPREFIX}/$(python_get_sitedir) \
134 ${use_conf}"
135 fi
136
137 # Fix doc path just in case
138 sed \
139 -e "s:@exec_prefix@/doc:@exec_prefix@/share/doc/${PF}/html:g" \
140 -i GDALmake.opt.in || die "sed gdalmake.opt failed"
141
142 econf ${pkg_conf} ${use_conf}
143
144 # mysql-config puts this in (and boy is it a PITA to get it out)
145 sed \
146 -i -r -e '/^LDFLAGS/ s/(-(Wl|O1),|,-(Wl|O1))//g' \
147 -i -e '/^MYSQL_LIB/ s:-Wl,-O1 -rdynamic::' \
148 GDALmake.opt || die "sed LIBS failed"
149 }
150
151 src_compile() {
152 local i
153 for i in perl ruby python; do
154 if use $i; then
155 rm "${S}"/swig/$i/*_wrap.cpp
156 emake -C "${S}"/swig/$i generate || \
157 die "make generate failed for swig/$i"
158 fi
159 done
160
161 # parallel makes fail on the ogr stuff (C++, what can I say?)
162 # also failing with gcc4 in libcsf
163 emake -j1 || die "emake failed"
164
165 if use python; then
166 sed -i -e "s#library_dirs = #library_dirs = ${EPREFIX}/usr/$(get_libdir):#g" \
167 swig/python/setup.cfg || die "sed python setup.cfg failed"
168 sed -i -e "s:\$(DESTDIR)\$(prefix):\$(DESTDIR)\$(INST_PREFIX):g" \
169 swig/python/GNUmakefile || die "sed python makefile failed"
170 fi
171
172 if use 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 use doc ; then
180 make docs || die "make docs failed"
181 fi
182 }
183
184 src_install() {
185 if use 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 dodoc Doxyfile HOWTO-RELEASE NEWS
198
199 if use doc ; then
200 dohtml html/* || die "install html failed"
201 docinto ogr
202 dohtml ogr/html/* || die "install ogr html failed"
203 fi
204
205 if use python; then
206 newdoc swig/python/README.txt README-python.txt
207 dodir /usr/share/${PN}/samples
208 insinto /usr/share/${PN}/samples
209 doins swig/python/samples/*
210 fi
211
212 use perl && fixlocalpod
213 }
214
215 pkg_postinst() {
216 echo
217 elog "If you need libgrass support, then you must rebuild gdal, after"
218 elog "installing the latest Grass, and set the following option:"
219 echo
220 elog "GDAL_CONFIGURE_OPTS=--with-grass=\$GRASS_HOME emerge gdal"
221 echo
222 elog "GDAL is most useful with full graphics support enabled via various"
223 elog "USE flags: png, jpeg, gif, jpeg2k, etc. Also python, fits, ogdi,"
224 elog "geos, and support for either netcdf or HDF4 is available, as well as"
225 elog "grass, and mysql, sqlite, or postgres (grass support requires grass 6"
226 elog "and rebuilding gdal). HDF5 support is now included."
227 echo
228 elog "Note: tiff and geotiff are now hard depends, so no USE flags."
229 elog "Also, this package will check for netcdf before hdf, so if you"
230 elog "prefer hdf, please emerge hdf with USE=szip prior to emerging"
231 elog "gdal. Detailed API docs require doxygen (man pages are free)."
232 echo
233 elog "Check available image and data formats after building with"
234 elog "gdalinfo and ogrinfo (using the --formats switch)."
235 echo
236 }

  ViewVC Help
Powered by ViewVC 1.1.20