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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu May 24 19:11:33 2012 UTC (8 years, 1 month ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Apply patch when building with ruby enabled. Fixes bug#402443. Patch by Dennis Schridde. Remove older stuff.

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

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

  ViewVC Help
Powered by ViewVC 1.1.20