Ticket #32452: Portfile

File Portfile, 5.1 KB (added by shirshegsm@…, 12 years ago)
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 85597 2011-10-15 00:56:45Z dports@macports.org $
3
4PortSystem 1.0
5
6name                 py26-mapnik
7version              0.7.1
8revision             6
9categories           python gis
10
11maintainers          gmail.com:dbsgeo
12homepage             http://mapnik.org/
13platforms            darwin
14
15master_sites         http://download.berlios.de/mapnik/ \
16                     http://download2.berlios.de/mapnik/
17                     
18distname             mapnik-${version}
19worksrcdir           mapnik-${version}
20checksums            md5     8f65fda2a792518d6f6be8a85f62fc73 \
21                     sha1    a1961f6dfe5d591d5a892bef05d58e66537440c4 \
22                     rmd160  9e4180e901dfaf255091843869e9441d7a08209f
23use_bzip2            yes
24
25universal_variant       no
26                           
27description          Open Source C++/Python mapping toolkit.
28long_description \
29    Mapnik is a Open Source tookit for developing mapping \
30    applications. It is written in C++ and there are \
31    Python bindings to facilitate fast-paced agile \
32    development. It can comfortably be used for both \
33    desktop and web development. \
34    \
35    Mapnik is about making beautiful maps. It uses the \
36    AGG library and offers world class anti-aliasing \
37    rendering with subpixel accuracy for geographic \
38    data. It is written from scratch in modern C++ and \
39    does not suffer from design decisions made a decade \
40    ago. When it comes to handling common software tasks \
41    such as memory management, filesystem access, \
42    regular expressions, parsing and so on, Mapnik \
43    does not re-invent the wheel, but utilises best of \
44    breed industry standard libraries from boost.org.
45
46depends_lib         port:boost \
47                    port:libpng \
48                    port:jpeg \
49                    port:tiff \
50                    port:icu \
51                    port:zlib \
52                    port:freetype \
53                    port:proj \
54                    port:libxml2 \
55                    port:python26
56
57patchfiles          patch-boost-filesystem3.diff
58
59set python  "${prefix}/bin/python2.6"
60
61configure.pkg_config ${prefix}/bin/pkg-config
62
63variant cairo description {Builds port with Cairo Support} {
64    depends_lib-append path:lib/pkgconfig/cairomm-1.0.pc:cairomm
65    depends_lib-append port:py26-cairo
66    configure.args-delete  CAIRO=False
67    configure.args-append  CAIRO=True
68    configure.args-append  PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/pkgconfig/
69}
70
71variant postgis description {Builds port with PostGIS plugin} {
72    depends_lib-append port:postgresql91
73    depends_lib-append port:postgresql91-server
74    depends_lib-append port:postgis
75    configure.args-append  PG_CONFIG=${prefix}/lib/postgresql91/bin/pg_config
76}
77
78variant gdal description {Builds port with GDAL/OGR plugin} {
79    depends_lib-append port:gdal
80    configure.args-append  GDAL_CONFIG=${prefix}/bin/gdal-config
81}
82
83variant sqlite description {Builds port with SQLite3 plugin} {
84    depends_lib-append port:sqlite3
85    configure.args-append  SQLITE_INCLUDES=${prefix}/include \
86                       SQLITE_LIBS=${prefix}/lib
87}
88
89use_parallel_build  yes
90
91if {![file exists ${prefix}/lib/libboost_python-mt.dylib]} {
92    depends_lib-delete port:boost
93    pre-configure {
94        ui_error "
95****
96**** ${name} requires port boost installed with variant +python26.
97**** Please do the following then try installing ${name} again:
98****
99****     sudo port install boost +python26
100****
101
102"
103        return -code error "incompatible boost installation"
104    }
105}
106
107configure.args      PREFIX=${prefix} \
108                     CAIRO=False \
109                     OPTIMIZATION=3 \
110                     FRAMEWORK_PYTHON=False \
111                     INPUT_PLUGINS=shape,raster,ogr,postgis,gdal,sqlite \
112                     PYTHON=${python} \
113                     FREETYPE_CONFIG=${prefix}/bin/freetype-config \
114                     XML2_CONFIG=${prefix}/bin/xml2-config \
115                     BOOST_INCLUDES=${prefix}/include \
116                     BOOST_LIBS=${prefix}/lib \
117                     SQLITE_INCLUDES=${prefix}/include \
118                     SQLITE_LIBS=${prefix}/lib \
119                     ICU_INCLUDES=${prefix}/include \
120                     ICU_LIBS=${prefix}/lib \
121                     PNG_INCLUDES=${prefix}/include \
122                     PNG_LIBS=${prefix}/lib \
123                     JPEG_INCLUDES=${prefix}/include \
124                     JPEG_LIBS=${prefix}/lib \
125                     TIFF_INCLUDES=${prefix}/include \
126                     TIFF_LIBS=${prefix}/lib \
127                     PROJ_INCLUDES=${prefix}/include \
128                     PROJ_LIBS=${prefix}/lib \
129                     DESTDIR=${destroot}
130
131configure {
132    system "cd ${worksrcpath} && ${python} scons/scons.py ${configure.args} configure"
133}
134
135build {
136    system "cd ${worksrcpath} && ${python} scons/scons.py"
137}
138
139destroot {
140    system "cd ${worksrcpath} && ${python} scons/scons.py install"
141}