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:python27 \ |
---|
44 | port:py27-gdal \ |
---|
45 | port:qca \ |
---|
46 | port:qca-ossl \ |
---|
47 | port:qjson |
---|
48 | |
---|
49 | depends_build-append \ |
---|
50 | port:bison \ |
---|
51 | port:ld64 \ |
---|
52 | port:py27-sip |
---|
53 | |
---|
54 | depends_run-append port:py27-psycopg2 \ |
---|
55 | port:py27-spatialite \ |
---|
56 | port:py27-requests |
---|
57 | |
---|
58 | post-extract { |
---|
59 | system -W ${worksrcpath} "mkdir build" |
---|
60 | } |
---|
61 | |
---|
62 | |
---|
63 | post-patch { |
---|
64 | reinplace -E "s|@@@|${prefix}|g" \ |
---|
65 | ${worksrcpath}/mac/app.info.plist.in |
---|
66 | # reinplace -E "s|Clang|AppleClang|" ${worksrcpath}/CMakeLists.txt |
---|
67 | # Handle legacy OS/XCode |
---|
68 | if {[vercmp $xcodeversion 4.6.3] <= 0} { |
---|
69 | configure.compiler llvm-gcc-4.2 |
---|
70 | } |
---|
71 | |
---|
72 | if {[variant_isset grass]} { |
---|
73 | # grass70 -> grass72 in hardcoded files |
---|
74 | set files_to_patch [list \ |
---|
75 | ${worksrcpath}/python/plugins/processing/algs/grass7/Grass7Algorithm.py \ |
---|
76 | ${worksrcpath}/python/plugins/processing/algs/grass7/Grass7AlgorithmProvider.py \ |
---|
77 | ${worksrcpath}/python/plugins/processing/algs/grass7/Grass7Utils.py] |
---|
78 | |
---|
79 | foreach filename ${files_to_patch} { |
---|
80 | reinplace "s#grass70#grass72#" ${filename} |
---|
81 | } |
---|
82 | } |
---|
83 | |
---|
84 | } |
---|
85 | |
---|
86 | # Overrides default |
---|
87 | |
---|
88 | |
---|
89 | if {![variant_isset qt4] && ![variant_isset qt5]} { |
---|
90 | |
---|
91 | default_variants +qt4 |
---|
92 | } |
---|
93 | |
---|
94 | # Python related stuff |
---|
95 | |
---|
96 | |
---|
97 | configure.args-append "-DWITH_GRASS=OFF" |
---|
98 | configure.args-append "-DWITH_GRASS7=OFF" |
---|
99 | configure.args-append "-DWITH_QWTPOLAR=FALSE" |
---|
100 | configure.args-append "-DGIT_MARKER=NOTFOUND" |
---|
101 | configure.args-append "-DENABLE_TEST=NO" |
---|
102 | #configure.args-append "--trace" |
---|
103 | #configure.args-append "-DPYUIC_PROGRAM=${prefix}/bin/pyuic4-2.7" |
---|
104 | #configure.args-append "-DPYRCC_PROGRAM=${prefix}/bin/pyuic4-2.7" |
---|
105 | |
---|
106 | |
---|
107 | variant qt5 conflicts qt4 description "Build with Qt5" { |
---|
108 | PortGroup qt5 1.0 |
---|
109 | #patchfiles-append patch-CMakeLists_txt.diff |
---|
110 | #post-patch { |
---|
111 | # reinplace "s|ZZZ|${prefix}|" ${worksrcpath}/CMakeLists.txt |
---|
112 | #} |
---|
113 | |
---|
114 | set Py_FRM ${frameworks_dir}/Python.framework/Versions/3.6 |
---|
115 | configure.ldflags "-Wl,-rpath,${prefix}/libexec/qt5/lib" |
---|
116 | configure.args-append "-DENABLE_QT5=ON" |
---|
117 | configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python3.6" |
---|
118 | configure.args-append "-DWITH_BINDINGS=FALSE" |
---|
119 | configure.args-append "-DQCA_INCLUDE_DIR=${prefix}/libexec/qt5/include/QtCrypto" |
---|
120 | configure.args-append "-DQCA_LIBRARY=${prefix}/libexec/qt5/lib/libqca-qt5.dylib" |
---|
121 | configure.args-append "-DQSCINTILLA_INCLUDE_DIR=${prefix}/libexec/qt5/include" |
---|
122 | configure.args-append "-DQSCINTILLA_LIBRARY=${prefix}/libexec/qt5/lib/libqscintilla2_qt5.dylib" |
---|
123 | configure.args-append "-DQWT_LIBRARY=${prefix}/libexec/qt5/lib/libqwt.dylib" |
---|
124 | configure.args-append "-DQWT_INCLUDE_DIR=${prefix}/libexec/qt5/include/qwt" |
---|
125 | configure.args-append "-DQT_LRELEASE_EXECUTABLE=${prefix}/libexec/qt5/bin/lrelease" |
---|
126 | |
---|
127 | depends_lib-append port:py36-pyqt5 \ |
---|
128 | port:py36-qscintilla2 \ |
---|
129 | port:qt5-qtscript \ |
---|
130 | port:qt5-sqlite-plugin \ |
---|
131 | port:qwt61 \ |
---|
132 | port:qca-qt5 \ |
---|
133 | port:qca-qt5-ossl |
---|
134 | |
---|
135 | pre-configure { |
---|
136 | reinplace -E "s|Versions/Current|Versions/3.6|" \ |
---|
137 | ${worksrcpath}/cmake/FindPythonLibrary.cmake |
---|
138 | } |
---|
139 | } |
---|
140 | |
---|
141 | variant qt4 conflicts qt5 description "Build with Qt4" { |
---|
142 | PortGroup qt4 1.0 |
---|
143 | set Py_FRM ${frameworks_dir}/Python.framework/Versions/2.7 |
---|
144 | |
---|
145 | configure.args-append "-DENABLE_QT5=OFF" |
---|
146 | configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python2.7" |
---|
147 | configure.args-append "-DPYTHON_CUSTOM_FRAMEWORK=${Py_FRM}" |
---|
148 | configure.args-append "-DSIP_BINARY_PATH=${prefix}/bin/sip-2.7" |
---|
149 | configure.args-append "-DPYUIC_PROGRAM=${prefix}/bin/pyuic4-2.7" |
---|
150 | configure.args-append "-DPYRCC_PROGRAM=${prefix}/bin/pyrcc4-2.7" |
---|
151 | configure.args-append "-DWITH_SERVER=TRUE" |
---|
152 | configure.args-append "-DWITH_SERVER_PLUGINS=TRUE" |
---|
153 | configure.args-append "-DQWT_INCLUDE_DIR=${prefix}/libexec/qt4/include/qwt" |
---|
154 | configure.args-append "-DQWT_LIBRARY=${prefix}/libexec/qt4/lib/libqwt-qt4.dylib" |
---|
155 | configure.args-append "-DQCA_INCLUDE_DIR=${prefix}/libexec/qt4/include/QtCrypto" |
---|
156 | configure.args-append "-DQCA_LIBRARY=${prefix}/libexec/qt4/lib/libqca.dylib" |
---|
157 | configure.args-append "-DQT_LRELEASE_EXECUTABLE=${prefix}/libexec/qt4/bin/lrelease" |
---|
158 | |
---|
159 | depends_lib-append port:py27-pyqt4 \ |
---|
160 | port:py27-qscintilla \ |
---|
161 | port:qwt61 \ |
---|
162 | port:qt4-mac-sqlite3-plugin |
---|
163 | |
---|
164 | pre-configure { |
---|
165 | reinplace -E "s|Versions/Current|Versions/2.7|" \ |
---|
166 | ${worksrcpath}/cmake/FindPythonLibrary.cmake |
---|
167 | } |
---|
168 | } |
---|
169 | |
---|
170 | # Database variants (from the GDAL port) |
---|
171 | set postgresql_suffixes {94 95 96} |
---|
172 | |
---|
173 | set portsgresql_variants {} |
---|
174 | foreach s ${postgresql_suffixes} { |
---|
175 | lappend portsgresql_variants postgresql${s} |
---|
176 | } |
---|
177 | |
---|
178 | foreach s ${postgresql_suffixes} { |
---|
179 | set p postgresql${s} |
---|
180 | set v [string index ${s} 0].[string index ${s} 1] |
---|
181 | set i [lsearch -exact ${portsgresql_variants} ${p}] |
---|
182 | set c [lreplace ${portsgresql_variants} ${i} ${i}] |
---|
183 | eval [subst { |
---|
184 | variant ${p} description "Enable PostgreSQL ${v} support" conflicts ${c} { |
---|
185 | depends_lib-append port:${p} |
---|
186 | configure.args-append \ |
---|
187 | "-DPOSTGRES_CONFIG=${prefix}/lib/${p}/bin/pg_config" |
---|
188 | } |
---|
189 | }] |
---|
190 | } |
---|
191 | |
---|
192 | # postgresql default |
---|
193 | set pgd "if {" |
---|
194 | foreach s ${postgresql_suffixes} { |
---|
195 | set pgd "${pgd}!\[variant_isset postgresql${s}\] && " |
---|
196 | } |
---|
197 | set pgd [string range ${pgd} 0 end-4] |
---|
198 | set pgd "${pgd}} { default_variants +postgresql96 }" |
---|
199 | eval ${pgd} |
---|
200 | |
---|
201 | variant grass description "Build Grass 7 plugin" { |
---|
202 | |
---|
203 | depends_lib-append port:grass7 |
---|
204 | configure.args-delete "-DWITH_GRASS7=OFF" |
---|
205 | configure.args-append "-DWITH_GRASS7=ON" |
---|
206 | configure.args-append \ |
---|
207 | "-DGRASS_PREFIX7=${prefix}/share/grass-7.2.0" |
---|
208 | } |
---|
209 | |
---|
210 | configure.dir ${worksrcpath}/build |
---|
211 | configure.cmd cmake .. |
---|
212 | |
---|
213 | configure.args-append "-DCMAKE_CXX_COMPILER=${configure.cxx}" |
---|
214 | configure.args-append "-DCMAKE_C_COMPILER=${configure.cc}" |
---|
215 | configure.args-append "-DEXPAT_INCLUDE_DIR=${prefix}/include" |
---|
216 | configure.args-append "-DEXPAT_LIBRARY=${prefix}/lib/libexpat.dylib" |
---|
217 | configure.args-append "-DCMAKE_INSTALL_PREFIX=${applications_dir}" |
---|
218 | configure.args-append "-DQGIS_MACAPP_BUNDLE=0" |
---|
219 | configure.args-append "-DGDAL_CONFIG=${prefix}/bin/gdal-config" |
---|
220 | configure.args-append "-DGDAL_INCLUDE_DIR=${prefix}/include" |
---|
221 | configure.args-append "-DGDAL_LIBRARY=${prefix}/lib/libgdal.dylib" |
---|
222 | configure.args-append "-DGEOS_CONFIG=${prefix}/bin/geos-config" |
---|
223 | configure.args-append "-DGEOS_INCLUDE_DIR=${prefix}/include" |
---|
224 | configure.args-append "-DGEOS_LIBRARY=${prefix}/lib/libgeos_c.dylib" |
---|
225 | configure.args-append "-DGSL_CONFIG=${prefix}/bin/gsl-config" |
---|
226 | configure.args-append "-DPROJ_INCLUDE_DIR=${prefix}/include" |
---|
227 | configure.args-append "-DPROJ_LIBRARY=${prefix}/lib/libproj.dylib" |
---|
228 | configure.args-append \ |
---|
229 | "-DSPATIALINDEX_LIBRARY=${prefix}/lib/libspatialindex.dylib" |
---|
230 | #configure.args-append "-DCMAKE_BUILD_TYPE=DEBUG" |
---|
231 | configure.args-append "-DCMAKE_BUILD_TYPE=RELEASE" |
---|
232 | |
---|
233 | |
---|
234 | use_parallel_build yes |
---|
235 | build.dir ${worksrcpath}/build |
---|
236 | destroot.target install |
---|