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: Portfile 146464 2016-03-09 09:58:53Z vince@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup cmake 1.0 |
---|
6 | |
---|
7 | name qgis |
---|
8 | version 2.14.2 |
---|
9 | categories gis |
---|
10 | maintainers vince |
---|
11 | description QGIS is a user-friendly GIS based on Qt 4 |
---|
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 | use_parallel_build no |
---|
21 | homepage http://www.qgis.org/ |
---|
22 | |
---|
23 | distname ${name}-${version} |
---|
24 | master_sites http://qgis.org/downloads/ |
---|
25 | use_bzip2 yes |
---|
26 | |
---|
27 | checksums rmd160 733a39ee8cea009131eaeef930bbeff00e4f9912 \ |
---|
28 | sha256 6e9e120a6c020ae620a6f917cd157364b76a307562606b35711cddaa613a17e0 |
---|
29 | |
---|
30 | patchfiles patch-app_info_plist_in.diff \ |
---|
31 | patch-PyQtMacros.diff |
---|
32 | |
---|
33 | worksrcdir ${name}-${version} |
---|
34 | |
---|
35 | depends_lib-append port:libiconv \ |
---|
36 | port:expat \ |
---|
37 | path:lib/libssl.dylib:openssl \ |
---|
38 | port:proj \ |
---|
39 | port:geos \ |
---|
40 | port:gdal \ |
---|
41 | port:sqlite3 \ |
---|
42 | port:gsl \ |
---|
43 | port:fcgi \ |
---|
44 | port:spatialindex \ |
---|
45 | port:postgis2 \ |
---|
46 | port:python27 \ |
---|
47 | port:py27-gdal \ |
---|
48 | port:qca \ |
---|
49 | port:qca-ossl |
---|
50 | |
---|
51 | depends_build-append \ |
---|
52 | port:bison \ |
---|
53 | port:ld64 \ |
---|
54 | port:py27-sip |
---|
55 | |
---|
56 | depends_run-append port:py27-psycopg2 \ |
---|
57 | port:py27-spatialite |
---|
58 | |
---|
59 | post-extract { |
---|
60 | system -W ${worksrcpath} "mkdir build" |
---|
61 | } |
---|
62 | |
---|
63 | |
---|
64 | post-patch { |
---|
65 | reinplace -E "s|@@@|${prefix}|g" \ |
---|
66 | ${worksrcpath}/mac/app.info.plist.in |
---|
67 | # reinplace -E "s|Clang|AppleClang|" ${worksrcpath}/CMakeLists.txt |
---|
68 | # Handle legacy OS/XCode |
---|
69 | if {[vercmp $xcodeversion 4.6.3] <= 0} { |
---|
70 | configure.compiler llvm-gcc-4.2 |
---|
71 | } |
---|
72 | } |
---|
73 | |
---|
74 | # Overrides default |
---|
75 | |
---|
76 | |
---|
77 | if {![variant_isset qt4] && ![variant_isset qt5]} { |
---|
78 | |
---|
79 | default_variants +qt4 |
---|
80 | } |
---|
81 | |
---|
82 | # Python related stuff |
---|
83 | |
---|
84 | set Py_FRM ${frameworks_dir}/Python.framework/Versions/2.7 |
---|
85 | |
---|
86 | configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python2.7" |
---|
87 | configure.args-append "-DWITH_GRASS=OFF" |
---|
88 | configure.args-append "-DWITH_GRASS7=OFF" |
---|
89 | configure.args-append "-DWITH_QWTPOLAR=FALSE" |
---|
90 | configure.args-append "-DGIT_MARKER=NOTFOUND" |
---|
91 | #configure.args-append "-DPYUIC_PROGRAM=${prefix}/bin/pyuic4-2.7" |
---|
92 | #configure.args-append "-DPYRCC_PROGRAM=${prefix}/bin/pyuic4-2.7" |
---|
93 | |
---|
94 | pre-configure { |
---|
95 | reinplace -E "s|Versions/Current|Versions/2.7|" \ |
---|
96 | ${worksrcpath}/cmake/FindPythonLibrary.cmake |
---|
97 | } |
---|
98 | |
---|
99 | variant qt5 conflicts qt4 description "Build with Qt5" { |
---|
100 | PortGroup qt5 1.0 |
---|
101 | #patchfiles-append patch-CMakeLists_txt.diff |
---|
102 | #post-patch { |
---|
103 | # reinplace "s|ZZZ|${prefix}|" ${worksrcpath}/CMakeLists.txt |
---|
104 | #} |
---|
105 | |
---|
106 | configure.ldflags "-Wl,-rpath,${prefix}/libexec/qt5/lib" |
---|
107 | configure.args-append "-DENABLE_QT5=ON" |
---|
108 | configure.args-append "-DWITH_BINDINGS=FALSE" |
---|
109 | configure.args-append "-DQCA_INCLUDE_DIR=${prefix}/lib/qca.framework/Headers" |
---|
110 | configure.args-append "-DQCA_LIBRARY=${prefix}/lib/qca.framework/qca" |
---|
111 | configure.args-append "-DQSCINTILLA_INCLUDE_DIR=${prefix}/libexec/qt5/include" |
---|
112 | configure.args-append "-DQSCINTILLA_LIBRARY=${prefix}/libexec/qt5/lib/libqscintilla2.dylib" |
---|
113 | configure.args-append "-DQWT_LIBRARY=${prefix}/libexec/qt5/lib/libqwt.dylib" |
---|
114 | |
---|
115 | depends_lib-append port:py27-pyqt5 \ |
---|
116 | port:qt5-qtscript |
---|
117 | |
---|
118 | } |
---|
119 | |
---|
120 | variant qt4 conflicts qt5 description "Build with Qt4" { |
---|
121 | PortGroup qt4 1.0 |
---|
122 | |
---|
123 | configure.args-append "-DENABLE_QT5=OFF" |
---|
124 | configure.args-append "-DPYTHON_CUSTOM_FRAMEWORK=${Py_FRM}" |
---|
125 | configure.args-append "-DSIP_BINARY_PATH=${prefix}/bin/sip-2.7" |
---|
126 | configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-2.7" |
---|
127 | configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-2.7" |
---|
128 | configure.args-append "-DWITH_SERVER=TRUE" |
---|
129 | configure.args-append "-DWITH_SERVER_PLUGINS=TRUE" |
---|
130 | |
---|
131 | depends_lib-append port:py27-pyqt4 \ |
---|
132 | port:py27-qscintilla \ |
---|
133 | port:qwt61 |
---|
134 | } |
---|
135 | |
---|
136 | # Database variants (from the GDAL port) |
---|
137 | set postgresql_suffixes {93 94 95} |
---|
138 | |
---|
139 | set portsgresql_variants {} |
---|
140 | foreach s ${postgresql_suffixes} { |
---|
141 | lappend portsgresql_variants postgresql${s} |
---|
142 | } |
---|
143 | |
---|
144 | foreach s ${postgresql_suffixes} { |
---|
145 | set p postgresql${s} |
---|
146 | set v [string index ${s} 0].[string index ${s} 1] |
---|
147 | set i [lsearch -exact ${portsgresql_variants} ${p}] |
---|
148 | set c [lreplace ${portsgresql_variants} ${i} ${i}] |
---|
149 | eval [subst { |
---|
150 | variant ${p} description "Enable PostgreSQL ${v} support" conflicts ${c} { |
---|
151 | depends_lib-append port:${p} |
---|
152 | configure.args-append \ |
---|
153 | "-DPOSTGRES_CONFIG=${prefix}/lib/${p}/bin/pg_config" |
---|
154 | } |
---|
155 | }] |
---|
156 | } |
---|
157 | |
---|
158 | # postgresql default |
---|
159 | set pgd "if {" |
---|
160 | foreach s ${postgresql_suffixes} { |
---|
161 | set pgd "${pgd}!\[variant_isset postgresql${s}\] && " |
---|
162 | } |
---|
163 | set pgd [string range ${pgd} 0 end-4] |
---|
164 | set pgd "${pgd}} { default_variants +postgresql94 }" |
---|
165 | eval ${pgd} |
---|
166 | |
---|
167 | variant grass description "Build Grass 7 plugin" { |
---|
168 | |
---|
169 | #depends_lib-append port:grass |
---|
170 | configure.args-delete "-DWITH_GRASS7=OFF" |
---|
171 | configure.args-append "-DWITH_GRASS7=ON" |
---|
172 | configure.args-append \ |
---|
173 | "-DGRASS_PREFIX7=${prefix}/share/grass-7.0.2" |
---|
174 | } |
---|
175 | |
---|
176 | configure.dir ${worksrcpath}/build |
---|
177 | configure.cmd cmake .. |
---|
178 | |
---|
179 | configure.args-append "-DCMAKE_CXX_COMPILER=${configure.cxx}" |
---|
180 | configure.args-append "-DCMAKE_C_COMPILER=${configure.cc}" |
---|
181 | configure.args-append "-DEXPAT_INCLUDE_DIR=${prefix}/include" |
---|
182 | configure.args-append "-DEXPAT_LIBRARY=${prefix}/lib/libexpat.dylib" |
---|
183 | configure.args-append "-DCMAKE_INSTALL_PREFIX=${applications_dir}" |
---|
184 | configure.args-append "-DQGIS_MACAPP_BUNDLE=0" |
---|
185 | configure.args-append "-DGDAL_CONFIG=${prefix}/bin/gdal-config" |
---|
186 | configure.args-append "-DGDAL_INCLUDE_DIR=${prefix}/include" |
---|
187 | configure.args-append "-DGDAL_LIBRARY=${prefix}/lib/libgdal.dylib" |
---|
188 | configure.args-append "-DGEOS_CONFIG=${prefix}/bin/geos-config" |
---|
189 | configure.args-append "-DGEOS_INCLUDE_DIR=${prefix}/include" |
---|
190 | configure.args-append "-DGEOS_LIBRARY=${prefix}/lib/libgeos_c.dylib" |
---|
191 | configure.args-append "-DGSL_CONFIG=${prefix}/bin/gsl-config" |
---|
192 | configure.args-append "-DPROJ_INCLUDE_DIR=${prefix}/include" |
---|
193 | configure.args-append "-DPROJ_LIBRARY=${prefix}/lib/libproj.dylib" |
---|
194 | configure.args-append \ |
---|
195 | "-DSPATIALINDEX_LIBRARY=${prefix}/lib/libspatialindex.dylib" |
---|
196 | configure.args-append "-DCMAKE_BUILD_TYPE=Release" |
---|
197 | |
---|
198 | use_parallel_build yes |
---|
199 | build.dir ${worksrcpath}/build |
---|
200 | destroot.target install |
---|