Skip to content

Commit

Permalink
better disutils handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kiorky committed Sep 2, 2012
1 parent 82dc7b1 commit 9cd0835
Show file tree
Hide file tree
Showing 14 changed files with 24,357 additions and 73 deletions.
10 changes: 10 additions & 0 deletions .gitignore
@@ -1,4 +1,5 @@
*.pyc
mapnik.env
.minitage
test.sh

Expand All @@ -23,3 +24,12 @@ develop-eggs/*
.*\.so

*.egg-info
initdiff.diff
q
sys/

t
d
downloads
*.bak
build.log
5 changes: 5 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,5 @@
include *.txt *.rst *.cfg becomepil.patch *.sh
recursive-include src *py
recursive-include src *
global-exclude *pyc
global-exclude .*.cfg
104 changes: 62 additions & 42 deletions README.rst
Expand Up @@ -4,9 +4,27 @@ Introduction

.. contents::


Official mapnik bindings repackaged in the distutils way to facilitate deployments.

This depends of those libraries to be installed on you environment:

- mapnik2 (the c++ library)
- BOOST c++:

- boost python
- boost thread
- boost regex

Optionnal but heavily recommended python libraries

- pycairo
- PIL / Pillow

If you are a buildout user, you can look at this package
buildout which integrates pycairo & pil installation

See `github <https://github.com/mapnik/pymapnik2>`_


MAPNIK2 Notes
===============
Expand All @@ -21,10 +39,10 @@ To use with:
easy_install -U mapnik2==2.0.1.3


- :mapnik2 library - 2.0.2: == mapnik2 2.0.2.1
- :mapnik2 library - 2.1.0: == mapnik2 2.1.0
::

easy_install -U mapnik2==2.0.2.1
easy_install -U mapnik2==2.1.0


Credits
Expand Down Expand Up @@ -52,72 +70,78 @@ Installation
======================================
Prerequisites
-------------------

Don't forget that you can play with LDFLAGS/CFLAGS/LD_LIBRARY_PATH dto indicate non standart locations for the following requirements if it applies.

You will have to have the includes and libraries for

- The new mapnik-config utility to be in your $PATH
- The mapnik-config utility to be in your $PATH
- Boost_python linked to your python interpreter
If it is not installed in standart envionments, you ll have to handle the CFLAGS/LDFLAGS to find it, or use minitage ;)
- cairo / cairomm (optionnal but enabled if you compiled mapnik with cairo support)
- mapnik2
- The current python interpreter
- pycairo / PIL in the PYTHONPATH somehow

Buildout
----------
Some developers use buildout_ to ease deployments.
* Say where to find mapnik-config by settings correctly your PATH environment variable
* Add ``mapnik`` to the list of eggs to install, e.g.
::

[buildout]
parts = somepart

BOOST NOTES
--------------
[somepart]
recipe = minitage.recipe.scripts # or zc.recipe.egg ...
eggs = mapnik2

To specify which boostpython lib to link against, you can use, you can use the following::
* Re-run buildout, e.g. with::

export MAPNIK2_BOOST_PYTHON="libboost_python.so.1"
$ ./bin/buildout

Where you have on your filesystem::
You can read the buildout installation shipped with this egg for inspiration of how integrate mapnik in a buildout.
The magic is using buildout.minitagificator to feed PKG_CONFIG_PATH and PYTHONPATH with pycairo

/usr/lib/libboost_python.so.1

Running this package buildout
--------------------------------
First you need to install pycairo locally::

bin/buildout -vvvvvNc cairo.cfg

Then run buildout::

bin/buildout -vvvvvN

Easy_install with or without virtualenv
---------------------------------------------
::

virtualenv --no-site-packages test
source test/bin/activate
easy_install mapnik2

* Say where to find mapnik-config by settings correctly your PATH environment variable
* When you're reading this you have probably already run
``easy_install mapnik2``. Find out how to install setuptools
(and EasyInstall) here:
http://peak.telecommunity.com/DevCenter/EasyInstall

::

virtualenv --no-site-packages test
source test/bin/activate
easy_install mapnik2

If your boost python installation is not in a standart place, just set the [LD_LIBRARY_PATH, LDFLAGS, CFLAGS] to find it.

BOOST NOTES
--------------

Buildout
----------
Some developers use buildout_ to ease deployments.
* Say where to find mapnik-config by settings correctly your PATH environment variable
* Add ``mapnik`` to the list of eggs to install, e.g.
::

[buildout]
parts = somepart
To specify which boostpython lib to link against, you can use, you can use the following::

[somepart]
recipe = minitage.recipe.scripts
...
# (options like include dirs)
...
eggs =
...
mapnik2
export MAPNIK2_BOOST_PYTHON="libboost_python.so.1:libboost_thread.so.1"

* Re-run buildout, e.g. with::
Where you have on your filesystem::

$ ./bin/buildout
/usr/lib/libboost_python.so.1
/usr/lib/libboost_thread.so.1

You can read the buildout installation shipped with this egg for inspiration.
For ubuntu users, please refer to `this doc <https://github.com/mapnik/mapnik/wiki/UbuntuInstallation>`_ to install the prerequisites of this egg.

Minitage
--------------
Expand All @@ -130,9 +154,6 @@ As an example, to work on this egg in development mode, you can boostrap it by d
virtualenv --no-site-packages --distribute ~/minitage
mkdir ~/minitage/others




Install minitage, if you haven't yet ::

source ~/minitage/bin/activate
Expand Down Expand Up @@ -168,7 +189,6 @@ For using mapnik2 inside your minitagified application:
- Inside the eggs parts of you buildout add::

[part]
...
eggs += mapnik2

- In your minibuild, merge the mapnik2 dependencies that you can find here:
Expand Down
1 change: 1 addition & 0 deletions a.sh
@@ -0,0 +1 @@
./bin/nosetests 2>&1
36 changes: 36 additions & 0 deletions apt.sh
@@ -0,0 +1,36 @@
#!/usr/bin/env bash







V=${1:-2.1.0}
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 4F7B93595D50B6BA
sudo sed -re "s:mapnik/v[^/]*:mapnik/v$V:g" -i /etc/apt/sources.list
sudo apt-get update
sudo apt-get install --reinstall libmapnik-dev mapnik-utils mapnik-doc libmapnik \
g++ cpp \
libicu-dev \
libboost-filesystem-dev \
libboost-program-options-dev \
libboost-python-dev libboost-regex-dev \
libboost-system-dev libboost-thread-dev \
python-dev libxml2 libxml2-dev \
libfreetype6 libfreetype6-dev \
libjpeg-dev \
libltdl7 libltdl-dev \
libpng-dev \
libproj-dev \
libgeotiff-dev libtiff-dev libtiffxx0c2 \
libcairo2 libcairo2-dev python-cairo python-cairo-dev \
libcairomm-1.0-1 libcairomm-1.0-dev \
ttf-unifont ttf-dejavu ttf-dejavu-core ttf-dejavu-extra \
git build-essential python-nose clang \
libgdal1-dev python-gdal \
postgresql-9.1 postgresql-server-dev-9.1 postgresql-contrib-9.1 postgresql-9.1-postgis \
libsqlite3-dev \
-y --force-yes


0 comments on commit 9cd0835

Please sign in to comment.