diff options
author | Steve Arnold <nerdboy@gentoo.org> | 2006-07-03 23:49:22 +0000 |
---|---|---|
committer | Steve Arnold <nerdboy@gentoo.org> | 2006-07-03 23:49:22 +0000 |
commit | 1bf0879d1b55d0fccbfd1850c0dbe528c852281d (patch) | |
tree | 04e704eada4512674ffaf9dd76f05c31a56aee79 /sci-libs/geos | |
parent | Add nls useflag and related dependencies, disabled static libraries (it's a m... (diff) | |
download | gentoo-2-1bf0879d1b55d0fccbfd1850c0dbe528c852281d.tar.gz gentoo-2-1bf0879d1b55d0fccbfd1850c0dbe528c852281d.tar.bz2 gentoo-2-1bf0879d1b55d0fccbfd1850c0dbe528c852281d.zip |
patched the swig stuff so python works correctly
(Portage version: 2.1.1_pre2-r2)
Diffstat (limited to 'sci-libs/geos')
-rw-r--r-- | sci-libs/geos/ChangeLog | 7 | ||||
-rw-r--r-- | sci-libs/geos/files/geos-2.2.2-swig.patch | 56 | ||||
-rw-r--r-- | sci-libs/geos/files/python.i | 3 | ||||
-rw-r--r-- | sci-libs/geos/geos-2.2.2.ebuild | 75 |
4 files changed, 118 insertions, 23 deletions
diff --git a/sci-libs/geos/ChangeLog b/sci-libs/geos/ChangeLog index e842cf52d3c3..365684b12da0 100644 --- a/sci-libs/geos/ChangeLog +++ b/sci-libs/geos/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sci-libs/geos # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/geos/ChangeLog,v 1.13 2006/05/25 23:33:35 nerdboy Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-libs/geos/ChangeLog,v 1.14 2006/07/03 23:49:22 nerdboy Exp $ + + 03 Jul 2006; Steve Arnold <nerdboy@gentoo.org> + +files/geos-2.2.2-swig.patch, +files/python.i, geos-2.2.2.ebuild: + Patched the swig stuff so python works correctly; the 3.0 release should + fix it (and add ruby support). Note that the python wrapper implies static. 25 May 2006; Steve Arnold <nerdboy@gentoo.org> geos-2.2.1.ebuild: Should have picked this one up earlier (inadvertantly omitted ppc). diff --git a/sci-libs/geos/files/geos-2.2.2-swig.patch b/sci-libs/geos/files/geos-2.2.2-swig.patch new file mode 100644 index 000000000000..ee7121970493 --- /dev/null +++ b/sci-libs/geos/files/geos-2.2.2-swig.patch @@ -0,0 +1,56 @@ +--- swig/geos.i.orig 2006-07-03 14:06:23.000000000 -0700 ++++ swig/geos.i 2006-07-03 14:11:37.000000000 -0700 +@@ -163,7 +163,6 @@ + %newobject GeometricShapeFactory::getEnvelope; + + %newobject WKBReader::read; +-%newobject WKBReader::readHEX; + %newobject WKTReader::read; + } + +@@ -183,12 +182,6 @@ + geos::MultiPoint, geos::MultiLineString, + geos::MultiPolygon, geos::GeometryCollection); + +-%factory(geos::Geometry * geos::WKBReader::readHEX, geos::Point, +- geos::LinearRing, geos::LineString, +- geos::Polygon, +- geos::MultiPoint, geos::MultiLineString, +- geos::MultiPolygon, geos::GeometryCollection); +- + %factory(geos::Geometry * geos::Geometry::downcast, geos::Point, + geos::LinearRing, geos::LineString, + geos::Polygon, +@@ -294,32 +287,3 @@ + objects. So create a global factory.*/ + + /* Add some helper methods to geometries */ +-%extend geos::Geometry { +- static geos::GeometryFactory& factory() +- { +- static geos::GeometryFactory factory; +- return factory; +- } +- +- static geos::WKBReader& reader() +- { +- #if GEOS_VERSION_MAJOR == 2 +- static geos::WKBReader reader(geos_Geometry_factory()); +- #else +- static geos::io::WKBReader reader(geos_Geometry_factory()); +- #endif +- return reader; +- } +- +- static Geometry* fromWKT(std::string wkt) +- { +- std::stringstream in(wkt); +- return geos_Geometry_reader().read(in); +- } +- +- static Geometry* fromHEX(std::string hex) +- { +- std::stringstream in(hex); +- return geos_Geometry_reader().readHEX(in); +- } +-}; diff --git a/sci-libs/geos/files/python.i b/sci-libs/geos/files/python.i new file mode 100644 index 000000000000..8218e3ee72b0 --- /dev/null +++ b/sci-libs/geos/files/python.i @@ -0,0 +1,3 @@ +%template(vector_GeometryP) std::vector<geos::Geometry *>; +%template(vector_LineStringP) std::vector<geos::LineString *>; +%template(vector_PolygonP) std::vector<geos::Polygon *>; diff --git a/sci-libs/geos/geos-2.2.2.ebuild b/sci-libs/geos/geos-2.2.2.ebuild index 6681406d89ce..6e34c0573ce2 100644 --- a/sci-libs/geos/geos-2.2.2.ebuild +++ b/sci-libs/geos/geos-2.2.2.ebuild @@ -1,8 +1,8 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/geos/geos-2.2.2.ebuild,v 1.1 2006/05/25 19:18:46 nerdboy Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-libs/geos/geos-2.2.2.ebuild,v 1.2 2006/07/03 23:49:22 nerdboy Exp $ -inherit eutils +inherit eutils distutils autotools kde-functions DESCRIPTION="Geometry Engine - Open Source" HOMEPAGE="http://geos.refractions.net" @@ -15,55 +15,86 @@ IUSE="static doc python" RDEPEND="virtual/libc" DEPEND="${RDEPEND} - doc? ( app-doc/doxygen )\ - python? ( dev-lang/python dev-lang/swig )" + doc? ( app-doc/doxygen ) + python? ( dev-lang/python + >=dev-lang/swig-1.3.29 )" -src_compile() { +src_unpack() { + unpack ${A} cd ${S} - libtoolize --force + need-autoconf 2.5 + elibtoolize + use python && epatch ${FILESDIR}/${P}-swig.patch +} +src_compile() { + cd ${S} local myconf myconf="" - use static && myconf="$(use_enable static)" + if use static; then + myconf="$(use_enable static)" + elif use python || use ruby; then + myconf="--with-pic" + else + myconf="--with-pic --enable-static=no" + fi econf ${myconf} || die "Error: econf failed" # intermittent build failures with emake make || die "Error: make failed" + if use python; then einfo "Compilling PyGEOS" cd ${S}/swig/python + cp ${FILESDIR}/python.i ${S}/swig/python/ + rm -f geos_wrap.cxx swig -c++ -python -modern -o geos_wrap.cxx ../geos.i - python setup.py build + distutils_src_compile fi } src_test() { cd ${S} make check || die "Tring make check without success." -# I think this test must be made after the PyGEOS installation -# if use python; then -# cd ${S}/swig/python -# python tests/runtests.py -v -# fi + # I think this test must be made after the PyGEOS installation + #export PYTHONPATH=${S}/swig/python + if use python; then + cd ${S}/swig/python + python tests/runtests.py -v + fi } src_install(){ - into /usr - einstall - dodoc AUTHORS COPYING INSTALL NEWS README TODO - if use doc; then - cd ${S}/doc - make doxygen-html - dohtml -r doxygen_docs/html/* - fi + make install DESTDIR=${D} || die "make install failed" + if use python; then einfo "Intalling PyGEOS" cd ${S}/swig/python - python setup.py install --prefix="${D}/usr/" + distutils_src_install insinto /usr/share/doc/${PF}/python doins README.txt tests/*.py insinto /usr/share/doc/${PF}/python/cases doins tests/cases/* fi + dodoc AUTHORS COPYING INSTALL NEWS README TODO + if use doc; then + cd ${S}/doc + make doxygen-html + dohtml -r doxygen_docs/html/* + fi +} + +pkg_postinst() { + if use python; then + python_version + python_mod_optimize ${ROOT}usr/bin + fi +} + +pkg_postrm() { + if use python; then + python_version + python_mod_cleanup + fi } |