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