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.0.0 |
---|
8 | categories gis |
---|
9 | platforms darwin |
---|
10 | license LGPL-2.1 |
---|
11 | maintainers gmail.com:larry.velazquez |
---|
12 | description Open Source C++/Python mapping toolkit. |
---|
13 | long_description Mapnik is a Free Toolkit for developing mapping \ |
---|
14 | applications. It's 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. Mapnik2 is current \ |
---|
18 | trunk and a new era of the Mapnik codebase that \ |
---|
19 | uses boost features only available in boost \ |
---|
20 | >=1.41, icu >=4.2, and is a testbed for \ |
---|
21 | next-generation Mapnik features. |
---|
22 | homepage http://mapnik.org/ |
---|
23 | |
---|
24 | conflicts py26-mapnik |
---|
25 | |
---|
26 | master_sites http://cloud.github.com/downloads/mapnik/mapnik/ \ |
---|
27 | http://download.berlios.de/mapnik/ \ |
---|
28 | http://download2.berlios.de/mapnik/ |
---|
29 | distname mapnik-${version} |
---|
30 | checksums sha1 afa49fc80ea38c7d58c940ae5b9a549ce20f5685 \ |
---|
31 | rmd160 73cf94c7fb417567ee43bc9215db6e5b752a0528 |
---|
32 | use_bzip2 yes |
---|
33 | |
---|
34 | depends_lib-append port:boost \ |
---|
35 | port:libpng \ |
---|
36 | port:jpeg \ |
---|
37 | port:tiff \ |
---|
38 | port:icu \ |
---|
39 | port:zlib \ |
---|
40 | port:freetype \ |
---|
41 | port:proj \ |
---|
42 | port:libxml2 |
---|
43 | |
---|
44 | set python_suffixes {25 26 27} |
---|
45 | set python_ports {} |
---|
46 | foreach s ${python_suffixes} { |
---|
47 | lappend python_ports python${s} |
---|
48 | } |
---|
49 | foreach s ${python_suffixes} { |
---|
50 | set p python${s} |
---|
51 | set v [string index ${s} 0].[string index ${s} 1] |
---|
52 | set i [lsearch -exact ${python_ports} ${p}] |
---|
53 | set c [lreplace ${python_ports} ${i} ${i}] |
---|
54 | eval [subst { |
---|
55 | variant ${p} conflicts ${c} description {Build Python bindings} { |
---|
56 | depends_lib-append port:${p} |
---|
57 | configure.args-delete BINDINGS=none |
---|
58 | configure.args-append BINDINGS=python |
---|
59 | configure.args-append PYTHON=${prefix}/bin/python${v} |
---|
60 | } |
---|
61 | }] |
---|
62 | } |
---|
63 | |
---|
64 | proc python_branch {} { |
---|
65 | global python_suffixes |
---|
66 | foreach s ${python_suffixes} { |
---|
67 | if {[variant_isset python${s}]} { return ${s} } |
---|
68 | } |
---|
69 | error "Python support not enabled." |
---|
70 | } |
---|
71 | |
---|
72 | variant cairo description {Enable Cairo support for PDF, PostScript, and SVG} { |
---|
73 | configure.args-delete CAIRO=False |
---|
74 | configure.args-append CAIRO=True |
---|
75 | depends_build-append port:pkgconfig |
---|
76 | depends_lib-append path:lib/pkgconfig/cairomm-1.0.pc:cairomm |
---|
77 | if {![catch {set s [python_branch]}]} { |
---|
78 | set pf Python.framework/Versions/[string index ${s} 0].[string index ${s} 1] |
---|
79 | depends_lib-append port:py[expr {${s} == 24 ? {} : ${s}}]-cairo |
---|
80 | configure.args-append PKG_CONFIG_PATH=${frameworks_dir}/${pf}/lib/pkgconfig |
---|
81 | } |
---|
82 | } |
---|
83 | |
---|
84 | set input_plugins {shape raster} |
---|
85 | |
---|
86 | variant geos description {Build GEOS plugin} { |
---|
87 | depends_lib-append port:geos |
---|
88 | lappend input_plugins geos |
---|
89 | } |
---|
90 | |
---|
91 | variant gdal description {Build GDAL/OGR plugin} { |
---|
92 | depends_lib-append port:gdal |
---|
93 | lappend input_plugins gdal ogr |
---|
94 | } |
---|
95 | |
---|
96 | variant osm description {Build OpenStreetMap plugin} { |
---|
97 | depends_lib-append port:curl |
---|
98 | lappend input_plugins osm |
---|
99 | } |
---|
100 | |
---|
101 | variant postgis description {Build PostGIS plugin} { |
---|
102 | depends_lib-append port:postgis |
---|
103 | lappend input_plugins postgis |
---|
104 | } |
---|
105 | |
---|
106 | variant sqlite description {Build SQLite plugin} { |
---|
107 | depends_lib-append port:sqlite3 |
---|
108 | lappend input_plugins sqlite |
---|
109 | } |
---|
110 | |
---|
111 | default_variants +python27 |
---|
112 | universal_variant no |
---|
113 | |
---|
114 | configure.python /usr/bin/python |
---|
115 | build.cmd ${configure.python} scons/scons.py |
---|
116 | build.pre_args |
---|
117 | use_parallel_build yes |
---|
118 | |
---|
119 | configure.cmd ${build.cmd} |
---|
120 | configure.pre_args configure --help |
---|
121 | configure.args CXX=${configure.cxx} \ |
---|
122 | CC=${configure.cc} \ |
---|
123 | PREFIX=${prefix} \ |
---|
124 | DESTDIR=${destroot} \ |
---|
125 | CAIRO=False \ |
---|
126 | FRAMEWORK_PYTHON=False \ |
---|
127 | BINDINGS=none \ |
---|
128 | JOBS=${build.jobs} |
---|
129 | foreach lib {BOOST ICU PNG JPEG TIFF PROJ CAIRO SQLITE} { |
---|
130 | configure.args-append ${lib}_INCLUDES=${prefix}/include |
---|
131 | configure.args-append ${lib}_LIBS=${prefix}/lib |
---|
132 | } |
---|
133 | |
---|
134 | destroot.destdir |
---|
135 | |
---|
136 | pre-configure { |
---|
137 | # Hack to check for correct boost variant |
---|
138 | if {![catch {set pys [python_branch]}]} { |
---|
139 | set boost_py ${prefix}/lib/libboost_python-mt.dylib |
---|
140 | if {![file exists ${boost_py}]} { |
---|
141 | ui_error " |
---|
142 | **** |
---|
143 | **** Your current boost does not have Python support. Please reinstall |
---|
144 | **** boost before trying ${name} +python${pys} again: |
---|
145 | **** |
---|
146 | **** sudo port install boost +python${pys} |
---|
147 | **** |
---|
148 | " |
---|
149 | return -code error "Boost.Python missing" |
---|
150 | } |
---|
151 | regexp {Python\.framework/Versions/([[:digit:]]\.[[:digit:]])} \ |
---|
152 | [exec /usr/bin/otool -L ${boost_py}] foo bpv |
---|
153 | if {[set bps [string replace ${bpv} 1 1]] != ${pys}} { |
---|
154 | if {${bps} ni ${python_suffixes}} { |
---|
155 | ui_error " |
---|
156 | **** |
---|
157 | **** Your current boost is incompatible with ${name} +python${pys}. |
---|
158 | **** Please install the boost variant that matches ${name}: |
---|
159 | **** |
---|
160 | **** sudo port install boost +python${pys} |
---|
161 | **** |
---|
162 | " |
---|
163 | return -code error "Incompatible Boost.Python" |
---|
164 | } |
---|
165 | ui_error " |
---|
166 | **** |
---|
167 | **** ${name} +python${pys} is incompatible with your current boost. |
---|
168 | **** Please install the ${name} variant that matches boost +python${bps}: |
---|
169 | **** |
---|
170 | **** sudo port install ${name} +python${bps} |
---|
171 | **** |
---|
172 | **** or install the boost variant that matches ${name} +python${pys}: |
---|
173 | **** |
---|
174 | **** sudo port install boost +python${pys} |
---|
175 | **** |
---|
176 | " |
---|
177 | return -code error "Incompatible Boost.Python" |
---|
178 | } |
---|
179 | } |
---|
180 | |
---|
181 | # Must be evaluated after the variants |
---|
182 | configure.args-append INPUT_PLUGINS=[join ${input_plugins} ","] |
---|
183 | if {[variant_isset postgis]} { |
---|
184 | regexp {postgresql[[:digit:]]+} [glob ${prefix}/lib/postgresql*/postgis*.so] pg |
---|
185 | configure.args-append PG_CONFIG=${prefix}/lib/${pg}/bin/pg_config |
---|
186 | if {[variant_isset sqlite]} { |
---|
187 | configure.args-append PGSQL2SQLITE=True |
---|
188 | } |
---|
189 | } |
---|
190 | } |
---|
191 | |
---|
192 | post-destroot { |
---|
193 | set docdir ${destroot}${prefix}/share/doc/${name} |
---|
194 | xinstall -d -m 755 ${docdir}/ogcserver |
---|
195 | xinstall -m 644 ${worksrcpath}/docs/ogcserver/readme.txt ${docdir}/ogcserver |
---|
196 | xinstall -m 644 -W ${worksrcpath} AUTHORS CHANGELOG COPYING README ${docdir} |
---|
197 | xinstall -d -m 755 ${destroot}${prefix}/share/examples/${name} |
---|
198 | copy ${worksrcpath}/demo ${destroot}${prefix}/share/examples/${name} |
---|
199 | } |
---|