# -*- 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 # $Id$ PortSystem 1.0 PortGroup cmake 1.0 PortGroup qt4 1.0 name qgis version 1.7.0 categories gis maintainers vince description QGIS is a user-friendly GIS based on Qt 4 long_description QGIS is a GIS. It can visualize, inject data into \ PostGres/PostGIS, or serve as a Qt front-end to Grass. \ Extended with Python plugins, it can become a quite \ powerful GIS on its own. platforms darwin license GPL use_parallel_build no homepage http://www.qgis.org/ distname ${name}-${version} master_sites http://qgis.org/downloads/ use_bzip2 yes checksums md5 d8506990f52563d39c7b916f500f282f \ sha1 e60f40e72c92f187d3725e6b93c13691d63a7fa7 \ rmd160 49303eab754f1e7febce388e657253563f65abed worksrcdir ${name}-${version} patchfiles patch-spatialite_c.diff \ patch-conversions_sip.diff \ patch-CMakeLists_txt.diff depends_lib-append port:libiconv \ port:expat \ port:openssl \ port:proj \ port:geos \ port:gdal \ port:sqlite3 \ port:gsl \ port:qwt52 \ port:fcgi post-extract { system "cd ${worksrcpath} && mkdir build && mkdir Python.framework" } # Does not compile wirh clang if {${configure.compiler} == "clang" || ${configure.compiler} == "macports-clang"} { configure.compiler llvm-gcc-4.2 } set Py_own_FRM ${worksrcpath}/Python.framework # Python related stuff variant python25 conflicts universal description use Python 2.5 { depends_lib-append port:py25-pyqt4 configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python2.5" configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-2.5" configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-2.5" configure.args-append \ "-DSIP_BINARY_PATH=${Py_own_FRM}/Versions/2.5/bin/sip" } variant python26 description use Python 2.6 { depends_lib-append port:py26-pyqt4 configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python2.6" configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-2.6" configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-2.6" configure.args-append \ "-DSIP_BINARY_PATH=${Py_own_FRM}/Versions/2.6/bin/sip" } variant python27 description use Python 2.7 { depends_lib-append port:py27-pyqt4 configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python2.7" configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-2.7" configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-2.7" configure.args-append \ "-DSIP_BINARY_PATH=${Py_own_FRM}/Versions/2.7/bin/sip" } variant python31 description use Python 3.1 { depends_lib-append port:py31-pyqt4 configure.args-append "-DPYTHON_EXECUTABLE=${prefix}/bin/python3.1" configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-3.1" configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-3.1" configure.args-append \ "-DSIP_BINARY_PATH=${Py_own_FRM}/Versions/3.1/bin/sip" } variant postgis description "Build postgis support" { depends_lib-append port:postgis pre-configure { # Always choose latest installed postgresql version set PGSQL_DIR \ [lindex [lsort -dec [glob -d ${prefix}/lib postgresql*]] 0] configure.args-append "-DPOSTGRES_CONFIG=${PGSQL_DIR}/bin/pg_config" } } variant grass description "Build the grass (6.4) plugin" { depends_lib-append port:grass configure.args-append "-DGRASS_PREFIX=${prefix}/share/grass-6.4.0" } # LLVM cannot be used (Seg. faults in spatialite.c) #if {[string first llvm ${configure.cc}] != -1 || \ # [string first llvm ${configure.cxx}] != -1} { # ui_msg "Warning: Qgis cannot be compiled with LLVM, switching to GCC\n" # set configure.cc gcc # set configure.cxx g++ #} # Overrides default default_variants +python27 +postgis configure.dir ${worksrcpath}/build configure.cmd cmake .. configure.args-append "-DCMAKE_CXX_COMPILER=${configure.cxx}" configure.args-append "-DCMAKE_C_COMPILER=${configure.cc}" configure.args-append "-DEXPAT_INCLUDE_DIR=${prefix}/include" configure.args-append "-DEXPAT_LIBRARY=${prefix}/lib/libexpat.dylib" configure.args-append "-DCMAKE_INSTALL_PREFIX=${applications_dir}" configure.args-append "-DGDAL_CONFIG=${prefix}/bin/gdal-config" configure.args-append "-DGDAL_INCLUDE_DIR=${prefix}/include" configure.args-append "-DGDAL_LIBRARY=${prefix}/lib/libgdal.dylib" configure.args-append "-DGEOS_CONFIG=${prefix}/bin/geos-config" configure.args-append "-DGEOS_INCLUDE_DIR=${prefix}/include/geos" configure.args-append "-DGEOS_LIBRARY=${prefix}/lib/libgeos_c.dylib" configure.args-append "-DGSL_CONFIG=${prefix}/bin/gsl-config" configure.args-append "-DPROJ_INCLUDE_DIR=${prefix}/include" configure.args-append "-DPROJ_LIBRARY=${prefix}/lib/libproj.dylib" configure.args-append "-DWITH_SPATIALITE:BOOL=NO" configure.args-append "-DPYTHON_INCLUDE_PATH=${Py_own_FRM}/Headers" configure.args-append "-DSIP_INCLUDE_DIR=${Py_own_FRM}/Headers" configure.args-append "-DCMAKE_BUILD_TYPE=Release" # This is a fake but don't ask me why it is needed configure.args-append "-DSVN_MARKER=/usr/bin/svnversion" # Patch for proper linking of our own Python framework post-configure { reinplace -E "s|(^\[^ \]*)|\\1 -F${worksrcpath}|" \ ${worksrcpath}/build/src/python/CMakeFiles/qgispython.dir/link.txt } # Setup Python stuff in order to gracefully link # against -framework Python pre-build { set variantlist [split ${portvariants} "+"] set Pyversion [string replace [lindex ${variantlist} \ [lsearch $variantlist "python*"]] 0 5] set Pyverpath [join [split ${Pyversion} ""] .] # Set up a fake framework in ${worksrcpath}/Python.framework set Py_sys_FRM "${frameworks_dir}/Python.framework/Versions/${Pyverpath}" system "cd ${Py_own_FRM} ; \ rm -f Headers Python Resources ; \ ln -s ${Py_sys_FRM}/include/python${Pyverpath} Headers ; \ ln -s ${Py_sys_FRM}/Python . ; \ ln -s ${Py_sys_FRM}/Resources . ;" } use_parallel_build yes build.dir ${worksrcpath}/build destroot.target install