/[gentoo-x86]/sci-geosciences/mapnik/mapnik-0.7.1-r2.ebuild
Gentoo

Contents of /sci-geosciences/mapnik/mapnik-0.7.1-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat May 26 09:42:53 2012 UTC (2 years, 6 months ago) by scarabeus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Version bump to 2.0.1. Remove older. Fixes bug#414579.

(Portage version: 2.2.0_alpha108/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-geosciences/mapnik/mapnik-0.7.1-r2.ebuild,v 1.1 2012/01/30 21:59:14 hwoarang Exp $
4
5 EAPI=3
6
7 PYTHON_DEPEND="python? 2"
8 inherit eutils flag-o-matic python toolchain-funcs versionator
9
10 DESCRIPTION="A Free Toolkit for developing mapping applications."
11 HOMEPAGE="http://www.mapnik.org/"
12 SRC_URI="mirror://berlios/${PN}/${P}.tar.bz2"
13
14 LICENSE="LGPL-2.1"
15 SLOT="0"
16 KEYWORDS="~amd64 ~ppc ~x86"
17 IUSE="-doc cairo curl debug +gdal postgres python sqlite"
18
19 RDEPEND="dev-libs/boost
20 dev-libs/icu
21 dev-libs/libxml2:2
22 media-fonts/dejavu
23 media-libs/freetype:2
24 virtual/jpeg
25 media-libs/libpng
26 media-libs/tiff
27 sci-libs/proj
28 x11-libs/agg[truetype]
29 cairo? (
30 x11-libs/cairo
31 dev-cpp/cairomm
32 python? ( dev-python/pycairo )
33 )
34 curl? ( net-misc/curl )
35 gdal? ( sci-libs/gdal )
36 postgres? (
37 >=dev-db/postgresql-base-8.3
38 )
39 python? ( >=dev-libs/boost-1.48[python] )
40 sqlite? ( dev-db/sqlite:3 )"
41
42 DEPEND="${RDEPEND}
43 doc? ( dev-python/epydoc )
44 dev-util/scons"
45
46 pkg_setup() {
47 if use python; then
48 python_set_active_version 2
49 python_pkg_setup
50 fi
51 }
52
53 src_prepare() {
54 sed -i \
55 -e "s|/usr/local|/usr|g" \
56 -e "s|Action(env\[config\]|Action('%s --help' % env\[config\]|" \
57 SConstruct || die "sed 1 failed"
58
59 sed -i \
60 -e "s:mapniklibpath + '/fonts':'/usr/share/fonts/dejavu/':g" \
61 bindings/python/SConscript || die "sed 2 failed"
62 rm -rf agg || die
63 epatch "${FILESDIR}"/${P}-libagg.patch
64
65 # update for libpng 1.5 changes (see bug #)
66 epatch "${FILESDIR}"/${P}-libpng1.5.4.patch
67 }
68
69 src_configure() {
70 EMAKEOPTS="SYSTEM_FONTS=/usr/share/fonts/dejavu"
71
72 EMAKEOPTS="${EMAKEOPTS} INPUT_PLUGINS="
73 use postgres && EMAKEOPTS="${EMAKEOPTS}postgis,"
74 use gdal && EMAKEOPTS="${EMAKEOPTS}gdal,ogr,"
75 use sqlite && EMAKEOPTS="${EMAKEOPTS}sqlite,"
76 use curl && EMAKEOPTS="${EMAKEOPTS}osm,"
77 EMAKEOPTS="${EMAKEOPTS}shape,raster"
78
79 use cairo || EMAKEOPTS="${EMAKEOPTS} CAIRO=false"
80 use python || EMAKEOPTS="${EMAKEOPTS} BINDINGS=none"
81 use python && EMAKEOPTS="${EMAKEOPTS} BOOST_PYTHON_LIB=boost_python-${PYTHON_ABI}"
82 use debug && EMAKEOPTS="${EMAKEOPTS} DEBUG=yes"
83 EMAKEOPTS="${EMAKEOPTS} DESTDIR=${D}"
84
85 use postgres && use sqlite && EMAKEOPTS="${EMAKEOPTS} PGSQL2SQLITE=yes"
86
87 BOOST_PKG="$(best_version "dev-libs/boost")"
88 BOOST_VER="$(get_version_component_range 1-2 "${BOOST_PKG/*boost-/}")"
89 export BOOST_VERSION="$(replace_all_version_separators _ "${BOOST_VER}")"
90 elog "${P} BOOST_VERSION is ${BOOST_VERSION}"
91 export BOOST_INC="/usr/include/boost-${BOOST_VERSION}"
92 elog "${P} BOOST_INC is ${BOOST_INC}"
93 BOOST_LIBDIR_SCHEMA="$(get_libdir)/boost-${BOOST_VERSION}"
94 export BOOST_LIB="/usr/${BOOST_LIBDIR_SCHEMA}"
95 elog "${P} BOOST_LIB is ${BOOST_LIB}"
96
97 # force older boost filesystem version until upstream migrates
98 if version_is_at_least "1.46" "${BOOST_VER}"; then
99 append-flags -DBOOST_FILESYSTEM_VERSION=2
100 fi
101
102 # Passing things doesn't seem to hit all the right paths; another
103 # poster-child for just a bit too much complexity for its own good.
104 # See bug #301674 for more info.
105 sed -i -e "s|searchDir, LIBDIR_SCHEMA|searchDir, \'${BOOST_LIBDIR_SCHEMA}\'|" \
106 -i -e "s|include/boost*|include/boost-${BOOST_VERSION}|" \
107 "${S}"/SConstruct || die "sed boost paths failed..."
108
109 # this seems to be the only way to force user-flags, since nothing
110 # gets through the scons configure except the nuclear sed option.
111 sed -i -e "s:\-O%s:${CXXFLAGS}:" \
112 -i -e "s:env\['OPTIMIZATION'\]\,::" \
113 SConstruct || die "sed 3 failed"
114 sed -i -e "s:LINKFLAGS=linkflags:LINKFLAGS=linkflags + \" ${LDFLAGS}\":" \
115 src/SConscript || die "sed 4 failed"
116
117 scons CC="$(tc-getCC)" CXX="$(tc-getCXX)" ${EMAKEOPTS} configure \
118 || die "scons configure failed"
119 }
120
121 src_compile() {
122 # note passing CXXFLAGS to scons does *not* work
123 scons CC="$(tc-getCC)" CXX="$(tc-getCXX)" \
124 shared=1 || die "scons make failed"
125
126 # this is known to depend on mod_python and should not have a
127 # "die" after the epydoc script (see bug #370575)
128 if use doc; then
129 export PYTHONPATH="${S}/bindings/python:$(python_get_sitedir)"
130 cd docs/epydoc_config
131 ./build_epydoc.sh
132 cd -
133 fi
134 }
135
136 src_install() {
137 scons DESTDIR="${D}" install || die "scons install failed"
138
139 if use python ; then
140 fperms 0755 "$(python_get_sitedir)"/mapnik/paths.py
141 dobin utils/stats/mapdef_stats.py
142 insinto /usr/share/doc/${PF}/examples
143 doins utils/ogcserver/*
144 fi
145
146 dodoc AUTHORS CHANGELOG README || die
147 use doc && { dohtml -r docs/api_docs/python/* || die "API doc install failed"; }
148 }
149
150 pkg_postinst() {
151 elog ""
152 elog "See the home page or wiki (http://trac.mapnik.org/) for more info"
153 elog "or the installed examples for the default mapnik ogcserver config."
154 elog ""
155 }

  ViewVC Help
Powered by ViewVC 1.1.20