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 | PortGroup cmake 1.0 |
---|
6 | PortGroup qt4 1.0 |
---|
7 | |
---|
8 | name qgis |
---|
9 | version 1.7.0 |
---|
10 | revision 0 |
---|
11 | categories gis |
---|
12 | maintainers vince |
---|
13 | description QGIS is a user-friendly GIS based on Qt 4 |
---|
14 | long_description QGIS is a GIS. It can visualize, inject data into \ |
---|
15 | PostGres/PostGIS, or serve as a Qt front-end to Grass. \ |
---|
16 | Extended with Python plugins, it can become a quite \ |
---|
17 | powerful GIS on its own. |
---|
18 | |
---|
19 | platforms darwin |
---|
20 | license GPL |
---|
21 | |
---|
22 | use_parallel_build no |
---|
23 | homepage http://www.qgis.org/ |
---|
24 | |
---|
25 | distname ${name}-${version} |
---|
26 | master_sites http://qgis.org/downloads/ |
---|
27 | use_bzip2 yes |
---|
28 | |
---|
29 | checksums md5 d8506990f52563d39c7b916f500f282f \ |
---|
30 | sha1 e60f40e72c92f187d3725e6b93c13691d63a7fa7 \ |
---|
31 | rmd160 49303eab754f1e7febce388e657253563f65abed |
---|
32 | |
---|
33 | worksrcdir ${name}-${version} |
---|
34 | |
---|
35 | patchfiles patch-spatialite_c.diff \ |
---|
36 | patch-findspatialite.diff \ |
---|
37 | patch-findsqlite.diff \ |
---|
38 | patch-conversions_sip.diff \ |
---|
39 | patch-findgeos.diff \ |
---|
40 | patch-findgdal.diff |
---|
41 | |
---|
42 | depends_lib-append port:libiconv \ |
---|
43 | port:expat \ |
---|
44 | port:openssl \ |
---|
45 | port:proj \ |
---|
46 | port:geos \ |
---|
47 | port:gdal \ |
---|
48 | port:sqlite3 \ |
---|
49 | port:gsl \ |
---|
50 | port:qwt52 \ |
---|
51 | port:fcgi |
---|
52 | |
---|
53 | pre-extract { |
---|
54 | # At least one python package must be specified |
---|
55 | if {[lsearch [split ${portvariants} "+"] "python*"] == -1} { |
---|
56 | ui_error "Qgis requires python." |
---|
57 | return -code error " Please select a python variant." |
---|
58 | } |
---|
59 | } |
---|
60 | |
---|
61 | post-extract { |
---|
62 | system "cd ${worksrcpath} && mkdir build && mkdir Python.framework" |
---|
63 | } |
---|
64 | |
---|
65 | set Py_own_FRM ${worksrcpath}/Python.framework |
---|
66 | |
---|
67 | # Python related stuff |
---|
68 | |
---|
69 | variant python25 conflicts universal description use Python 2.5 { |
---|
70 | depends_lib-append port:py25-pyqt4 |
---|
71 | |
---|
72 | configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python2.5" |
---|
73 | configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-2.5" |
---|
74 | configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-2.5" |
---|
75 | configure.args-append \ |
---|
76 | "-DSIP_BINARY_PATH=${Py_own_FRM}/Versions/2.5/bin/sip" |
---|
77 | } |
---|
78 | |
---|
79 | variant python26 description use Python 2.6 { |
---|
80 | depends_lib-append port:py26-pyqt4 |
---|
81 | |
---|
82 | configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python2.6" |
---|
83 | configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-2.6" |
---|
84 | configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-2.6" |
---|
85 | configure.args-append \ |
---|
86 | "-DSIP_BINARY_PATH=${Py_own_FRM}/Versions/2.6/bin/sip" |
---|
87 | |
---|
88 | } |
---|
89 | |
---|
90 | variant python27 description use Python 2.7 { |
---|
91 | depends_lib-append port:py27-pyqt4 |
---|
92 | |
---|
93 | configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python2.7" |
---|
94 | configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-2.7" |
---|
95 | configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-2.7" |
---|
96 | configure.args-append \ |
---|
97 | "-DSIP_BINARY_PATH=${Py_own_FRM}/Versions/2.7/bin/sip" |
---|
98 | |
---|
99 | } |
---|
100 | |
---|
101 | variant python30 description use Python 3.0 { |
---|
102 | depends_lib-append port:py30-pyqt4 |
---|
103 | |
---|
104 | configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python3.0" |
---|
105 | configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-3.0" |
---|
106 | configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-3.0" |
---|
107 | configure.args-append \ |
---|
108 | "-DSIP_BINARY_PATH=${Py_own_FRM}/Versions/3.0/bin/sip" |
---|
109 | |
---|
110 | } |
---|
111 | |
---|
112 | variant python31 description use Python 3.1 { |
---|
113 | depends_lib-append port:py31-pyqt4 |
---|
114 | |
---|
115 | configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python3.1" |
---|
116 | configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-3.1" |
---|
117 | configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-3.1" |
---|
118 | configure.args-append \ |
---|
119 | "-DSIP_BINARY_PATH=${Py_own_FRM}/Versions/3.1/bin/sip" |
---|
120 | |
---|
121 | } |
---|
122 | |
---|
123 | # Overrides default |
---|
124 | configure.dir ${worksrcpath}/build |
---|
125 | configure.cmd cmake .. |
---|
126 | |
---|
127 | variant postgis description "Build postgis support" { |
---|
128 | |
---|
129 | depends_lib-append port:postgis |
---|
130 | |
---|
131 | # Always choose latest installed postgresql version |
---|
132 | |
---|
133 | set PGSQL_DIR \ |
---|
134 | [lindex [lsort -dec [glob -d ${prefix}/lib postgresql*]] 0] |
---|
135 | configure.args-append "-DPOSTGRES_CONFIG=${PGSQL_DIR}/bin/pg_config" |
---|
136 | } |
---|
137 | |
---|
138 | variant grass description "Build the grass (6.4) plugin" { |
---|
139 | |
---|
140 | depends_lib-append port:grass |
---|
141 | configure.args-append "-DGRASS_PREFIX=${prefix}/share/grass-6.4.0" |
---|
142 | } |
---|
143 | |
---|
144 | # LLVM cannot be used (Seg. faults in spatialite.c) |
---|
145 | |
---|
146 | #if {[string first llvm ${configure.cc}] != -1 || \ |
---|
147 | # [string first llvm ${configure.cxx}] != -1} { |
---|
148 | |
---|
149 | # ui_msg "Warning: Qgis cannot be compiled with LLVM, switching to GCC\n" |
---|
150 | # set configure.cc gcc |
---|
151 | # set configure.cxx g++ |
---|
152 | #} |
---|
153 | |
---|
154 | configure.args-append "-DCMAKE_CXX_COMPILER=${configure.cxx}" |
---|
155 | configure.args-append "-DCMAKE_C_COMPILER=${configure.cc}" |
---|
156 | configure.args-append "-DEXPAT_INCLUDE_DIR=${prefix}/include" |
---|
157 | configure.args-append "-DEXPAT_LIBRARY=${prefix}/lib/libexpat.dylib" |
---|
158 | configure.args-append "-DCMAKE_INSTALL_PREFIX=${applications_dir}" |
---|
159 | configure.args-append "-DGDAL_CONFIG=${prefix}/bin/gdal-config" |
---|
160 | configure.args-append "-DGDAL_INCLUDE_DIR=${prefix}/include" |
---|
161 | configure.args-append "-DGDAL_LIBRARY=${prefix}/lib/libgdal.dylib" |
---|
162 | configure.args-append "-DGEOS_CONFIG=${prefix}/bin/geos-config" |
---|
163 | configure.args-append "-DGEOS_INCLUDE_DIR=${prefix}/include" |
---|
164 | configure.args-append "-DGEOS_LIBRARY=${prefix}/lib/libgeos_c.dylib" |
---|
165 | configure.args-append "-DGSL_CONFIG=${prefix}/bin/gsl-config" |
---|
166 | configure.args-append "-DICONV_INCLUDE_DIR=${prefix}/include" |
---|
167 | configure.args-append "-DICONV_LIBRARY=${prefix}/lib/libiconv.dylib" |
---|
168 | configure.args-append "-DPROJ_INCLUDE_DIR=${prefix}/include" |
---|
169 | configure.args-append "-DPROJ_LIBRARY=${prefix}/lib/libproj.dylib" |
---|
170 | configure.args-append "-DPYTHON_INCLUDE_PATH=${Py_own_FRM}/Headers" |
---|
171 | configure.args-append "-DSIP_INCLUDE_DIR=${Py_own_FRM}/Headers" |
---|
172 | configure.args-append "-DWITH_INTERNAL_SPATIALITE=FALSE" |
---|
173 | configure.args-append "-DWITH_SPATIALITE=FALSE" |
---|
174 | configure.args-append "-DCMAKE_BUILD_TYPE=Release" |
---|
175 | |
---|
176 | # This is a fake but don't ask me why it is needed |
---|
177 | configure.args-append "-DSVN_MARKER=/usr/bin/svnversion" |
---|
178 | |
---|
179 | |
---|
180 | # Patch for proper linking of our own Python framework |
---|
181 | post-configure { |
---|
182 | reinplace -E "s|(^\[^ \]*)|\\1 -F${worksrcpath}|" \ |
---|
183 | ${worksrcpath}/build/src/python/CMakeFiles/qgispython.dir/link.txt |
---|
184 | } |
---|
185 | |
---|
186 | # Setup Python stuff in order to gracefully link |
---|
187 | # against -framework Python |
---|
188 | |
---|
189 | pre-build { |
---|
190 | set variantlist [split ${portvariants} "+"] |
---|
191 | set Pyversion [string replace [lindex ${variantlist} \ |
---|
192 | [lsearch $variantlist "python*"]] 0 5] |
---|
193 | set Pyverpath [join [split ${Pyversion} ""] .] |
---|
194 | |
---|
195 | # Set up a fake framework in ${worksrcpath}/Python.framework |
---|
196 | set Py_sys_FRM "${frameworks_dir}/Python.framework/Versions/${Pyverpath}" |
---|
197 | |
---|
198 | system "cd ${Py_own_FRM} ; \ |
---|
199 | rm -f Headers Python Resources ; \ |
---|
200 | ln -s ${Py_sys_FRM}/include/python${Pyverpath} Headers ; \ |
---|
201 | ln -s ${Py_sys_FRM}/Python . ; \ |
---|
202 | ln -s ${Py_sys_FRM}/Resources . ;" |
---|
203 | } |
---|
204 | |
---|
205 | use_parallel_build yes |
---|
206 | build.dir ${worksrcpath}/build |
---|
207 | destroot.target install |
---|