1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="sqlite"
10 inherit eutils multilib gnome2-utils cmake-utils python-single-r1
12 DESCRIPTION="User friendly Geographic Information System"
13 HOMEPAGE="http://www.qgis.org/"
15 http://qgis.org/downloads/qgis-${PV}.tar.bz2
16 examples? ( http://download.osgeo.org/qgis/data/qgis_sample_data.tar.gz )"
20 KEYWORDS="~amd64 ~x86"
21 IUSE="examples grass gsl mapserver postgres python test"
23 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
24 mapserver? ( python )"
29 sci-geosciences/gpsbabel
30 >=sci-libs/gdal-1.6.1[geos,python?,${PYTHON_USEDEP}]
33 sci-libs/libspatialindex
43 ( || ( <x11-libs/qwt-6.1.2:6[svg] >=x11-libs/qwt-6.1.2:6[svg,qt4] ) >=x11-libs/qwtpolar-1 )
44 ( x11-libs/qwt:5[svg] <x11-libs/qwtpolar-1 )
46 grass? ( || ( >=sci-geosciences/grass-7.0.0 ) )
47 mapserver? ( dev-libs/fcgi )
48 postgres? ( dev-db/postgresql:* )
50 dev-python/PyQt4[X,sql,svg,webkit,${PYTHON_USEDEP}]
51 dev-python/sip[${PYTHON_USEDEP}]
52 dev-python/qscintilla-python[${PYTHON_USEDEP}]
53 postgres? ( dev-python/psycopg:2[${PYTHON_USEDEP}] )
58 app-crypt/qca:2[qt4,openssl]
66 python-single-r1_pkg_setup
71 "-DQGIS_MANUAL_SUBDIR=/share/man/"
72 "-DBUILD_SHARED_LIBS=ON"
73 "-DQGIS_LIB_SUBDIR=$(get_libdir)"
74 "-DQGIS_PLUGIN_SUBDIR=$(get_libdir)/qgis"
75 "-DWITH_INTERNAL_QWTPOLAR=OFF"
78 "-DWITH_SPATIALITE=ON"
79 "-DWITH_INTERNAL_SPATIALITE=OFF"
80 $(cmake-utils_use_with postgres POSTGRESQL)
81 $(cmake-utils_use_with grass GRASS)
82 $(cmake-utils_use_with mapserver SERVER)
83 $(cmake-utils_use_with python BINDINGS)
84 $(cmake-utils_use python BINDINGS_GLOBAL_INSTALL)
85 $(cmake-utils_use_with python PYSPATIALITE)
86 $(cmake-utils_use_with gsl GSL)
87 $(cmake-utils_use_enable test TESTS)
88 $(usex grass "-DGRASS_PREFIX=/usr/" "")
91 if has_version '>=x11-libs/qwtpolar-1' && has_version 'x11-libs/qwt:5' ; then
92 elog "Both >=x11-libs/qwtpolar-1 and x11-libs/qwt:5 installed. Force build with qwt6"
93 if has_version '>=x11-libs/qwt-6.1.2' ; then
95 "-DQWT_INCLUDE_DIR=/usr/include/qwt6"
96 "-DQWT_LIBRARY=/usr/$(get_libdir)/libqwt6-qt4.so"
100 "-DQWT_INCLUDE_DIR=/usr/include/qwt6"
101 "-DQWT_LIBRARY=/usr/$(get_libdir)/libqwt6.so"
106 cmake-utils_src_configure
110 cmake-utils_src_install
111 dodoc BUGS ChangeLog CODING
113 newicon -s 128 images/icons/qgis-icon.png qgis.png
114 make_desktop_entry qgis "QGIS " qgis
116 if use examples; then
117 insinto /usr/share/doc/${PF}/examples
118 doins -r "${WORKDIR}"/qgis_sample_data/*
121 python_optimize "${D}"/usr/share/qgis/python/plugins \
122 "${D}"/$(python_get_sitedir)/qgis
125 python_fix_shebang "${D}"/usr/share/qgis/grass/scripts
126 python_optimize "${D}"/usr/share/qgis/grass/scripts
135 if use postgres; then
136 elog "If you don't intend to use an external PostGIS server"
137 elog "you should install:"
138 elog " dev-db/postgis"
141 elog "Support of PostgreSQL is disabled."
142 elog "But some installed python-plugins needs import psycopg2 module."
143 elog "If you do not need this modules just disable them in main menu."
144 elog "Or you need to set USE=postgres"
148 gnome2_icon_cache_update
152 gnome2_icon_cache_update