[58996] trunk/dports/gis
vince at macports.org
vince at macports.org
Thu Oct 8 05:50:08 PDT 2009
Revision: 58996
http://trac.macports.org/changeset/58996
Author: vince at macports.org
Date: 2009-10-08 05:50:07 -0700 (Thu, 08 Oct 2009)
Log Message:
-----------
Initial submission
Added Paths:
-----------
trunk/dports/gis/Portfile
trunk/dports/gis/files/
trunk/dports/gis/files/LD
trunk/dports/gis/files/patch-spatialite_c.diff
Added: trunk/dports/gis/Portfile
===================================================================
--- trunk/dports/gis/Portfile (rev 0)
+++ trunk/dports/gis/Portfile 2009-10-08 12:50:07 UTC (rev 58996)
@@ -0,0 +1,211 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=2:ts=2:sts=2
+
+PortSystem 1.0
+
+name qgis
+version 1.3.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
+
+homepage http://www.qgis.org/
+
+distname ${name}_${version}
+master_sites http://download.osgeo.org/qgis/src/
+
+checksums md5 c75d0912011fe41a4e4a316ea323f73a \
+ sha1 6c2f4cf5db8d5b513306465bfd160bdfa9a727af \
+ rmd160 c2ffd90468b7f9cd49d2ba878a6572e8f19e137a
+
+worksrcdir ${name}-${version}
+
+post-extract {
+ system "cd ${worksrcpath} && mkdir build"
+}
+
+patchfiles patch-spatialite_c.diff
+
+depends_build port:cmake
+
+depends_lib port:libiconv \
+ port:expat \
+ port:openssl \
+ port:proj \
+ port:geos \
+ port:gdal \
+ port:sqlite3 \
+ port:gsl
+
+# Python related stuff
+# Checks if Python framework is not buggy
+set Python_FRM "${frameworks_dir}/Python.framework"
+ if {! [file exists ${Python_FRM}]} {
+ ui_error "Qgis requires python"
+ }
+
+set Pyver [exec python -V |& awk "{print \$2}"]
+# Eliminates minor (could also be done with strsed)
+set Pyversion [join [lrange [split ${Pyver} "."] 0 1] ""]
+set Pyverpath [join [lrange [split ${Pyver} "."] 0 1] "."]
+
+depends_lib-append port:py${Pyversion}-pyqt4
+
+
+configure.dir ${worksrcpath}/build
+configure.cmd cmake ..
+
+# Start with no configure arguments: override defaults
+configure.pre_args
+configure.args
+configure.universal_args
+
+
+variant postgis description "Build postgis support" {
+ depends_lib-append port:postgis
+
+ # Always choose latest installed postgresql version
+
+ set PGSQL_DIR \
+ [lindex [lsort -dec [glob -d ${prefix}/lib postgresql*]] 0]
+ configure.args-append "-DPOSTGRESQL_PREFIX=${PGSQL_DIR}"
+ configure.args-append "-DPOSTGRES_CONFIG=${PGSQL_DIR}/bin/pg_config"
+}
+
+
+variant grass63 description "Build the grass (6.3) plugin" {
+
+ depends_lib-append port:grass
+
+ if {[file exists ${applications_dir}/GRASS-6.3.app]} {
+ configure.args-append \
+ "-DGRASS_PREFIX=${applications_dir}/GRASS-6.3.app/Contents/MacOS"
+ } else {
+ configure.args-append "-DGRASS_PREFIX=${prefix}"
+ }
+}
+
+
+variant grass64 description "Build the grass (6.4) plugin" {
+
+ depends_lib-append port:grass64
+
+ if {[file exists ${applications_dir}/GRASS-6.4.app]} {
+ configure.args-append \
+ "-DGRASS_PREFIX=${applications_dir}/GRASS-6.4.app/Contents/MacOS"
+ } else {
+ configure.args-append "-DGRASS_PREFIX=${prefix}"
+ }
+}
+
+
+variant universal description "Builds universal app" {
+ set archs "-DCMAKE_OSX_ARCHITECTURES=\""
+
+ foreach arch ${configure.universal_archs} {
+ append archs ${arch} ";"
+ }
+ configure.args-append "${archs}\""
+ set sysroot [lindex [exec ls /Developer/SDKs] end]
+ configure.args-append "-DCMAKE_OSX_SYSROOT=/Developer/SDKs/${sysroot}"
+}
+
+# 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++
+}
+
+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"
+configure.args-append "-DGEOS_LIBRARY=${prefix}/lib/libgeos_c.dylib"
+configure.args-append "-DGEOS_LIB_NAME_WITH_PREFIX=-lgeos_c"
+configure.args-append "-DGSL_CONFIG=${prefix}/bin/gsl-config"
+configure.args-append "-DICONV_INCLUDE_DIR=${prefix}/include"
+configure.args-append "-DICONV_LIBRARY=${prefix}/lib/libiconv.dylib"
+configure.args-append "-DPROJ_INCLUDE_DIR=${prefix}/include"
+configure.args-append "-DPROJ_LIBRARY=${prefix}/lib/libproj.dylib"
+configure.args-append "-DOPENSSL_INCLUDE_DIR=${prefix}/include"
+configure.args-append "-DOPENSSL_LIBRARIES=${prefix}/lib/libssl.dylib"
+configure.args-append "-DPYTHON_INCLUDE_PATH=${Python_FRM}/Headers"
+configure.args-append "-DPYUIC4_PROGRAM=${prefix}/bin/pyuic4-${Pyverpath}"
+configure.args-append "-DPYRCC4_PROGRAM=${prefix}/bin/pyrcc4-${Pyverpath}"
+configure.args-append \
+ "-DSIP_BINARY_PATH=${Python_FRM}/Versions/${Pyverpath}/bin/sip"
+configure.args-append "-DSIP_INCLUDE_DIR=${Python_FRM}/Headers"
+configure.args-append "-DQT_QMAKE_EXECUTABLE=${prefix}/bin/qmake-mac"
+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|g\\+\\+|g\\+\\+ -F${frameworks_dir}|" \
+ ${worksrcpath}/build/src/python/CMakeFiles/qgispython.dir/link.txt
+
+# Adapts for new Sip 4.6
+ reinplace -E \
+ "s|sipClass(_\[^,\]+)|(sipWrapperType *) sipTypeAsPyTypeObject\
+ (sipType\\1)|" \
+ ${worksrcpath}/python/core/conversions.sip
+}
+
+# Setup Python stuff in order to gracefully link against -framework Python
+pre-build {
+ if {! [file exists ${Python_FRM}/Headers]} {
+ ui_msg "Patching (temporarily) the Python framework\
+ (See http://trac.macports.org/ticket/21614)"
+
+ if {[variant_isset universal] && ${Pyversion} < 26} {
+ ui_error "Universal build requires Python > 2.5"
+ }
+
+ system "cd ${Python_FRM} ; \
+ ln -s Versions/${Pyverpath}/include/python2.6 Headers ; \
+ ln -s Versions/${Pyverpath}/Python . ; \
+ ln -s Versions/${Pyverpath}/Resources . ; \
+ touch /private/tmp/qgis_pypatch"
+ } else {
+ # Checks for inconsistencies and set dependencies accordingly
+
+ if {${Pyver} != [exec cat ${Python_FRM}/Headers/patchlevel.h | \
+ grep "PY_VERSION " | awk "{print \$3}" | \
+ sed "s/\\\"//g"]} {
+ ui_error "Inconsistent Python framework installation."
+ }
+ }
+
+}
+
+use_parallel_build yes
+build.dir ${worksrcpath}/build
+
+post-destroot {
+ if {[file exists /private/tmp/qgis_pypatch]} {
+ ui_msg "Removing patched Framework"
+ system "cd ${Python_FRM} ; \
+ rm -f Headers Python Resources ; \
+ rm -f /private/tmp/qgis_pypatch"
+ }
+}
+
+destroot.target install
Added: trunk/dports/gis/files/LD
===================================================================
--- trunk/dports/gis/files/LD (rev 0)
+++ trunk/dports/gis/files/LD 2009-10-08 12:50:07 UTC (rev 58996)
@@ -0,0 +1,9 @@
+#!/bin/sh
+ARG="ld -F /usr/pkg/frameworks -framework Python "
+for args in $@ ;
+do
+ ARG+=`echo $args | \
+ sed 's|/System/Library/Frameworks/Python.framework/.*/||'`
+ ARG+=" "
+done
+echo $ARG
Property changes on: trunk/dports/gis/files/LD
___________________________________________________________________
Added: svn:executable
+
Added: trunk/dports/gis/files/patch-spatialite_c.diff
===================================================================
--- trunk/dports/gis/files/patch-spatialite_c.diff (rev 0)
+++ trunk/dports/gis/files/patch-spatialite_c.diff 2009-10-08 12:50:07 UTC (rev 58996)
@@ -0,0 +1,37 @@
+--- src/core/spatialite/spatialite.c.orig 2009-09-24 07:35:35.000000000 +0200
++++ src/core/spatialite/spatialite.c 2009-09-24 07:36:23.000000000 +0200
+@@ -72,13 +72,13 @@
+ #include <localcharset.h>
+ #endif /* end localcharset */
+ #else /* not WINDOWS */
+-#ifdef __APPLE__
+-#include <iconv.h>
+-#include <localcharset.h>
+-#else /* not Mac OsX */
++//#ifdef __APPLE__
++//#include <iconv.h>
++//#include <localcharset.h>
++//#else /* not Mac OsX */
+ #include <iconv.h>
+ #include <langinfo.h>
+-#endif
++//#endif
+ #endif
+
+ #if OMIT_GEOS == 0 /* including GEOS */
+@@ -7526,11 +7526,11 @@
+ #if defined(__MINGW32__) || defined(_WIN32)
+ return locale_charset ();
+ #else /* not MINGW32 - WIN32 */
+-#ifdef __APPLE__
+- return locale_charset ();
+-#else /* not Mac OsX */
++//#ifdef __APPLE__
++// return locale_charset ();
++//#else /* not Mac OsX */
+ return nl_langinfo (CODESET);
+-#endif
++//#endif
+ #endif
+ }
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091008/b76b4bda/attachment.html>
More information about the macports-changes
mailing list