source: trunk/dports/gis/qgis/Portfile

Last change on this file was 154270, checked in by vince@…, 11 months ago

qgis: bump to 2.18.0

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.4 KB
Line 
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 154270 2016-10-25 19:54:18Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           cmake   1.0
6PortGroup           github  1.0
7
8version             2.18.0
9set version_u       [string map {. _} ${version}]
10github.setup        qgis QGIS ${version_u} final-
11categories          gis
12maintainers         vince
13description         QGIS is a user-friendly GIS based on Qt 4
14long_description    QGIS is a GIS. It can visualize, inject data into\
15                    PostGres/PostGIS, or serve as a Qt front-end to\
16                    Grass. Extended with Python plugins, it can become\
17                    a quite powerful GIS on its own.
18
19platforms           darwin
20license             GPL
21
22use_parallel_build  no
23homepage            http://www.qgis.org/
24
25checksums           rmd160  48451d6c4eb27ad40a9880489cfbda712a9bf3af \
26                    sha256  e9188414acb8cb7c384010db2f63e96327ee5efb8e0ceb30321bd4593751d709
27
28patchfiles          patch-app_info_plist_in.diff \
29                    patch-PyQtMacros.diff
30
31worksrcdir          ${name}-${github.version}
32
33depends_lib-append  port:libiconv \
34                    port:expat \
35                    path:lib/libssl.dylib:openssl \
36                    port:proj \
37                    port:geos \
38                    port:gdal \
39                    port:sqlite3 \
40                    port:gsl \
41                    port:fcgi \
42                    port:spatialindex \
43                    port:postgis2 \
44                    port:python27 \
45                    port:py27-gdal \
46                    port:qca \
47                    port:qca-ossl \
48                    port:qjson
49
50depends_build-append \
51                    port:bison \
52                    port:ld64 \
53                    port:py27-sip
54
55depends_run-append  port:py27-psycopg2 \
56                    port:py27-spatialite \
57                    port:py27-requests
58
59post-extract {
60    system -W ${worksrcpath} "mkdir build"
61}
62
63
64post-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
77if {![variant_isset qt4] && ![variant_isset qt5]} {
78
79    default_variants    +qt4
80}
81
82# Python related stuff
83
84set Py_FRM              ${frameworks_dir}/Python.framework/Versions/2.7
85
86configure.args-append  "-DPYTHON_EXECUTABLE=${prefix}/bin/python2.7"
87configure.args-append  "-DWITH_GRASS=OFF"
88configure.args-append  "-DWITH_GRASS7=OFF"
89configure.args-append  "-DWITH_QWTPOLAR=FALSE"
90configure.args-append  "-DGIT_MARKER=NOTFOUND"
91configure.args-append  "-DENABLE_TEST=NO"
92#configure.args-append  "--trace"
93#configure.args-append  "-DPYUIC_PROGRAM=${prefix}/bin/pyuic4-2.7"
94#configure.args-append  "-DPYRCC_PROGRAM=${prefix}/bin/pyuic4-2.7"
95
96pre-configure {
97    reinplace -E "s|Versions/Current|Versions/2.7|" \
98        ${worksrcpath}/cmake/FindPythonLibrary.cmake
99}
100
101variant qt5 conflicts qt4 description "Build with Qt5" {
102    PortGroup               qt5     1.0
103    #patchfiles-append       patch-CMakeLists_txt.diff
104    #post-patch {
105    #    reinplace           "s|ZZZ|${prefix}|" ${worksrcpath}/CMakeLists.txt
106    #}
107
108    configure.ldflags       "-Wl,-rpath,${prefix}/libexec/qt5/lib"
109    configure.args-append   "-DENABLE_QT5=ON"
110    configure.args-append   "-DWITH_BINDINGS=FALSE"
111    configure.args-append   "-DQCA_INCLUDE_DIR=${prefix}/lib/qca.framework/Headers"
112    configure.args-append   "-DQCA_LIBRARY=${prefix}/lib/qca.framework/qca"
113    configure.args-append   "-DQSCINTILLA_INCLUDE_DIR=${prefix}/libexec/qt5/include"
114    configure.args-append   "-DQSCINTILLA_LIBRARY=${prefix}/libexec/qt5/lib/libqscintilla2.dylib"
115    configure.args-append   "-DQWT_LIBRARY=${prefix}/libexec/qt5/lib/libqwt.dylib"
116
117    depends_lib-append      port:py27-pyqt5 \
118                            port:qt5-qtscript \
119                            port:qt5-sqlite-plugin
120
121}
122
123variant qt4 conflicts qt5 description "Build with Qt4" {
124    PortGroup               qt4     1.0
125
126    configure.args-append   "-DENABLE_QT5=OFF"
127    configure.args-append   "-DPYTHON_CUSTOM_FRAMEWORK=${Py_FRM}"
128    configure.args-append   "-DSIP_BINARY_PATH=${prefix}/bin/sip-2.7"
129    configure.args-append   "-DPYUIC_PROGRAM=${prefix}/bin/pyuic4-2.7"
130    configure.args-append   "-DPYRCC_PROGRAM=${prefix}/bin/pyrcc4-2.7"
131    configure.args-append   "-DWITH_SERVER=TRUE"
132    configure.args-append   "-DWITH_SERVER_PLUGINS=TRUE"
133    configure.args-append   "-DQWT_INCLUDE_DIR=${prefix}/libexec/qt4/include/qwt"
134    configure.args-append   "-DQWT_LIBRARY=${prefix}/libexec/qt4/lib/libqwt.dylib"
135
136    depends_lib-append      port:py27-pyqt4 \
137                            port:py27-qscintilla \
138                            port:qwt61 \
139                            port:qt4-mac-sqlite3-plugin
140}
141
142# Database variants (from the GDAL port)
143set postgresql_suffixes {94 95 96}
144
145set portsgresql_variants {}
146foreach s ${postgresql_suffixes} {
147    lappend portsgresql_variants postgresql${s}
148}
149
150foreach s ${postgresql_suffixes} {
151    set p postgresql${s}
152    set v [string index ${s} 0].[string index ${s} 1]
153    set i [lsearch -exact ${portsgresql_variants} ${p}]
154    set c [lreplace ${portsgresql_variants} ${i} ${i}]
155    eval [subst {
156        variant ${p} description "Enable PostgreSQL ${v} support" conflicts ${c} {
157            depends_lib-append      port:${p}
158            configure.args-append   \
159                    "-DPOSTGRES_CONFIG=${prefix}/lib/${p}/bin/pg_config"
160        }
161    }]
162}
163
164# postgresql default
165set pgd "if {"
166foreach s ${postgresql_suffixes} {
167    set pgd "${pgd}!\[variant_isset postgresql${s}\] && "
168}
169set pgd [string range ${pgd} 0 end-4]
170set pgd "${pgd}} { default_variants +postgresql95 }"
171eval ${pgd}
172
173variant grass               description "Build Grass 7 plugin" {
174
175    #depends_lib-append      port:grass
176    configure.args-delete  "-DWITH_GRASS7=OFF"
177    configure.args-append  "-DWITH_GRASS7=ON"
178    configure.args-append   \
179                "-DGRASS_PREFIX7=${prefix}/share/grass-7.0.5"
180}
181
182configure.dir               ${worksrcpath}/build
183configure.cmd               cmake ..
184
185configure.args-append  "-DCMAKE_CXX_COMPILER=${configure.cxx}"
186configure.args-append  "-DCMAKE_C_COMPILER=${configure.cc}"
187configure.args-append  "-DEXPAT_INCLUDE_DIR=${prefix}/include"
188configure.args-append  "-DEXPAT_LIBRARY=${prefix}/lib/libexpat.dylib"
189configure.args-append  "-DCMAKE_INSTALL_PREFIX=${applications_dir}"
190configure.args-append  "-DQGIS_MACAPP_BUNDLE=0"
191configure.args-append  "-DGDAL_CONFIG=${prefix}/bin/gdal-config"
192configure.args-append  "-DGDAL_INCLUDE_DIR=${prefix}/include"
193configure.args-append  "-DGDAL_LIBRARY=${prefix}/lib/libgdal.dylib"
194configure.args-append  "-DGEOS_CONFIG=${prefix}/bin/geos-config"
195configure.args-append  "-DGEOS_INCLUDE_DIR=${prefix}/include"
196configure.args-append  "-DGEOS_LIBRARY=${prefix}/lib/libgeos_c.dylib"
197configure.args-append  "-DGSL_CONFIG=${prefix}/bin/gsl-config"
198configure.args-append  "-DPROJ_INCLUDE_DIR=${prefix}/include"
199configure.args-append  "-DPROJ_LIBRARY=${prefix}/lib/libproj.dylib"
200configure.args-append  \
201        "-DSPATIALINDEX_LIBRARY=${prefix}/lib/libspatialindex.dylib"
202#configure.args-append  "-DCMAKE_BUILD_TYPE=DEBUG"
203configure.args-append  "-DCMAKE_BUILD_TYPE=RELEASE"
204
205use_parallel_build          yes
206build.dir                   ${worksrcpath}/build
207destroot.target             install
Note: See TracBrowser for help on using the repository browser.