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 | |
---|
3 | PortSystem 1.0 |
---|
4 | PortGroup cmake 1.0 |
---|
5 | PortGroup github 1.0 |
---|
6 | |
---|
7 | version 2.18.5 |
---|
8 | set version_u [string map {. _} ${version}] |
---|
9 | github.setup qgis QGIS ${version_u} final- |
---|
10 | categories gis |
---|
11 | maintainers vince |
---|
12 | description QGIS is a user-friendly GIS based on Qt 4 |
---|
13 | long_description QGIS is a GIS. It can visualize, inject data into\ |
---|
14 | PostGres/PostGIS, or serve as a Qt front-end to\ |
---|
15 | Grass. Extended with Python plugins, it can become\ |
---|
16 | a quite powerful GIS on its own. |
---|
17 | |
---|
18 | platforms darwin |
---|
19 | license GPL |
---|
20 | |
---|
21 | use_parallel_build no |
---|
22 | homepage http://www.qgis.org/ |
---|
23 | |
---|
24 | checksums rmd160 50e9d6b126192eabbacc208cba29569de1ec5534 \ |
---|
25 | sha256 d76416adbe698907b2a5af703ec8d686dbaacc252a7497b1958d3327ec5fc187 |
---|
26 | |
---|
27 | patchfiles patch-app_info_plist_in.diff \ |
---|
28 | patch-PyQtMacros.diff |
---|
29 | |
---|
30 | worksrcdir ${name}-${github.version} |
---|
31 | |
---|
32 | depends_lib-append port:libiconv \ |
---|
33 | port:expat \ |
---|
34 | path:lib/libssl.dylib:openssl \ |
---|
35 | port:proj \ |
---|
36 | port:geos \ |
---|
37 | port:gdal \ |
---|
38 | port:sqlite3 \ |
---|
39 | port:gsl \ |
---|
40 | port:fcgi \ |
---|
41 | port:spatialindex \ |
---|
42 | port:postgis2 \ |
---|
43 | port:qjson |
---|
44 | |
---|
45 | depends_build-append \ |
---|
46 | port:bison \ |
---|
47 | port:ld64 |
---|
48 | |
---|
49 | post-extract { |
---|
50 | system -W ${worksrcpath} "mkdir build" |
---|
51 | } |
---|
52 | |
---|
53 | |
---|
54 | post-patch { |
---|
55 | reinplace -E "s|@@@|${prefix}|g" \ |
---|
56 | ${worksrcpath}/mac/app.info.plist.in |
---|
57 | # reinplace -E "s|Clang|AppleClang|" ${worksrcpath}/CMakeLists.txt |
---|
58 | # Handle legacy OS/XCode |
---|
59 | if {[vercmp $xcodeversion 4.6.3] <= 0} { |
---|
60 | configure.compiler llvm-gcc-4.2 |
---|
61 | } |
---|
62 | |
---|
63 | if {[variant_isset grass]} { |
---|
64 | # grass70 -> grass72 in hardcoded files |
---|
65 | set files_to_patch [list \ |
---|
66 | ${worksrcpath}/python/plugins/processing/algs/grass7/Grass7Algorithm.py \ |
---|
67 | ${worksrcpath}/python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py \ |
---|
68 | ${worksrcpath}/python/plugins/processing/algs/grass7/Grass7Utils.py] |
---|
69 | |
---|
70 | foreach filename ${files_to_patch} { |
---|
71 | reinplace "s#grass70#grass72#" ${filename} |
---|
72 | } |
---|
73 | } |
---|
74 | |
---|
75 | } |
---|
76 | |
---|
77 | # Overrides default |
---|
78 | |
---|
79 | |
---|
80 | if {![variant_isset qt4] && ![variant_isset qt5]} { |
---|
81 | |
---|
82 | default_variants +qt5 |
---|
83 | } |
---|
84 | |
---|
85 | # Python related stuff |
---|
86 | |
---|
87 | |
---|
88 | configure.args-append "-DWITH_GRASS=OFF" |
---|
89 | configure.args-append "-DWITH_GRASS7=OFF" |
---|
90 | configure.args-append "-DWITH_QWTPOLAR=FALSE" |
---|
91 | configure.args-append "-DGIT_MARKER=NOTFOUND" |
---|
92 | configure.args-append "-DENABLE_TEST=NO" |
---|
93 | #configure.args-append "--trace" |
---|
94 | |
---|
95 | |
---|
96 | variant qt5 conflicts qt4 description "Build with Qt5 and Python 3" { |
---|
97 | PortGroup qt5 1.0 |
---|
98 | set py_ver 3.6 |
---|
99 | set Py_FRM ${frameworks_dir}/Python.framework/Versions/${py_ver} |
---|
100 | |
---|
101 | configure.ldflags "-Wl,-rpath,${prefix}/libexec/qt5/lib" |
---|
102 | configure.args-append "-DENABLE_QT5=ON" |
---|
103 | configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python${py_ver}" |
---|
104 | configure.args-append "-DWITH_BINDINGS=FALSE" |
---|
105 | configure.args-append "-DQCA_INCLUDE_DIR=${prefix}/libexec/qt5/include/QtCrypto" |
---|
106 | configure.args-append "-DQCA_LIBRARY=${prefix}/libexec/qt5/lib/libqca-qt5.dylib" |
---|
107 | configure.args-append "-DQSCINTILLA_INCLUDE_DIR=${prefix}/libexec/qt5/include" |
---|
108 | configure.args-append "-DQSCINTILLA_LIBRARY=${prefix}/libexec/qt5/lib/libqscintilla2_qt5.dylib" |
---|
109 | configure.args-append "-DQWT_LIBRARY=${prefix}/libexec/qt5/lib/libqwt.dylib" |
---|
110 | configure.args-append "-DQWT_INCLUDE_DIR=${prefix}/libexec/qt5/lib/qwt.framework/Versions/6/Headers" |
---|
111 | configure.args-append "-DQT_LRELEASE_EXECUTABLE=${prefix}/libexec/qt5/bin/lrelease" |
---|
112 | configure.args-append "-DWITH_SERVER=TRUE" |
---|
113 | configure.args-append "-DWITH_SERVER_PLUGINS=TRUE" |
---|
114 | |
---|
115 | depends_lib-append port:python36 \ |
---|
116 | port:py36-pyqt5 \ |
---|
117 | port:py36-qscintilla2 \ |
---|
118 | port:qt5-qtscript \ |
---|
119 | port:qt5-sqlite-plugin \ |
---|
120 | port:qwt61 \ |
---|
121 | port:qca-qt5 \ |
---|
122 | port:qca-qt5-ossl \ |
---|
123 | port:py36-gdal |
---|
124 | |
---|
125 | depends_build-append port:py36-sip |
---|
126 | |
---|
127 | |
---|
128 | depends_run-append port:py36-psycopg2 \ |
---|
129 | port:py36-requests |
---|
130 | |
---|
131 | pre-configure { |
---|
132 | reinplace -E "s|Versions/Current|Versions/3.6|" \ |
---|
133 | ${worksrcpath}/cmake/FindPythonLibrary.cmake |
---|
134 | } |
---|
135 | } |
---|
136 | |
---|
137 | variant qt4 conflicts qt5 description "Build with Qt4 and Python 2.7" { |
---|
138 | PortGroup qt4 1.0 |
---|
139 | set Py_FRM ${frameworks_dir}/Python.framework/Versions/2.7 |
---|
140 | |
---|
141 | configure.args-append "-DENABLE_QT5=OFF" |
---|
142 | configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python2.7" |
---|
143 | configure.args-append "-DPYTHON_CUSTOM_FRAMEWORK=${Py_FRM}" |
---|
144 | configure.args-append "-DSIP_BINARY_PATH=${prefix}/bin/sip-2.7" |
---|
145 | configure.args-append "-DPYUIC_PROGRAM=${prefix}/bin/pyuic4-2.7" |
---|
146 | configure.args-append "-DPYRCC_PROGRAM=${prefix}/bin/pyrcc4-2.7" |
---|
147 | configure.args-append "-DWITH_SERVER=TRUE" |
---|
148 | configure.args-append "-DWITH_SERVER_PLUGINS=TRUE" |
---|
149 | configure.args-append "-DQWT_INCLUDE_DIR=${prefix}/libexec/qt4/Library/Frameworks/qwt.framework/Versions/6/Headers" |
---|
150 | configure.args-append "-DQWT_LIBRARY=${prefix}/libexec/qt4/lib/libqwt.dylib" |
---|
151 | configure.args-append "-DQCA_INCLUDE_DIR=${prefix}/libexec/qt4/include/QtCrypto" |
---|
152 | configure.args-append "-DQCA_LIBRARY=${prefix}/libexec/qt4/lib/libqca.dylib" |
---|
153 | configure.args-append "-DQT_LRELEASE_EXECUTABLE=${prefix}/libexec/qt4/bin/lrelease" |
---|
154 | configure.args-append "-DQSCINTILLA_INCLUDE_DIR=${prefix}/libexec/qt4/include" |
---|
155 | configure.args-append "-DQSCINTILLA_LIBRARY=${prefix}/libexec/qt4/lib/libqscintilla2_qt4.dylib" |
---|
156 | |
---|
157 | depends_lib-append port:python27 \ |
---|
158 | port:py27-pyqt4 \ |
---|
159 | port:py27-gdal \ |
---|
160 | port:py27-qscintilla2 \ |
---|
161 | port:qwt61 \ |
---|
162 | port:qt4-mac-sqlite3-plugin \ |
---|
163 | port:qca \ |
---|
164 | port:qca-ossl |
---|
165 | |
---|
166 | depends_build-append port:py27-sip |
---|
167 | |
---|
168 | depends_run-append port:py27-psycopg2 \ |
---|
169 | port:py27-spatialite \ |
---|
170 | port:py27-requests |
---|
171 | |
---|
172 | pre-configure { |
---|
173 | reinplace -E "s|Versions/Current|Versions/2.7|" \ |
---|
174 | ${worksrcpath}/cmake/FindPythonLibrary.cmake |
---|
175 | } |
---|
176 | } |
---|
177 | |
---|
178 | # Database variants (from the GDAL port) |
---|
179 | set postgresql_suffixes {94 95 96} |
---|
180 | |
---|
181 | set portsgresql_variants {} |
---|
182 | foreach s ${postgresql_suffixes} { |
---|
183 | lappend portsgresql_variants postgresql${s} |
---|
184 | } |
---|
185 | |
---|
186 | foreach s ${postgresql_suffixes} { |
---|
187 | set p postgresql${s} |
---|
188 | set v [string index ${s} 0].[string index ${s} 1] |
---|
189 | set i [lsearch -exact ${portsgresql_variants} ${p}] |
---|
190 | set c [lreplace ${portsgresql_variants} ${i} ${i}] |
---|
191 | eval [subst { |
---|
192 | variant ${p} description "Enable PostgreSQL ${v} support" conflicts ${c} { |
---|
193 | depends_lib-append port:${p} |
---|
194 | configure.args-append \ |
---|
195 | "-DPOSTGRES_CONFIG=${prefix}/lib/${p}/bin/pg_config" |
---|
196 | } |
---|
197 | }] |
---|
198 | } |
---|
199 | |
---|
200 | # postgresql default |
---|
201 | set pgd "if {" |
---|
202 | foreach s ${postgresql_suffixes} { |
---|
203 | set pgd "${pgd}!\[variant_isset postgresql${s}\] && " |
---|
204 | } |
---|
205 | set pgd [string range ${pgd} 0 end-4] |
---|
206 | set pgd "${pgd}} { default_variants +postgresql96 }" |
---|
207 | eval ${pgd} |
---|
208 | |
---|
209 | variant grass description "Build Grass 7 plugin" { |
---|
210 | |
---|
211 | depends_lib-append port:grass7 |
---|
212 | configure.args-delete "-DWITH_GRASS7=OFF" |
---|
213 | configure.args-append "-DWITH_GRASS7=ON" |
---|
214 | configure.args-append \ |
---|
215 | "-DGRASS_PREFIX7=${prefix}/share/grass-7.2.0" |
---|
216 | } |
---|
217 | |
---|
218 | configure.dir ${worksrcpath}/build |
---|
219 | configure.cmd cmake .. |
---|
220 | |
---|
221 | configure.args-append "-DCMAKE_CXX_COMPILER=${configure.cxx}" |
---|
222 | configure.args-append "-DCMAKE_C_COMPILER=${configure.cc}" |
---|
223 | configure.args-append "-DEXPAT_INCLUDE_DIR=${prefix}/include" |
---|
224 | configure.args-append "-DEXPAT_LIBRARY=${prefix}/lib/libexpat.dylib" |
---|
225 | configure.args-append "-DCMAKE_INSTALL_PREFIX=${applications_dir}" |
---|
226 | configure.args-append "-DQGIS_MACAPP_BUNDLE=0" |
---|
227 | configure.args-append "-DGDAL_CONFIG=${prefix}/bin/gdal-config" |
---|
228 | configure.args-append "-DGDAL_INCLUDE_DIR=${prefix}/include" |
---|
229 | configure.args-append "-DGDAL_LIBRARY=${prefix}/lib/libgdal.dylib" |
---|
230 | configure.args-append "-DGEOS_CONFIG=${prefix}/bin/geos-config" |
---|
231 | configure.args-append "-DGEOS_INCLUDE_DIR=${prefix}/include" |
---|
232 | configure.args-append "-DGEOS_LIBRARY=${prefix}/lib/libgeos_c.dylib" |
---|
233 | configure.args-append "-DGSL_CONFIG=${prefix}/bin/gsl-config" |
---|
234 | configure.args-append "-DPROJ_INCLUDE_DIR=${prefix}/include" |
---|
235 | configure.args-append "-DPROJ_LIBRARY=${prefix}/lib/libproj.dylib" |
---|
236 | configure.args-append \ |
---|
237 | "-DSPATIALINDEX_LIBRARY=${prefix}/lib/libspatialindex.dylib" |
---|
238 | #configure.args-append "-DCMAKE_BUILD_TYPE=DEBUG" |
---|
239 | configure.args-append "-DCMAKE_BUILD_TYPE=RELEASE" |
---|
240 | |
---|
241 | |
---|
242 | use_parallel_build yes |
---|
243 | build.dir ${worksrcpath}/build |
---|
244 | destroot.target install |
---|