jlpoole Guru
Joined: 01 Nov 2005 Posts: 482 Location: Salem, OR
|
Posted: Sun Feb 05, 2012 2:09 am Post subject: Mapnik - 9999 installed on AMD64 |
|
|
I've been constantly plagued by not getting Mapnik to install on my AMDx64 platform. Now really wanting it for a project caused me to focus and I succeeded in getting the high watermark installed. Since this is an obscure area, I thought I'd share what I did that should help others when they run into various problems.
First of all, I modified an ebuild obtained from http://rullzer.com/overlay/sci-geosciences/mapnik/mapnik-9999.ebuild. Using the rullzer ebuild did not work since the ebuild points to a defunct Subversion repository for Mapnik. I modified the ebuild to pull the development version from GIT.
Code: |
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
#inherit eutils autotools subversion
inherit eutils autotools git-2
# start of modification
# below rem'd and added since Mapnik has changed to GIT
#ESVN_REPO_URI="svn://svn.mapnik.org/trunk"
#ESVN_PROJECT="${PN}"
EGIT_REPO_URI="https://github.com/mapnik/mapnik.git"
EGIT_PROJECT="${PN}"
# end of modification
DESCRIPTION="A Free Toolkit for developing mapping applications."
HOMEPAGE="http://www.mapnik.org/"
SRC_URI=""
LICENSE="LGPL-3"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="postgres proj debug doc gdal python bidi"
DEPEND=">=dev-util/scons-0.98.0
>=dev-libs/boost-1.33.0
>=media-libs/libpng-1.2.12
>=media-libs/jpeg-6b
>=media-libs/tiff-3.8.2
>=sys-libs/zlib-1.2.3
>=media-libs/freetype-2.1.10
>=dev-lang/python-1.5.2
dev-libs/icu
postgres? ( >=dev-db/postgis-1.1.2
>=sci-libs/geos-3.0.0 )
proj? ( >=sci-libs/proj-4.4.9 )
gdal? ( sci-libs/gdal )
python? ( >=dev-lang/python-2.4 )
bidi? ( dev-libs/fribidi )"
#
#src_unpack() {
#unpack ${A}
#cd "${S}"a
# pwd
#}
src_compile() {
MAKEOPTS="${MAKEOPTS} PREFIX=/usr"
if ! use python ; then
MAKEOPTS="${MAKEOPTS} BINDINGS=none"
fi
MAKEOPTS="${MAKEOPTS} INPUT_PLUGINS=shape,raster,postgis"
if use debug ; then
MAKEOPTS="${MAKEOPTS} DEBUG=1"
fi
if use bidi ; then
MAKEOPTS="${MAKEOPTS} BIDI=1"
fi
if use postgres ; then
MAKEOPTS="${MAKEOPTS} PGSQL_INCLUDES=/usr/include/postgresql-8.3"
MAKEOPTS="${MAKEOPTS} PGSQL_LIBS=/usr/lib/postgresql-8.3"
fi
if use proj ; then
MAKEOPTS="${MAKEOPTS} PROJ_INCLUDES=/usr/include"
MAKEOPTS="${MAKEOPTS} PROJ_LIBS=/usr/lib"
fi
MAKEOPTS="${MAKEOPTS} XMLPARSER=libxml2"
scons ${MAKEOPTS} || die
}
src_install() {
scons ${MAKEOPTS} DESTDIR="${D}" install || die "Unable to install Mapnik"
if use doc ; then
dohtml -r docs/epydocs/*
fi
}
|
Note: one issue I have not address is that the libraries for postgres are specific versions, "8.3", which may cause me problems because I'm on PostgreSQL 9+ and postgis 1.5.3-r1.
I created a directory "/usr/local/portage/sci-geosciences/mapnik" and placed the above ebuild in it and then modified as show above. Make sure your /etc/make.conf brings in your local portage tree with 'PORTDIR_OVERLAY="/usr/local/portage"'.
Then execute: Code: | ebuild /usr/local/portage/sci-geosciences/mapnik/mapnik-*.ebuild digest |
I then: Code: | nano /etc/portage/package.keywords | so that package.keywords included:
Note, I removed the specified version for sci-libs/gdal as set forth in the wiki page, https://wiki.openstreetmap.org/wiki/Deploying_your_own_Slippy_Map_Gentoo#Mapnik (which I modified today, as well), because having the specific version generated an error message about the atom being invalid.
I noticed that Mapnik v. 2.0 had been masked:
Code: | hermes mapnik # cat -n /usr/portage/profiles/package.mask | grep -A 3 -B 3 mapnik
133 =net-libs/rb_libtorrent-0.15.9-r1
134 =net-mail/libpst-0.6.54-r1
135 =sci-physics/camfr-20070717-r3
136 =sci-geosciences/mapnik-0.7.1-r2
137
138 # Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org> (22 Jan 2012)
139 # Mask compiz for last-rites unless someone steps up
--
374 net-mail/vmailmgr-tools
375
376 # Steve Arnold <nerdboy@gentoo.org> (12 Nov 2011)
377 # Masked until gpsdrive is updated to work with the newer mapnik.
378 >=sci-geosciences/mapnik-2.0.0
379
380 # Nathan Phillip Brink <binki@gentoo.org> (8 Nov 2011)
381 # Masking alpha release series.
hermes mapnik #
|
I determined gpsdrive was not something critical to me as I'm not concerned about being able to plug in a Tracking device; I simply want to programmatically create maps by script.
To overcome the mask, I added to /etc/portage/package.unmask:
Code: | #
# for private ebuild
#
=sci-geosciences/mapnik-9999
|
I modified my /etc/portage/package.use as follows:
Code: | sci-geosciences/mapnik python cairo gdal proj
|
When I tried to emerge, I got an error message about boost. I then spent an hour or more learning about what boost is and finally determined that I could use Gentoo's package of boost, but I had to specifically include python. So I executed:
Code: | USE="python" emerge dev-libs/boost |
Using python cured the Mapnik emerge complaint.
Then I did as follows:
Code: | hermes mapnik # emerge mapnik -p
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild N #] sci-geosciences/mapnik-9999 USE="debug gdal postgres proj python -bidi -doc"
hermes mapnik # emerge mapnik
...
Install file: "bindings/python/mapnik/_mapnik.so" as "/var/tmp/portage/sci-geosciences/mapnik-9999/image/usr/lib64/python2.7/site-packages/mapnik/_mapnik.so"
scons: done building targets.
>>> Completed installing mapnik-9999 into /var/tmp/portage/sci-geosciences/mapnik-9999/image/
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE "/var/log/sandbox/sandbox-15026.log"
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line
F: open_wr
S: deny
P: /etc/ld.so.cache~
A: /etc/ld.so.cache~
R: /etc/ld.so.cache~
C: ldconfig
--------------------------------------------------------------------------------
>>> Failed to emerge sci-geosciences/mapnik-9999, Log file:
>>> '/var/tmp/portage/sci-geosciences/mapnik-9999/temp/build.log'
hermes boost-build-1_47 # |
The above error message is the first of its kind that I've seen; this is price of bringing in high watermarks of a project's development tree. There is not a heck of a lot documentation about the above error message, but I did learn from another posting (forums-web2.gentoo.org/viewtopic-t-805494-start-0.html) in the Gentoo Forums that "you must disable sandbox to emerge csound, beecause "install.py" calls /sbin/ldconfig ", so I executed my emerge as follows:
Code: | hermes mapnik # FEATURES=-sandbox emerge mapnik
|
And the package successfully installed.
I am writing this post having just successfully installed; I have not tested or determined if the reference to older version of Postgres is going to cause problems. I just thought I'd document what I did to get Mapnik to install so if someone else has a mind to do so, this might save some time.
My setup:
Code: | hermes mapnik # uname -a
Linux hermes 2.6.39.2 #7 SMP Wed Aug 10 05:51:40 PDT 2011 x86_64 AMD Phenom(tm) II X4 940 Processor AuthenticAMD GNU/Linux
hermes mapnik #
|
|
|