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$ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | |
---|
6 | name mapnik2 |
---|
7 | version 2.1.0 |
---|
8 | categories gis |
---|
9 | platforms darwin |
---|
10 | license LGPL-2.1 |
---|
11 | maintainers panulla.com:macports |
---|
12 | description Open Source C++/Python mapping toolkit. |
---|
13 | long_description Mapnik is a Open Source tookit for developing mapping \ |
---|
14 | applications. It is written in C++ and there are \ |
---|
15 | Python bindings to facilitate fast-paced agile \ |
---|
16 | development. It can comfortably be used for both \ |
---|
17 | desktop and web development. \ |
---|
18 | \ |
---|
19 | Mapnik is about making beautiful maps. It uses the \ |
---|
20 | AGG library and offers world class anti-aliasing \ |
---|
21 | rendering with subpixel accuracy for geographic \ |
---|
22 | data. It is written from scratch in modern C++ and \ |
---|
23 | does not suffer from design decisions made a decade \ |
---|
24 | ago. When it comes to handling common software tasks \ |
---|
25 | such as memory management, filesystem access, \ |
---|
26 | regular expressions, parsing and so on, Mapnik \ |
---|
27 | does not re-invent the wheel, but utilises best of \ |
---|
28 | breed industry standard libraries from boost.org. |
---|
29 | homepage http://mapnik.org/ |
---|
30 | |
---|
31 | conflicts py26-mapnik |
---|
32 | |
---|
33 | master_sites http://cloud.github.com/downloads/mapnik/mapnik/ \ |
---|
34 | http://download.berlios.de/mapnik/ \ |
---|
35 | http://download2.berlios.de/mapnik/ |
---|
36 | distname mapnik-v${version} |
---|
37 | worksrcdir mapnik-v${version} |
---|
38 | checksums rmd160 6188b68c6c89272c153cbb36bf34981ffd8545d9 \ |
---|
39 | sha256 d5fcbaaea00359613b707eacaaa2109a0b5696e2baa35c02e4436e8a823b7160 |
---|
40 | |
---|
41 | use_bzip2 yes |
---|
42 | |
---|
43 | depends_lib-append port:boost \ |
---|
44 | port:libpng \ |
---|
45 | port:jpeg \ |
---|
46 | port:tiff \ |
---|
47 | port:icu \ |
---|
48 | port:zlib \ |
---|
49 | port:freetype \ |
---|
50 | port:proj \ |
---|
51 | port:libxml2 |
---|
52 | |
---|
53 | set python_suffixes {25 26 27} |
---|
54 | set python_ports {} |
---|
55 | foreach s ${python_suffixes} { |
---|
56 | lappend python_ports python${s} |
---|
57 | } |
---|
58 | foreach s ${python_suffixes} { |
---|
59 | set p python${s} |
---|
60 | set v [string index ${s} 0].[string index ${s} 1] |
---|
61 | set i [lsearch -exact ${python_ports} ${p}] |
---|
62 | set c [lreplace ${python_ports} ${i} ${i}] |
---|
63 | eval [subst { |
---|
64 | variant ${p} conflicts ${c} description {Build Python bindings} { |
---|
65 | depends_lib-append port:${p} |
---|
66 | configure.args-delete BINDINGS=none |
---|
67 | configure.args-append BINDINGS=python |
---|
68 | configure.args-append PYTHON=${prefix}/bin/python${v} |
---|
69 | } |
---|
70 | }] |
---|
71 | } |
---|
72 | |
---|
73 | proc python_branch {} { |
---|
74 | global python_suffixes |
---|
75 | foreach s ${python_suffixes} { |
---|
76 | if {[variant_isset python${s}]} { return ${s} } |
---|
77 | } |
---|
78 | error "Python support not enabled." |
---|
79 | } |
---|
80 | |
---|
81 | variant cairo description {Enable Cairo support for PDF, PostScript, and SVG} { |
---|
82 | configure.args-delete CAIRO=False |
---|
83 | configure.args-append CAIRO=True |
---|
84 | depends_build-append port:pkgconfig |
---|
85 | depends_lib-append path:lib/pkgconfig/cairomm-1.0.pc:cairomm |
---|
86 | if {![catch {set s [python_branch]}]} { |
---|
87 | set pf Python.framework/Versions/[string index ${s} 0].[string index ${s} 1] |
---|
88 | depends_lib-append port:py[expr {${s} == 24 ? {} : ${s}}]-cairo |
---|
89 | configure.args-append PKG_CONFIG_PATH=${frameworks_dir}/${pf}/lib/pkgconfig |
---|
90 | } |
---|
91 | } |
---|
92 | |
---|
93 | set input_plugins {shape raster} |
---|
94 | |
---|
95 | variant geos description {Build GEOS plugin} { |
---|
96 | depends_lib-append port:geos |
---|
97 | lappend input_plugins geos |
---|
98 | } |
---|
99 | |
---|
100 | variant gdal description {Build GDAL/OGR plugin} { |
---|
101 | depends_lib-append port:gdal |
---|
102 | lappend input_plugins gdal ogr |
---|
103 | } |
---|
104 | |
---|
105 | variant osm description {Build OpenStreetMap plugin} { |
---|
106 | depends_lib-append port:curl |
---|
107 | lappend input_plugins osm |
---|
108 | } |
---|
109 | |
---|
110 | variant postgis description {Build PostGIS plugin} { |
---|
111 | depends_lib-append path:lib/libpq.dylib:postgresql91 |
---|
112 | lappend input_plugins postgis |
---|
113 | } |
---|
114 | |
---|
115 | variant sqlite description {Build SQLite plugin} { |
---|
116 | depends_lib-append port:sqlite3 |
---|
117 | lappend input_plugins sqlite |
---|
118 | } |
---|
119 | |
---|
120 | default_variants +python27 |
---|
121 | universal_variant no |
---|
122 | |
---|
123 | configure.python /usr/bin/python |
---|
124 | build.cmd ${configure.python} scons/scons.py |
---|
125 | build.pre_args |
---|
126 | use_parallel_build yes |
---|
127 | |
---|
128 | configure.cmd ${build.cmd} |
---|
129 | configure.pre_args configure --help |
---|
130 | configure.args CXX=${configure.cxx} \ |
---|
131 | CC=${configure.cc} \ |
---|
132 | PREFIX=${prefix} \ |
---|
133 | DESTDIR=${destroot} \ |
---|
134 | CAIRO=False \ |
---|
135 | FRAMEWORK_PYTHON=False \ |
---|
136 | BINDINGS=none \ |
---|
137 | JOBS=${build.jobs} |
---|
138 | foreach lib {BOOST ICU PNG JPEG TIFF PROJ CAIRO SQLITE} { |
---|
139 | configure.args-append ${lib}_INCLUDES=${prefix}/include |
---|
140 | configure.args-append ${lib}_LIBS=${prefix}/lib |
---|
141 | } |
---|
142 | |
---|
143 | destroot.destdir |
---|
144 | |
---|
145 | pre-configure { |
---|
146 | # Hack to check for correct boost variant |
---|
147 | if {![catch {set pys [python_branch]}]} { |
---|
148 | set boost_py ${prefix}/lib/libboost_python-mt.dylib |
---|
149 | if {![file exists ${boost_py}]} { |
---|
150 | ui_error " |
---|
151 | **** |
---|
152 | **** Your current boost does not have Python support. Please reinstall |
---|
153 | **** boost before trying ${name} +python${pys} again: |
---|
154 | **** |
---|
155 | **** sudo port install boost +python${pys} |
---|
156 | **** |
---|
157 | " |
---|
158 | return -code error "Boost.Python missing" |
---|
159 | } |
---|
160 | regexp {Python\.framework/Versions/([[:digit:]]\.[[:digit:]])} \ |
---|
161 | [exec /usr/bin/otool -L ${boost_py}] foo bpv |
---|
162 | if {[set bps [string replace ${bpv} 1 1]] != ${pys}} { |
---|
163 | if {${bps} ni ${python_suffixes}} { |
---|
164 | ui_error " |
---|
165 | **** |
---|
166 | **** Your current boost is incompatible with ${name} +python${pys}. |
---|
167 | **** Please install the boost variant that matches ${name}: |
---|
168 | **** |
---|
169 | **** sudo port install boost +python${pys} |
---|
170 | **** |
---|
171 | " |
---|
172 | return -code error "Incompatible Boost.Python" |
---|
173 | } |
---|
174 | ui_error " |
---|
175 | **** |
---|
176 | **** ${name} +python${pys} is incompatible with your current boost. |
---|
177 | **** Please install the ${name} variant that matches boost +python${bps}: |
---|
178 | **** |
---|
179 | **** sudo port install ${name} +python${bps} |
---|
180 | **** |
---|
181 | **** or install the boost variant that matches ${name} +python${pys}: |
---|
182 | **** |
---|
183 | **** sudo port install boost +python${pys} |
---|
184 | **** |
---|
185 | " |
---|
186 | return -code error "Incompatible Boost.Python" |
---|
187 | } |
---|
188 | } |
---|
189 | |
---|
190 | # Must be evaluated after the variants |
---|
191 | configure.args-append INPUT_PLUGINS=[join ${input_plugins} ","] |
---|
192 | if {[variant_isset postgis]} { |
---|
193 | regexp {postgresql[[:digit:]]+} [glob ${prefix}/lib/postgresql*/libpq.*] pg |
---|
194 | configure.args-append PG_CONFIG=${prefix}/lib/${pg}/bin/pg_config |
---|
195 | if {[variant_isset sqlite]} { |
---|
196 | configure.args-append PGSQL2SQLITE=True |
---|
197 | } |
---|
198 | } |
---|
199 | } |
---|
200 | |
---|
201 | post-destroot { |
---|
202 | xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name} |
---|
203 | eval xinstall -m 640 [glob ${worksrcpath}/docs/*] \ |
---|
204 | ${destroot}${prefix}/share/doc/${name} |
---|
205 | xinstall -m 644 -W ${worksrcpath} AUTHORS.md CHANGELOG.md COPYING README.md \ |
---|
206 | ${destroot}${prefix}/share/doc/${name} |
---|
207 | xinstall -d -m 755 ${destroot}${prefix}/share/${name} |
---|
208 | copy ${worksrcpath}/demo ${destroot}${prefix}/share/${name} |
---|
209 | } |
---|